spapin commented on code in PR #18587:
URL: https://github.com/apache/pinot/pull/18587#discussion_r3498810342
##########
pinot-core/src/test/java/org/apache/pinot/queries/JsonExtractScalarTest.java:
##########
@@ -206,6 +206,12 @@ public void testColumnToColumnComparison(String column) {
checkResult("SELECT intColumn FROM testTable WHERE " + id + " =
intColumn", new Object[][]{});
checkResult("SELECT intColumn FROM testTable WHERE " + id + " > intColumn
LIMIT 3",
new Object[][]{{1}, {2}, {3}});
+
+ // Mixed numeric/string comparison: an INT column against a non-numeric
STRING column. The old minus()-based
+ // rewrite coerced both operands to DOUBLE and threw NumberFormatException
on the non-numeric string, failing the
+ // whole query. The type-safe rewrite evaluates per-row, treating an
unparseable comparison as no-match, so the
+ // query runs and simply returns no rows instead of erroring.
+ checkResult("SELECT intColumn FROM testTable WHERE intColumn =
stringColumn", new Object[][]{});
Review Comment:
Note, the != case has a bug: it also returns no element. The bug is because
`fillStringResultArray` hardcodes false for every operator in its NFE catch, so
intColumn != stringColumn wrongly returns no rows (should be all rows).
This is a pre-existing bug in a different part of pinot. Should be fixed
separately, imo.
--
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]