Skip to content

Conversation

@gianm
Copy link
Contributor

@gianm gianm commented Oct 27, 2017

The issue was that adding an empty array didn't add null to the dictionary,
but it's important to add null to the dictionary because (a) it's used when
converting [] -> null for single value columns; (b) even in multi-value columns,
it's present in the inverted index and it should point back to any empty arrays.
If some other row added null to the dictionary (maybe it was a literal null,
missing value, or empty string) then everything worked out ok, but if not
then persisting would write out bad data.

This bug was able to introduce data errors: if the input rows to an
IncrementalIndex contained entirely empty arrays and single values, then
upon persisting to disk, the empty arrays would be replaced with the
lexicographically smallest single value, rather than nulls like they
should have been.

I'm not sure what patch introduced the bug, but I tested some earlier
releases, and 0.9.2 doesn't include it but 0.10.0 and 0.10.1 both do.
I marked this fix for 0.11.0 due to the potential for data errors.

This bug was able to introduce data errors: if the input rows to an
IncrementalIndex contained entirely empty arrays and single values, then
upon persisting to disk, the empty arrays would be replaced with the
lexicographically smallest single value, rather than nulls like they
should have been.
@gianm gianm added the Bug label Oct 27, 2017
@gianm gianm added this to the 0.11.0 milestone Oct 27, 2017
@fjy fjy merged commit 1df458b into apache:master Oct 27, 2017
@gianm gianm deleted the fix-nulls branch October 27, 2017 21:26
gianm added a commit to gianm/druid that referenced this pull request Oct 27, 2017
…che#5012)

* Fix improper handling of empty arrays in StringDimensionIndexer.

This bug was able to introduce data errors: if the input rows to an
IncrementalIndex contained entirely empty arrays and single values, then
upon persisting to disk, the empty arrays would be replaced with the
lexicographically smallest single value, rather than nulls like they
should have been.

* Style fix.

* Add tests for bitmap indexes too.
@leventov
Copy link
Member

@fjy please don't merge that fast, I was planning to review this PR. It's not a blocker for 0.11 because we are still going to submit more fixes for 0.11 next week

@fjy
Copy link
Contributor

fjy commented Oct 27, 2017

@leventov Please let us know sooner if you plan to review

jihoonson pushed a commit that referenced this pull request Oct 28, 2017
…) (#5019)

* Fix improper handling of empty arrays in StringDimensionIndexer.

This bug was able to introduce data errors: if the input rows to an
IncrementalIndex contained entirely empty arrays and single values, then
upon persisting to disk, the empty arrays would be replaced with the
lexicographically smallest single value, rather than nulls like they
should have been.

* Style fix.

* Add tests for bitmap indexes too.
@leventov
Copy link
Member

@fjy posted in mailing list. Note that it won't make 0.11.0-rc2 to go out faster, because it's still blocked on us (in particular, on #4973 and 1-2 PRs that are not published yet)

gianm added a commit to implydata/druid-public that referenced this pull request Nov 8, 2017
…che#5012)

* Fix improper handling of empty arrays in StringDimensionIndexer.

This bug was able to introduce data errors: if the input rows to an
IncrementalIndex contained entirely empty arrays and single values, then
upon persisting to disk, the empty arrays would be replaced with the
lexicographically smallest single value, rather than nulls like they
should have been.

* Style fix.

* Add tests for bitmap indexes too.
leventov pushed a commit to metamx/druid that referenced this pull request Nov 13, 2017
…che#5012) (apache#5019)

* Fix improper handling of empty arrays in StringDimensionIndexer.

This bug was able to introduce data errors: if the input rows to an
IncrementalIndex contained entirely empty arrays and single values, then
upon persisting to disk, the empty arrays would be replaced with the
lexicographically smallest single value, rather than nulls like they
should have been.

* Style fix.

* Add tests for bitmap indexes too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants