mirror of
https://github.com/apache/impala.git
synced 2025-12-19 18:12:08 -05:00
IMPALA-14405: Labels for Calcite expressions not matching original planner
Calcite sets literal expressions to EXPR$<x> which did not match expressions given by the Impala planner. For literal expressions such as "select 1 + 1", Impala creates the column name as "1 + 1". The field names can be found in the abstract syntax tree, so they are not set within the CalciteRelNodeConverter before the logical tree is created. A small test was added to calcite.test for a basic sanity check, but more comprehensive tests will be run in the tests/shell module (e.g. in test_shell_commandline.py and test_shell_interactive) which contain tests for labels. Change-Id: Ibd3e6366a284f53807b4b2c42efafa279249c1ea Reviewed-on: http://gerrit.cloudera.org:8080/23516 Reviewed-by: Steve Carlin <scarlin@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This commit is contained in:
@@ -1097,3 +1097,27 @@ select ndv(varchar_col, 0) from functional.chars_medium;
|
||||
---- CATCH
|
||||
Error in NDV function, second parameter needs to be between 1 and 10.
|
||||
====
|
||||
---- QUERY
|
||||
# Labels test
|
||||
select 2, 1 + 1;
|
||||
---- LABELS
|
||||
2,1 + 1
|
||||
---- RESULTS
|
||||
2,2
|
||||
---- TYPES
|
||||
tinyint,smallint
|
||||
---- RUNTIME_PROFILE
|
||||
row_regex: .*PlannerType: CalcitePlanner.*
|
||||
====
|
||||
---- QUERY
|
||||
# Labels test
|
||||
select length('hello')
|
||||
---- LABELS
|
||||
length('hello')
|
||||
---- RESULTS
|
||||
5
|
||||
---- TYPES
|
||||
int
|
||||
---- RUNTIME_PROFILE
|
||||
row_regex: .*PlannerType: CalcitePlanner.*
|
||||
====
|
||||
|
||||
Reference in New Issue
Block a user