Thanh Tung Dao
10/14/2023, 12:53 PMARRAY[x, y, z] . I'm trying to find it in both the code and in the documentation but could not find π€
Pinot supports ARRAY[x, y, z] syntax to manually craft an array literal. This is good for small scale, and in real prod, we need to add an ARRAY function to generate an ARRAY sequence for a given range.
Similar to the GENERATE_ARRAY function in Google BQXiang Fu
org.apache.pinot.core.operator.transform.function.ArrayLiteralTransformFunction for leaf transform function.
Then you also need to add a scalar function in org.apache.pinot.common.function.scalar.ArrayFunctions
Last thing is to register it here: https://github.com/apache/pinot/blob/master/pinot-common/src/main/java/org/apache/pinot/common/function/TransformFunctionType.java#L259Thanh Tung Dao
10/15/2023, 7:34 AMorg.apache.pinot.common.function.scalar.ArrayFunctions the detail is in the screenshot I sent below
β’ I see a similar example with arrayConcatLong (doc) in the same file ArrayFunctions being registered by the decorator @ScalarFunction in pinot-common/src/main/java/org/apache/pinot/common/function/scalar/ArrayFunctions.java. However, it is not registered in https://github.com/apache/pinot/blob/master/pinot-common/src/main/java/org/apache/pinot/common/function/TransformFunctionType.java#L259 like you mentioned above so I'm abit confused with what's next thoughXiang Fu
Xiang Fu
Thanh Tung Dao
10/17/2023, 8:37 PMThanh Tung Dao
10/18/2023, 9:56 PMArrayLiteralTransformFunction πThanh Tung Dao
10/28/2023, 9:27 AMError: Failures:
Error: FunctionDefinitionRegistryTest.testCalciteFunctionMapAllRegistered:78 Unable to find transform function signature for: arrayGenerate expected [true] but found [false]
In the arrayValueContructor PR, you register with pinot-common/src/main/java/org/apache/pinot/common/function/TransformFunctionType.java https://github.com/apache/pinot/pull/11268/files#diff-76a88fe2695057875280fc1d9cd2225de3e65008fb790b11f9fad27e7ceab13aR224. I tried to do similar thing but had some errors pop up. What should I do in this case ? π€Xiang Fu
arrayGenerate in pinot-common/src/main/java/org/apache/pinot/common/function/scalar/ArrayFunctions.java