Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected group-by query result - (occurs non-deterministically) #419

Open
CanBerker opened this issue Jan 7, 2020 · 0 comments
Open
Labels

Comments

@CanBerker
Copy link
Collaborator

(:JIQS: ShouldRun; Output="([ 1, { "guess" : "Arabic", "choices" : [ "Arabic", "Cantonese", "Maltese", "Samoan" ] }, { "guess" : "Arabic", "choices" : [ "Albanian", "Arabic", "Czech", "Dutch" ] } ], [ 2, { "guess" : "Bulgarian", "target" : "Albanian", "country" : "AU", "choices" : [ "Albanian", "Bulgarian", "Russian", "Ukrainian" ] }, { "guess" : "Bulgarian", "target" : "Albanian", "country" : "AU", "choices" : [ "Arabic", "Bulgarian", "Hebrew", "Spanish" ] } ], [ 3, { "guess" : "Arabic", "country" : null, "choices" : [ "Arabic", "Greek", "Hebrew", "Spanish" ] } ], [ 4, { "guess" : "Arabic", "country" : "IN", "choices" : [ "Arabic", "Greek", "Hebrew", "Spanish" ] } ], [ 5, { "guess" : "Slovenian", "target" : "Norwegian", "country" : "AU", "choices" : [ "Dinka", "Nepali", "Norwegian", "Slovenian" ] } ], [ 6, { "guess" : "Bulgarian", "target" : null, "country" : "AU", "choices" : [ "Albanian", "Bulgarian", "Russian", "Ukrainian" ] }, { "guess" : "Bulgarian", "target" : null, "country" : "AU", "choices" : [ "Arabic", "Bulgarian", "Hebrew", "Spanish" ] } ])" :)

for $i in parallelize((
{"guess": "Slovenian", "target": "Norwegian", "country": "AU", "choices": ["Dinka", "Nepali", "Norwegian", "Slovenian"]},
{"guess": "Arabic", "choices": ["Arabic", "Cantonese", "Maltese", "Samoan"]},
{"guess": "Arabic", "choices": ["Albanian", "Arabic", "Czech", "Dutch"]},
{"guess": "Arabic", "country": "IN", "choices": ["Arabic", "Greek", "Hebrew", "Spanish"]},
{"guess": "Arabic", "country": null, "choices": ["Arabic", "Greek", "Hebrew", "Spanish"]},
{"guess": "Bulgarian", "target": "Albanian", "country": "AU", "choices": ["Albanian", "Bulgarian", "Russian", "Ukrainian"]},
{"guess": "Bulgarian", "target": "Albanian", "country": "AU", "choices": ["Arabic", "Bulgarian", "Hebrew", "Spanish"]},
{"guess": "Bulgarian", "target": null, "country": "AU", "choices": ["Albanian", "Bulgarian", "Russian", "Ukrainian"]},
{"guess": "Bulgarian", "target": null, "country": "AU", "choices": ["Arabic", "Bulgarian", "Hebrew", "Spanish"]}))
group by $guess := $i.guess, $target := $i.target, $country := $i.country
count $group_index
return [$group_index, $i]

(: complex test with nulls and empty sequences - grouping variable defined in place:)

Failed tests: testRuntimeIterators[150:/home/travis/build/RumbleDB/rumble/src/main/resources/test_files/runtime-spark/DataFrames/GroupbyClause7.jq](iq.SparkRuntimeTests):

Expected output: ([ 1, { "guess" : "Arabic", "choices" : [ "Arabic", "Cantonese", "Maltese", "Samoan" ] }, { "guess" : "Arabic", "choices" : [ "Albanian", "Arabic", "Czech", "Dutch" ] } ], [ 2, { "guess" : "Bulgarian", "target" : "Albanian", "country" : "AU", "choices" : [ "Albanian", "Bulgarian", "Russian", "Ukrainian" ] }, { "guess" : "Bulgarian", "target" : "Albanian", "country" : "AU", "choices" : [ "Arabic", "Bulgarian", "Hebrew", "Spanish" ] } ], [ 3, { "guess" : "Arabic", "country" : null, "choices" : [ "Arabic", "Greek", "Hebrew", "Spanish" ] } ], [ 4, { "guess" : "Arabic", "country" : "IN", "choices" : [ "Arabic", "Greek", "Hebrew", "Spanish" ] } ], [ 5, { "guess" : "Slovenian", "target" : "Norwegian", "country" : "AU", "choices" : [ "Dinka", "Nepali", "Norwegian", "Slovenian" ] } ], [ 6, { "guess" : "Bulgarian", "target" : null, "country" : "AU", "choices" : [ "Albanian", "Bulgarian", "Russian", "Ukrainian" ] }, { "guess" : "Bulgarian", "target" : null, "country" : "AU", "choices" : [ "Arabic", "Bulgarian", "Hebrew", "Spanish" ] } ])

Actual result: ([ 1, { "guess" : "Arabic", "choices" : [ "Arabic", "Cantonese", "Maltese", "Samoan" ] }, { "guess" : "Arabic", "choices" : [ "Albanian", "Arabic", "Czech", "Dutch" ] } ], [ 2, { "guess" : "Bulgarian", "target" : "Albanian", "country" : "AU", "choices" : [ "Albanian", "Bulgarian", "Russian", "Ukrainian" ] }, { "guess" : "Bulgarian", "target" : "Albanian", "country" : "AU", "choices" : [ "Arabic", "Bulgarian", "Hebrew", "Spanish" ] } ], [ 3, { "guess" : "Arabic", "country" : null, "choices" : [ "Arabic", "Greek", "Hebrew", "Spanish" ] } ], [ 4, "IN" ], [ 5, { "guess" : "Slovenian", "target" : "Norwegian", "country" : "AU", "choices" : [ "Dinka", "Nepali", "Norwegian", "Slovenian" ] } ], [ 6, { "guess" : "Bulgarian", "target" : null, "country" : "AU", "choices" : [ "Albanian", "Bulgarian", "Russian", "Ukrainian" ] }, { "guess" : "Bulgarian", "target" : null, "country" : "AU", "choices" : [ "Arabic", "Bulgarian", "Hebrew", "Spanish" ] } ])

@CanBerker CanBerker removed their assignment Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants