saurabhd336 commented on code in PR #10343:
URL: https://github.com/apache/pinot/pull/10343#discussion_r1119695533


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/column/DefaultNullValueVirtualColumnProvider.java:
##########
@@ -94,6 +95,36 @@ public ColumnMetadataImpl buildMetadata(VirtualColumnContext 
context) {
       // default null value based on column's data type
       builder.setMaxNumberOfMultiValues(1);
     }
+
+    FieldSpec fieldSpec = context.getFieldSpec();
+    Object defaultNullValue = fieldSpec.getDefaultNullValue();
+    switch (fieldSpec.getDataType().getStoredType()) {
+      case INT:
+        builder.setMinValue((int) defaultNullValue).setMaxValue((int) 
defaultNullValue);
+        break;
+      case LONG:
+        builder.setMinValue((long) defaultNullValue).setMaxValue((long) 
defaultNullValue);
+        break;
+      case FLOAT:
+        builder.setMinValue((float) defaultNullValue).setMaxValue((float) 
defaultNullValue);
+        break;
+      case DOUBLE:
+        builder.setMinValue((double) defaultNullValue).setMaxValue((double) 
defaultNullValue);
+        break;
+      case BIG_DECIMAL:
+        builder.setMinValue((BigDecimal) 
defaultNullValue).setMaxValue((BigDecimal) defaultNullValue);
+        break;
+      case STRING:
+        builder.setMinValue((String) defaultNullValue).setMaxValue((String) 
defaultNullValue);
+        break;
+      case BYTES:
+        builder.setMinValue(new ByteArray((byte[]) defaultNullValue))
+            .setMaxValue(new ByteArray((byte[]) defaultNullValue));
+        break;
+      default:
+        break;

Review Comment:
   Ack. We should never reach here hence throwing an IllegalStateException() 
instead. (Similar to 
https://github.com/apache/pinot/pull/10343/files#diff-9d00fd016c63c5d6d4568da32d156d08a527ad35775208b2b45b342b4b57d9f8L55)



-- 
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-unsubscr...@pinot.apache.org

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


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

Reply via email to