Quanlong Huang has uploaded a new patch set (#2). ( 
http://gerrit.cloudera.org:8080/16910 )

Change subject: [WIP] IMPALA-10410: Query hints for turn on/off UTF-8 behavior
......................................................................

[WIP] IMPALA-10410: Query hints for turn on/off UTF-8 behavior

This patch introduces a pair of query hints, UTF8_MODE_ON and
UTF8_MODE_OFF, to turn on/off the UTF-8 aware behavior. The query hint
should be put in front of the select list. It will affect the query
block and all subquery blocks until there is another hint in the
subquery. See more examples in the test file.

Implementation:
Each Analyzer instance is corresponding to a query block. We introduces
a flag, isUtf8Mode_, in Analyzer. When analyzing a SelectStmt, we change
the order to analyze the hints of the select list first. Then each
Analyzer will get the correct utf-8 hint. When detecting whether the
current query block is in UTF-8 mode, check the flag first. If it's not
set, inherits the ancessor Analyzer's state.

Tests:
 - Add tests for using query hints with string functions.
 - TODO: Add more tests for reading from tables.
 - TODO: Add tests for that consequent tuple descriptors both have
   char(N) slots but one is utf8 and the other is not.

Change-Id: I7fa20b62b5cb06169048b0785b70e85a9f21bf07
---
M fe/src/main/java/org/apache/impala/analysis/Analyzer.java
M fe/src/main/java/org/apache/impala/analysis/SelectList.java
M fe/src/main/java/org/apache/impala/analysis/SelectStmt.java
A testdata/workloads/functional-query/queries/QueryTest/utf8-hints.test
M tests/query_test/test_utf8_strings.py
5 files changed, 83 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/10/16910/2
--
To view, visit http://gerrit.cloudera.org:8080/16910
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I7fa20b62b5cb06169048b0785b70e85a9f21bf07
Gerrit-Change-Number: 16910
Gerrit-PatchSet: 2
Gerrit-Owner: Quanlong Huang <[email protected]>

Reply via email to