Fredy Wijaya has uploaded a new patch set (#7). ( http://gerrit.cloudera.org:8080/12052 )
Change subject: IMPALA-7939: Fix issue where CTE is categorized as DML statement ...................................................................... IMPALA-7939: Fix issue where CTE is categorized as DML statement The logic that checks whether a CTE is DML or SELECT uses shlex that splits the statement into tokens and check if any of the tokens matches the DML regular expression. Before this patch, the shlex was set to posix=True, which means the quotes are stripped from the token, e.g. select a from foo where a = 'update' becomes ['select', 'a', 'from', 'foo', 'where', 'a', '=', 'update']. As a result, any token that contains "insert", "delete", "upsert", and "update" in it will be categorized as DML even though the token is part of string literal value. This patch fixes the issue by setting posix=False in shlex that preserves the quotes. For example: ['select', 'a', 'from', 'foo', 'where', 'a', '=', '"update"'] Testing: - Added a new shell test - Ran all shell tests Change-Id: I011b8e73a0477ac6b2357725452458f972785ae7 --- M shell/impala_shell.py M tests/shell/test_shell_interactive.py 2 files changed, 16 insertions(+), 6 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/52/12052/7 -- To view, visit http://gerrit.cloudera.org:8080/12052 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I011b8e73a0477ac6b2357725452458f972785ae7 Gerrit-Change-Number: 12052 Gerrit-PatchSet: 7 Gerrit-Owner: Fredy Wijaya <fwij...@cloudera.com> Gerrit-Reviewer: Bharath Vissapragada <bhara...@cloudera.com> Gerrit-Reviewer: Csaba Ringhofer <csringho...@cloudera.com> Gerrit-Reviewer: Fredy Wijaya <fwij...@cloudera.com> Gerrit-Reviewer: Gabor Kaszab <gaborkas...@cloudera.com> Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Gerrit-Reviewer: Michael Brown <mi...@cloudera.com> Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com>