Sparksoniq relies on the JSONiq language.
A tutorial can be found here. Most queries in this tutorial will work with Sparksoniq, except that the complex FLWOR query does not work (yet), because of unsupported nesting.
JSONiq tutorial for Python users
A tutorial aimed at Python users can be found here. Please keep in mind, though, that examples using not supported features may not work (see below).
Unsupported/Unimplemented features (alpha release)
Many core features of JSONiq are in place, but please be aware that the function features are not yet implemented. We are working on them for subsequent releases.
Unsupported nested FLWOR expressions
FLWOR expressions may sometimes raise errors, especially if nested. We are also working on generalized FLWOR supported, also local. Instead of using lets, you need to inline the expressions.
Do NOT do
let $x := for $x in json-file("file.json") where $x.field eq "foo" return $x return count($x)
count(for $x in json-file("file.json") where $x.field eq "foo" return $x)
Expressions NOT pushed down to Spark yet
Some expressions are not yet pushed down to Spark (but this will come soon!).
Do NOT do
json-file("file.json")[$$.field eq "foo"].bar
Do instead use an explicit FLWOR expression:
for $x in json-file("file.json") where $x.field eq "foo" return $x.bar
Prologs are not supported. This includes user-defined functions, global variables, settings and library modules.
Try/catch expressions. Exceptions raised remotely may not be displayed in a user-friendly way yet, but we are working on it.
Unsupported nested expressions in object lookups (rhs)
Nested object lookup keys: nested expressions on the rhs of the dot syntax are not supported yet.
Unsupported count clauses
Count clauses in FLWOR expressions. This feature will arrive very soon, though.
The type system is not complete yet: we have objects, arrays, strings, numbers, booleans and null, but not yet: dates, durations, binaries and so on.
Not all JSONiq functions are supported (see function documentation), even though they get added continuously. Please take a look at the function library documentation to know which functions are available.
Unsupported updates and scripting
JSON updates are not supported. Scripting features (assignment, while loop, ...) are not supported yet either.