You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by fj...@apache.org on 2019/07/12 02:29:56 UTC
[incubator-druid] branch master updated: write value of bitmap as
field name (#8066)
This is an automated email from the ASF dual-hosted git repository.
fjy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-druid.git
The following commit(s) were added to refs/heads/master by this push:
new 6c35da3 write value of bitmap as field name (#8066)
6c35da3 is described below
commit 6c35da3c5d8056883a0de497d37c77828e080bfd
Author: Parag Jain <pj...@apache.org>
AuthorDate: Fri Jul 12 07:59:46 2019 +0530
write value of bitmap as field name (#8066)
* write value of bitmap as field name
* respect nulls if present in dictionary
* removed unused import
---
.../java/org/apache/druid/cli/DumpSegment.java | 33 +++++++++++-----------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/services/src/main/java/org/apache/druid/cli/DumpSegment.java b/services/src/main/java/org/apache/druid/cli/DumpSegment.java
index 2be5719..97008eb 100644
--- a/services/src/main/java/org/apache/druid/cli/DumpSegment.java
+++ b/services/src/main/java/org/apache/druid/cli/DumpSegment.java
@@ -38,7 +38,6 @@ import org.apache.druid.collections.bitmap.BitmapFactory;
import org.apache.druid.collections.bitmap.ConciseBitmapFactory;
import org.apache.druid.collections.bitmap.ImmutableBitmap;
import org.apache.druid.collections.bitmap.RoaringBitmapFactory;
-import org.apache.druid.common.config.NullHandling;
import org.apache.druid.guice.DruidProcessingModule;
import org.apache.druid.guice.QueryRunnerFactoryModule;
import org.apache.druid.guice.QueryableModule;
@@ -360,22 +359,22 @@ public class DumpSegment extends GuiceRunnable
jg.writeFieldName(columnName);
jg.writeStartObject();
for (int i = 0; i < bitmapIndex.getCardinality(); i++) {
- String val = NullHandling.nullToEmptyIfNeeded(bitmapIndex.getValue(i));
- if (val != null) {
- final ImmutableBitmap bitmap = bitmapIndex.getBitmap(i);
- if (decompressBitmaps) {
- jg.writeStartArray();
- final IntIterator iterator = bitmap.iterator();
- while (iterator.hasNext()) {
- final int rowNum = iterator.next();
- jg.writeNumber(rowNum);
- }
- jg.writeEndArray();
- } else {
- byte[] bytes = bitmapSerdeFactory.getObjectStrategy().toBytes(bitmap);
- if (bytes != null) {
- jg.writeBinary(bytes);
- }
+ String val = bitmapIndex.getValue(i);
+ // respect nulls if they are present in the dictionary
+ jg.writeFieldName(val == null ? "null" : val);
+ final ImmutableBitmap bitmap = bitmapIndex.getBitmap(i);
+ if (decompressBitmaps) {
+ jg.writeStartArray();
+ final IntIterator iterator = bitmap.iterator();
+ while (iterator.hasNext()) {
+ final int rowNum = iterator.next();
+ jg.writeNumber(rowNum);
+ }
+ jg.writeEndArray();
+ } else {
+ byte[] bytes = bitmapSerdeFactory.getObjectStrategy().toBytes(bitmap);
+ if (bytes != null) {
+ jg.writeBinary(bytes);
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org