You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "61yao (via GitHub)" <gi...@apache.org> on 2023/04/14 03:00:47 UTC

[GitHub] [pinot] 61yao commented on a diff in pull request #10562: [feature] [null support # 5] Support null in scalar transform function wrapper

61yao commented on code in PR #10562:
URL: https://github.com/apache/pinot/pull/10562#discussion_r1166231507


##########
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:
   Will fix in another PR. 



##########
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:
   ditto.



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

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


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