question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Filter an array of objects by IS NULL or IS NOT NULL does not work properly

See original GitHub issue

CrateDB version: 1.1.5

JVM version: 1.8.0_131

OS version / environment description: Amaon Linux version 4.9.20-11.31.amzn1.x86_64

Problem description: When attempting to filter an array of objects field by IS NULL or IS NOT NULL, improper results are returned. Column definition: "product_info" ARRAY(OBJECT (STRICT) AS ( "amount" DOUBLE, "occurrences" INTEGER, "product_key" STRING, "quantity" DOUBLE ))

In this example, filtering by IS NULL returns values which are both NULL and NOT NULL: image

In this example. filter by IS NOT NULL returns nothing: image

Example column value: [{product_key='BD5A79D7-23BA-4B20-96CC-08699A0BE342',occurrences='1',amount='7.38',quantity='1'},{product_key='8AB0DBBD-EAFA-441A-962B-7588706DFA98',occurrences='1',amount='6.76',quantity='1'},{product_key='2157E849-70D0-4587-98CF-7D6F9B9AB114',occurrences='1',amount='6.91',quantity='1'},{product_key='6152ECE4-056F-4906-92C0-7DE1B82AA79F',occurrences='1',amount='7.94',quantity='1'},{product_key='E34633B0-DBAE-4784-ACDD-D65EBF9E5D3D',occurrences='1',amount='4.77',quantity='1'}]

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
turbo-elecommented, Jun 29, 2017

@tellezb The issue has been resolved in versions 1.1.6 and 2.0.2

0reactions
turbo-elecommented, Jun 22, 2017

@tellezb the issue will be fixed within the next release. again, thanks for reporting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to filter null from array of objects? - Stack Overflow
You could filter the array by checking the data. ... array.filter(v => v !== null); console.log(withoutNull);. Run code snippet
Read more >
Array.prototype.filter() - JavaScript - MDN Web Docs
The filter() method creates a shallow copy of a portion of a given array, filtered down to just the elements from the given...
Read more >
array_filter - Manual - PHP
array_filter — Filters elements of an array using a callback function ... If no callback is supplied, all empty entries of array will...
Read more >
Everything you wanted to know about arrays - PowerShell
So make sure your arrays are not $null before you try to access elements inside them. Count. Arrays and other collections have a...
Read more >
Null safety - Kotlin
Nullable types and non-null types ... Nullability issues with generic types being used for Java interoperation. For example, a piece of Java ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found