Steve Carlin has uploaded this change for review. ( 
https://gerrit.cloudera.org/25395


Change subject: IMPALA-15753: Calcite Planner: Skip simplification for LIKE 
'\%%'
......................................................................

IMPALA-15753: Calcite Planner: Skip simplification for LIKE '\%%'

Calcite's RexSimplify treats the first % in a pattern such as
LIKE '\\%%' as a redundant wildcard and removes it. That % is
escaped, so it is a literal percent sign, and removing it changes
Impala's result.

This commit leaves an expression unchanged when a LIKE pattern
contains a backslash followed by two percent signs. Other
simplifications in that expression are skipped as well. The general
fix belongs in Calcite (CALCITE-7925); this workaround stays narrow
for the edge case.

Testing: Added cases in calcite.test.

Change-Id: I7c7b99016dcaceb4c792eeb81499de4e2c8bd91b
---
M 
java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaRexSimplify.java
M testdata/workloads/functional-query/queries/QueryTest/calcite.test
2 files changed, 80 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/95/25395/1
--
To view, visit https://gerrit.cloudera.org/25395
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c7b99016dcaceb4c792eeb81499de4e2c8bd91b
Gerrit-Change-Number: 25395
Gerrit-PatchSet: 1
Gerrit-Owner: Steve Carlin <[email protected]>

Reply via email to