Horje
how to have framer read json timestamps Code Example
how to have framer read json timestamps
scala> val regex =  "([0-9\\-TZ\\.:]+) (\\{.*)"
regex: String = ([0-9\-TZ\.:]+) (\{.*)

scala> val dff = df.withColumn("tstamp", regexp_extract('json_content, regex, 1)).withColumn("json", regexp_extract('json_content, regex, 2)).drop("json_content")
dff: org.apache.spark.sql.DataFrame = [country: string, city: string ... 2 more fields]

scala> dff.show(false)
+-------+-------+------------------------+----------------------------------+
|country|city   |tstamp                  |json                              |
+-------+-------+------------------------+----------------------------------+
|america|chicago|2019-06-28T00:00:00.000Z|{ "a": 123, "b": "456", "c": 789 }|
|india  |mumbai |2019-06-28T00:00:00.000Z|{ "a": 123, "b": "456", "c": 789 }|
+-------+-------+------------------------+----------------------------------+




Python

Related
currelation matrix python Code Example currelation matrix python Code Example
use ipython magic in script Code Example use ipython magic in script Code Example
fouier transformation in python open cv Code Example fouier transformation in python open cv Code Example
np.transpose(x) array([[0, 2], [1, 3]]) Code Example np.transpose(x) array([[0, 2], [1, 3]]) Code Example
python split files into even sets of folders Code Example python split files into even sets of folders Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7