Is there a function similar to split_part, json_extract_scalar?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2022 07:38 PM
I am using spark_sql version 3.2.1. Is there a function that can replace
split_part,
json_extract_scalar
are not?
- Labels:
-
Databricks SQL
-
Json Extract
-
SQL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2022 03:55 AM
pyspark.sql.functions.
get_json_object
(col, path)[source]
Extracts json object from a json string based on json path specified, and returns json string of the extracted json object. It will return null if the input json string is invalid.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2022 08:52 PM
Thanks @Ankush Jadhao for answer, I tried but only returns the first result in the cell. They seem to only take the first character with the correct result. I need out put like the table below.
I have the following input:
I am looking for a way to split the characters in the item_order_detail column into 2 columns itemID and itemName. As below output table uses SQL function in databricks with spark_sql version 3.2.1.

