ColinLeeo opened a new pull request, #18875: URL: https://github.com/apache/iotdb/pull/18875
Tree-model CASE can take the wrong branch when a later WHEN contains nullable AND. For example, when `s1` is NULL and `s2` is 1, `CASE WHEN s1 > 100 THEN 1 WHEN s1 > 0 AND s2 > 0 THEN 2 ELSE 3 END` returns 2 instead of 3. `LogicAndColumnTransformer.evaluateWithSelection()` builds the correct three-valued AND result but caches the right operand. Cache the built result instead. This is a one-line production change and requires no cache-lifecycle or selection API changes. Regression coverage includes all nine NULL/false/true operand combinations with full and partial selection masks, plus the CASE SQL example with NULL, true, false, and earlier-branch rows. Closes #18864. Validation: - Maven reactor `verify` from master `8effe5d6ce`, selecting only `LogicBinaryColumnTransformerTest` (5 tests) and `IoTDBCaseWhenThenIT#testNullableAndInLaterCaseBranch` (1 test, rebuilt 1C1D nodes): passed. - Class-isolated comparison using the same unit-test runtime and master implementation: both newly added unit tests fail before the production change; all 5 pass after it. - Spotless, Checkstyle, and license checks: passed. -- 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]
