RumbleDB / rumble

⛈️ RumbleDB 1.22.0 "Pyrenean oak" 🌳 for Apache Spark | Run queries on your large-scale, messy JSON-like data (JSON, text, CSV, Parquet, ROOT, AVRO, SVM...) | No install required (just a jar to download) | Declarative Machine Learning and more
http://rumbledb.org/
Other
213 stars 82 forks source link

not having issues when used twice in same query #864

Open mstevan opened 3 years ago

mstevan commented 3 years ago

@mstevan test-set: not.xml test-cases: fn-not-5 to fn-not-16

@team Not behaves weirdly when having two not calls within same query. not("true") or not("true") for example works but not("true") eq not("true")

List of operators to test with because it throws exception: Eq,ne,lt,le,gt,ge,=,!=,<,<=,>,>=

Input: not("true") eq not("true")

Output: ⚠️ ️There was an error.

Code: [XPST0017] (this code can be looked up in the documentation and specifications).

Location information: file:/Users/mstevan/Documents/:LINE:1:COLUMN:15:

Undefined function call; Entered function name and arity doesn't match a defined function signature: "not" called with 1 parameters.

Expected output: true

ghislainfourny commented 3 years ago

That's because in JSONiq not is a prefix operator, not a function call.

When serializing back from XQuery to JSONiq, extra parentheses should be added:

(not "true") eq (not "true")