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 2022/08/24 09:43:09 UTC

[GitHub] [druid] abhishekagarwal87 commented on a diff in pull request #12953: Throw parse exception for multi-value numeric dims

abhishekagarwal87 commented on code in PR #12953:
URL: https://github.com/apache/druid/pull/12953#discussion_r953583534


##########
processing/src/main/java/org/apache/druid/segment/LongDimensionIndexer.java:
##########
@@ -47,7 +48,7 @@ public class LongDimensionIndexer implements DimensionIndexer<Long, Long, Long>
   public EncodedKeyComponent<Long> processRowValsToUnsortedEncodedKeyComponent(@Nullable Object dimValues, boolean reportParseExceptions)
   {
     if (dimValues instanceof List) {
-      throw new UnsupportedOperationException("Numeric columns do not support multivalue rows.");
+      throw new ParseException(null, "Numeric columns do not support multivalue rows.");
     }

Review Comment:
   I do think that its ok to have a special handling for list types so that errors are easier to make sense of. Right now, I will probably see below
   ```
   could not convert [[2, 3, 4]] to long. Invalid type: java.util.ArrayList
   ```
   a more readable message instead is 
   ```
   could not ingest [2, 3, 4] since multiple values cannot be ingested for a long column in the same row. 
   ```
   
   the latter looks more readable, to me at least. 
   



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

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

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


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