[FEATURE] Add TO_JSON_STRING
and ARRAY_LENGHT
functions and refactor the JSON
function
#869
Labels
TO_JSON_STRING
and ARRAY_LENGHT
functions and refactor the JSON
function
#869
Is your feature request related to a problem?
A followup of #667
Refactor
JSON
: Currently theJSON
evaluates STRING/JSON_ARRAY/JSON_OBJECT. It brings many confusions. In Splunk, the data could be stored as JSON object,JSON
function evaluates JSON object. But in Spark, there is no JSON object, but it contains STRING, StructType and ArrayType. So theJSON
function can only evaluate STRING types.Add
ARRAY_LENGHT
: for the same reason above, we separateJSON_ARRAY_LENGHT
toJSON_ARRAY_LENGHT
andARRAY_LENGHT
.JSON_ARRAY_LENGHT
only accepts STRING type,ARRAY_LENGHT
only accepts ArrayType.Add
TO_JSON_STRING
: After the refactor of (1), we still need a method to convert JSON_ARRAY/JSON_OBJECT to valid JSON STRING.TO_JSON_STRING
accepts both StructType and ArrayType as input and returns JSON formatted string.The text was updated successfully, but these errors were encountered: