pinot-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-pinot] yupeng9 commented on a change in pull request #5487: Add multi-value support to SegmentDumpTool
Date Wed, 03 Jun 2020 05:09:22 GMT

yupeng9 commented on a change in pull request #5487:
URL: https://github.com/apache/incubator-pinot/pull/5487#discussion_r434310701



##########
File path: pinot-tools/src/main/java/org/apache/pinot/tools/SegmentDumpTool.java
##########
@@ -91,11 +102,27 @@ public void doMain(String[] args)
       System.out.print(i);
       System.out.print("\t");
       for (String columnName : columnNames) {
-        BlockSingleValIterator itr = iterators.get(columnName);
-        int encodedValue = itr.nextIntVal();
-        Object value = dictionaries.get(columnName).get(encodedValue);
-        System.out.print(value);
-        System.out.print("\t");
+        BlockValIterator itr = iterators.get(columnName);
+        if (itr instanceof BlockSingleValIterator) {
+          int encodedValue = ((BlockSingleValIterator) itr).nextIntVal();
+          Object value = dictionaries.get(columnName).get(encodedValue);
+          System.out.print(value);
+          System.out.print("\t");
+        } else {
+          BlockMultiValIterator mItr = (BlockMultiValIterator) itr;
+          int maxNumValuesPerMVEntry =
+              indexSegment.getDataSource(columnName).getDataSourceMetadata().getMaxNumValuesPerMVEntry();
+          int[] intArray = new int[maxNumValuesPerMVEntry];
+          int length = mItr.nextIntVal(intArray);
+          System.out.print("[");
+          for (int j = 0; j < length; j++) {
+            System.out.print(dictionaries.get(columnName).get(intArray[j]));
+            if (j != length - 1) {
+              System.out.print(",");
+            }
+          }
+          System.out.print("]");

Review comment:
       good catch




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Mime
View raw message