Dear all,

Right on time for Christmas, I am happy to share news with you on the latest 
release of the free and open source Rumble, 1.4.2 Willow Oak.

Rumble is a JSONiq engine with which you can query nested, heterogeneous data 
(e.g., JSON) on Spark, but it carefully hides Spark's RDDs and DataFrames from 
the user for a productive experience.

Since the last announcement on this list (Rumble 1.1), the following is new:

1. Types

Type expressions are all supported: cast as, castable as, treat as, instance 
of, typeswitch. Item types are checked in parallel if the input sequence is big.
Rumble supports new types (you will recognize standard XML Schema types): date, 
time, dateTime, hexBinary, base64Binary, duration, and more.
Grouping and ordering on these new types is supported (even in parallel, with 
DataFrames below the hood).

2. Functions

User-defined functions are supported. This means you can define your own 
functions.

Recursion works out of the box.


declare function fibonacci($i) {
  if($i le 2) then 1 else fibonacci($i - 1) + fibonacci($i - 2)
};

for $i in 1 to 20
return fibonacci($i)


Higher-order functions are also supported (this follows the XQuery 3.0 
standard). Functions can be passed as values to expressions and other functions 
and dynamically called. And they also get automatically serialized, shipped to 
the Spark cluster, deserialized and called if you build big sequences of 
functions.


let $x := function($x as integer) as integer { $x * $x }
return $x(4)


Type-checking is made on all function parameters and returned values (if types 
are provided), and sequence types are automatically checked in parallel if 
sequences are large.

3. Parquet

We started adding other formats that have a similar data model to JSON, for 
example with parquet-file(), you can open... Parquet files. This will nicely 
map it to a sequence of objects that can then be queried in parallel. More 
formats will follow.

It is also possible, for convenience, to open small, local JSON files spread 
over multiple lines with json-doc(). (json-file() requires one object per line 
and is meant for the parallelization over large files on HDFS, S3 or local 
drive).

4. Bugfixes and enhancements

Many small things that our students found have been fixed: variables bound by 
an outer FLWOR is visible in inner FLWOR expressions as well. We throw more 
user-friendly exceptions if you nest a big FLWOR inside a big FLWOR (which, for 
obvious reasons, will "break" on the cluster). The FLWOR count clause is more 
stable (that one was not easy to get to work on top of DataFrames).

5. Predicates

position() and last() are supported in predicates. And predicates are executed 
in parallel on big sequences. It is very easy to get a subsequence from a big 
sequence (this otherwise requires more effort to do in Java or Scala)

json-file("file.json")[1]
json-file("file.json")[position() ge 10 and position() le last() - 20]

6. Counting optimizations

Rumble auto-detects when a non-grouping variable is only counted, and will 
spontaneously get rid of all the items early, to only keep the count. This 
significantly improves performance of such queries:

for $object in json-file("file.json")
group by $country := $object.country
return { "country" : $country, "count" : count($object) }

And finally, for those interested in the nitty gritty, we uploaded a paper 
here: https://arxiv.org/pdf/1910.11582.pdf

Enjoy!

Kind regards and happy slide into 2020,
Ghislain


_______________________________________________
talk@x-query.com
http://x-query.com/mailman/listinfo/talk

Reply via email to