yashmayya commented on code in PR #18627:
URL: https://github.com/apache/pinot/pull/18627#discussion_r3331091495
##########
pinot-query-planner/src/test/java/org/apache/pinot/query/QueryCompilationTest.java:
##########
@@ -73,6 +73,13 @@ public void
testPolymorphicArithmeticScalarFunctionsPlanQuery() {
assertNotNull(dispatchableSubPlan);
}
+ @Test
+ public void testLookupFunctionSupportsQualifiedJoinColumn() {
+ DispatchableSubPlan dispatchableSubPlan = _queryEnvironment.planQuery(
+ "SELECT lookup('b', 'col1', 'col2', e.col1) FROM a AS e JOIN b AS d ON
e.col1 = d.col2");
+ assertNotNull(dispatchableSubPlan);
Review Comment:
This only asserts that planning succeeds — the original issue is really
about getting correct results for a qualified column. Could we add an MSE
integration test that actually executes `lookup()` and checks the returned
value (and its type)?
##########
pinot-common/src/main/java/org/apache/pinot/common/function/TransformFunctionType.java:
##########
@@ -175,7 +175,7 @@ public enum TransformFunctionType {
ReturnTypes.cascade(opBinding -> positionalComponentType(opBinding, 2),
SqlTypeTransforms.FORCE_NULLABLE),
OperandTypes.family(List.of(SqlTypeFamily.ARRAY, SqlTypeFamily.ANY,
SqlTypeFamily.ARRAY))),
IN_ID_SET("inIdSet", ReturnTypes.BOOLEAN,
OperandTypes.family(SqlTypeFamily.ANY, SqlTypeFamily.CHARACTER)),
- LOOKUP("lookUp"),
+ LOOKUP("lookUp", ReturnTypes.explicit(SqlTypeName.ANY),
OperandTypes.variadic(SqlOperandCountRanges.from(4))),
Review Comment:
`ANY` resolves to `ColumnDataType.OBJECT` in `RelToPlanNodeConverter`, so
the lookup result column comes back typed OBJECT in the plan and the DataSchema
regardless of the dimension column's real type (e.g. a STRING `account_name`).
Values pass through fine at runtime, but the client-facing type is off, and
feeding the result into a CAST/comparison/aggregation/join key could behave
oddly. Is OBJECT intended here, or can we infer the real type? At minimum worth
a comment noting the limitation.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]