You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/12/17 21:52:31 UTC

[GitHub] [incubator-druid] jihoonson commented on a change in pull request #9058: Fail superbatch range partition multi dim values

jihoonson commented on a change in pull request #9058: Fail superbatch range partition multi dim values
URL: https://github.com/apache/incubator-druid/pull/9058#discussion_r359048430
 
 

 ##########
 File path: indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/iterator/RangePartitionIndexTaskInputRowIteratorBuilder.java
 ##########
 @@ -114,9 +114,18 @@ public HandlingInputRowIterator build()
   )
   {
     return inputRow -> {
-      List<String> dimensionValues = inputRow.getDimension(partitionDimension);
-      return dimensionValues.size() > 1;  // Rows.objectToStrings() returns an empty list for a single null value
+      int dimensionValueCount = getDimensionValueCount(inputRow, partitionDimension);
+      return dimensionValueCount > 1;  // Rows.objectToStrings() returns an empty list for a single null value
     };
   }
 
+  private static int getDimensionValueCount(InputRow inputRow, String partitionDimension)
+  {
+    List<String> dimensionValues = inputRow.getDimension(partitionDimension);
+    int dimensionValueCount = dimensionValues.size();
+    if (dimensionValueCount > 1) {
+      throw new IllegalArgumentException("Cannot partition on multi-value dimension: " + partitionDimension);
 
 Review comment:
   It would be nice to print `inputRow` as well.

----------------------------------------------------------------
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


With regards,
Apache Git Services

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