Skip to content

write value of bitmap as field name#8066

Merged
fjy merged 3 commits intoapache:masterfrom
pjain1:fix_dump_tool
Jul 12, 2019
Merged

write value of bitmap as field name#8066
fjy merged 3 commits intoapache:masterfrom
pjain1:fix_dump_tool

Conversation

@pjain1
Copy link
Copy Markdown
Member

@pjain1 pjain1 commented Jul 11, 2019

I was trying to dump bitmaps for a segment and got this error -

Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: com.fasterxml.jackson.core.JsonGenerationException: Can not start an array, expecting field name
	at org.apache.druid.cli.DumpSegment.run(DumpSegment.java:197)
	at org.apache.druid.cli.Main.main(Main.java:112)
Caused by: java.lang.RuntimeException: com.fasterxml.jackson.core.JsonGenerationException: Can not start an array, expecting field name
	at org.apache.druid.cli.DumpSegment$3.apply(DumpSegment.java:391)
	at org.apache.druid.cli.DumpSegment$3.apply(DumpSegment.java:342)
	at org.apache.druid.cli.DumpSegment.withOutputStream(DumpSegment.java:427)
	at org.apache.druid.cli.DumpSegment.runBitmaps(DumpSegment.java:340)
	at org.apache.druid.cli.DumpSegment.run(DumpSegment.java:190)
	... 1 more
Caused by: com.fasterxml.jackson.core.JsonGenerationException: Can not start an array, expecting field name
	at com.fasterxml.jackson.core.JsonGenerator._reportError(JsonGenerator.java:1649)
	at com.fasterxml.jackson.core.json.UTF8JsonGenerator._verifyValueWrite(UTF8JsonGenerator.java:949)
	at com.fasterxml.jackson.core.json.UTF8JsonGenerator.writeStartArray(UTF8JsonGenerator.java:282)
	at org.apache.druid.cli.DumpSegment$3.apply(DumpSegment.java:367)
	... 5 more

So the column value for which bitmap will be output was missing so added it. Not sure how was it working before, can anybody try if they are getting the same exception without this fix ?

@pjain1 pjain1 added the Bug label Jul 11, 2019
@pjain1
Copy link
Copy Markdown
Member Author

pjain1 commented Jul 11, 2019

Added one more commit to make sure if null is present in the dictionary then it is respected, without this bitmap for null value will be skipped.

@himanshug
Copy link
Copy Markdown
Contributor

LGTM
not sure if it could ever work in json writing an array value inside object without writing a field name first. I think it ignores value when field name is not written, in the jackson core version 2.6.7.
do you have 2.6.7 jackson core version or did that get overridden for you by any chance, that could explain why it is failing for you now.

@pjain1
Copy link
Copy Markdown
Member Author

pjain1 commented Jul 11, 2019

#5382 downgraded jackson to 2.6.7, probably it was working before this with the higher version.

Copy link
Copy Markdown
Member

@clintropolis clintropolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍

@fjy fjy merged commit 6c35da3 into apache:master Jul 12, 2019
@pjain1 pjain1 deleted the fix_dump_tool branch July 12, 2019 04:05
@clintropolis clintropolis added this to the 0.16.0 milestone Aug 8, 2019
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.

4 participants