[GitHub] [incubator-pinot] mayankshriv commented on a change in pull request #4583: Support default value for Byte column

2019-09-12 Thread GitBox
mayankshriv commented on a change in pull request #4583: Support default value 
for Byte column
URL: https://github.com/apache/incubator-pinot/pull/4583#discussion_r324032320
 
 

 ##
 File path: 
pinot-core/src/main/java/org/apache/pinot/core/segment/index/loader/defaultcolumn/BaseDefaultColumnHandler.java
 ##
 @@ -303,6 +304,10 @@ protected void createColumnV1Indices(String column)
 dictionaryElementSize = 
StringUtil.encodeUtf8(stringDefaultValue).length;
 sortedArray = new String[]{stringDefaultValue};
 break;
+  case BYTES:
+Preconditions.checkState(defaultValue instanceof byte[]);
+sortedArray = new ByteArray[] {new ByteArray((byte[]) defaultValue)};
 
 Review comment:
   I see, so I guess the value is already decoded in the Fieldspec?


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:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [incubator-pinot] mayankshriv commented on a change in pull request #4583: Support default value for Byte column

2019-09-05 Thread GitBox
mayankshriv commented on a change in pull request #4583: Support default value 
for Byte column
URL: https://github.com/apache/incubator-pinot/pull/4583#discussion_r321412097
 
 

 ##
 File path: 
pinot-core/src/main/java/org/apache/pinot/core/segment/index/loader/defaultcolumn/BaseDefaultColumnHandler.java
 ##
 @@ -303,6 +304,10 @@ protected void createColumnV1Indices(String column)
 dictionaryElementSize = 
StringUtil.encodeUtf8(stringDefaultValue).length;
 sortedArray = new String[]{stringDefaultValue};
 break;
+  case BYTES:
+Preconditions.checkState(defaultValue instanceof byte[]);
+sortedArray = new ByteArray[] {new ByteArray((byte[]) defaultValue)};
 
 Review comment:
   The defaultValue is coming from JSON schema, correct? The expectation is to 
specify ` Hex.encodeHexString(bytes)`  in the schema. Which means that this 
code would need to use `Hex.decodeHex` here.
   
   Also, if we don't have this documented, let's also add the expectation on 
how to specify the default value in the schema for BYTES.


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:
us...@infra.apache.org


With regards,
Apache Git Services

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