You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But I find the performance of some spark functions are wired. We need to discuss its performance. I write my expectation for this function
Functions
json path input ? ('$.f1.f2')
support regex input? ('$.f1[*].f2')
perform when json path point to null
perform when father path point to null
json_extract
Y
Y
return null
return null
json_set
Y
Y
do insert anyway
do nothing
json_delete
Y
Y
do nothing
do nothing
json_append
Y
Y
do nothing
do nothing
json_extend
Y
Y
do nothing
do nothing
And here is the spark's performance
Functions
json path input ? ('$.f1.f2')
support regex input? ('$.f1[*].f2')
perform when json path point to null
perform when father path point to null
json_extract
Y
Y
return null
return null
json_set
N
N
insert anyway
insert anyway
json_delete
N
N
do nothing
do nothing
json_append
N
N
the value are added to the root of the json tree
the value are added to the root of the json tree
json_extend
N
N
the value are added to the root of the json tree
the value are added to the root of the json tree
And here are the functions in calcite
Functions
corresponding calcite implementation
json path input ? ('$.f1.f2')
support regex input? ('$.f1[*].f2')
perform when json path point to null
perform when father path point to null
json_extract
json_value/json_query
Y
N. json_value return scalar while json_query return object/array. We need a combination
return null
return null
json_set
Json_set
Y
N. Calcite use JsonPath.isPathDefinite
do insert anyway
do nothing
json_delete
json_remove
Y
N. Calcite use JsonPath.isPathDefinite
do nothing
do nothing
json_append
json_insert
Y
N. Calcite use JsonPath.isPathDefinite
do nothing
do nothing
json_extend
/
/
/
/
/
BTW, for json_append and json_extend, the only difference is when the target object the json path pointed is an array and candidate input is also an array, append would directly add it as [a, b, [candidate1, candidate2]] while extend would [a, b, candidate, candidate..] can we implement only one command? Looks the calcite only support json_append using sqlLibraryOperators.JSON_INSERT
Activity
[-][FEATURE] Support Json like functions[/-][+][FEATURE] Support Json related functions[/+]xinyual commentedon Apr 22, 2025
But I find the performance of some spark functions are wired. We need to discuss its performance. I write my expectation for this function
And here is the spark's performance
And here are the functions in calcite
BTW, for json_append and json_extend, the only difference is when the target object the json path pointed is an array and candidate input is also an array, append would directly add it as [a, b, [candidate1, candidate2]] while extend would [a, b, candidate, candidate..] can we implement only one command? Looks the calcite only support json_append using
sqlLibraryOperators.JSON_INSERTxinyual commentedon Apr 22, 2025
cc. @LantaoJin @penghuo
penghuo commentedon Apr 29, 2025
in opensearch-spark, current json_extract return string, the expectation is ARRAY or PPL scaler data type?
xinyual commentedon Apr 30, 2025
Will align with splunk implementation. https://docs.splunk.com/Documentation/SCS/current/SearchReference/JSONFunctions#json_extract.28.26lt.3Bjson.26gt.3B.2C_.26lt.3Bpaths.26gt.3B.29