Jackie-Jiang commented on code in PR #10562:
URL: https://github.com/apache/pinot/pull/10562#discussion_r1164765767


##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/LiteralTransformFunction.java:
##########
@@ -68,24 +68,28 @@ public LiteralTransformFunction(LiteralContext 
literalContext) {
     _doubleLiteral = _bigDecimalLiteral.doubleValue();
   }
 
-  public BigDecimal getBigDecimalLiteral() {
-    return _bigDecimalLiteral;
+  public boolean getBooleanLiteral() {
+    return BooleanUtils.toBoolean(_literal);
   }
 
   public int getIntLiteral() {
     return _intLiteral;
   }
 
+  public long getLongLiteral() {
+    return _longLiteral;
+  }
+

Review Comment:
   How about float?



##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/ScalarTransformFunctionWrapper.java:
##########
@@ -85,14 +89,45 @@ public void init(List<TransformFunction> arguments, 
Map<String, ColumnContext> c
         "Wrong number of arguments for method: %s, expected: %s, actual: %s", 
_functionInvoker.getMethod(),
         parameterTypes.length, numArguments);
 
-    _arguments = new Object[numArguments];
+    _scalarArguments = new Object[numArguments];
     _nonLiteralIndices = new int[numArguments];
     _nonLiteralFunctions = new TransformFunction[numArguments];
     for (int i = 0; i < numArguments; i++) {
       TransformFunction transformFunction = arguments.get(i);
       if (transformFunction instanceof LiteralTransformFunction) {
-        String literal = ((LiteralTransformFunction) 
transformFunction).getStringLiteral();
-        _arguments[i] = parameterTypes[i].convert(literal, 
PinotDataType.STRING);
+        LiteralTransformFunction literalTransformFunction = 
(LiteralTransformFunction) transformFunction;
+        DataType dataType = 
literalTransformFunction.getResultMetadata().getDataType();

Review Comment:
   Not introduced in this PR, but can literal be `INT` or `FLOAT` type? 
`NumberUtils.createNumber(literal)` will parse to the string to the smallest 
type, and we should probably keep this convention



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