hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ych...@apache.org
Subject hive git commit: HIVE-16646: Alias in transform ... as clause shouldn't be case sensitive (Yibing Shi, reviewed by Yongzhi Chen)
Date Fri, 12 May 2017 13:01:25 GMT
Repository: hive
Updated Branches:
  refs/heads/master 538c0088a -> 603c5341e


HIVE-16646: Alias in transform ... as clause shouldn't be case sensitive (Yibing Shi, reviewed
by Yongzhi Chen)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/603c5341
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/603c5341
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/603c5341

Branch: refs/heads/master
Commit: 603c5341e63953310c613286e7263f4c833d732a
Parents: 538c008
Author: Yongzhi Chen <ychena@apache.org>
Authored: Thu May 11 14:53:57 2017 -0400
Committer: Yongzhi Chen <ychena@apache.org>
Committed: Fri May 12 08:49:12 2017 -0400

----------------------------------------------------------------------
 .../hadoop/hive/ql/parse/SemanticAnalyzer.java  |  4 +--
 ql/src/test/queries/clientpositive/transform3.q |  6 +++++
 .../results/clientpositive/transform3.q.out     | 28 ++++++++++++++++++++
 3 files changed, 36 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/603c5341/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
index ddf74f2..c6b67d1 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
@@ -3781,7 +3781,7 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
       if (outputColNames) {
         for (int i = 0; i < ccount; ++i) {
           String colAlias = unescapeIdentifier(((ASTNode) collist.getChild(i))
-              .getText());
+              .getText()).toLowerCase();
           failIfColAliasExists(colAliasNamesDuplicateCheck, colAlias);
           String intName = getColumnInternalName(i);
           ColumnInfo colInfo = new ColumnInfo(intName,
@@ -3794,7 +3794,7 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
           ASTNode child = (ASTNode) collist.getChild(i);
           assert child.getType() == HiveParser.TOK_TABCOL;
           String colAlias = unescapeIdentifier(((ASTNode) child.getChild(0))
-              .getText());
+              .getText()).toLowerCase();
           failIfColAliasExists(colAliasNamesDuplicateCheck, colAlias);
           String intName = getColumnInternalName(i);
           ColumnInfo colInfo = new ColumnInfo(intName, TypeInfoUtils

http://git-wip-us.apache.org/repos/asf/hive/blob/603c5341/ql/src/test/queries/clientpositive/transform3.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/transform3.q b/ql/src/test/queries/clientpositive/transform3.q
new file mode 100644
index 0000000..4a2a368
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/transform3.q
@@ -0,0 +1,6 @@
+CREATE TABLE transform3_t1 (col string);
+INSERT OVERWRITE TABLE transform3_t1 VALUES('aaaa');
+
+SELECT t.newCol FROM (
+  SELECT TRANSFORM(col) USING 'cat' AS (NewCol string) FROM transform3_t1
+) t;

http://git-wip-us.apache.org/repos/asf/hive/blob/603c5341/ql/src/test/results/clientpositive/transform3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/transform3.q.out b/ql/src/test/results/clientpositive/transform3.q.out
new file mode 100644
index 0000000..5f93ed8
--- /dev/null
+++ b/ql/src/test/results/clientpositive/transform3.q.out
@@ -0,0 +1,28 @@
+PREHOOK: query: CREATE TABLE transform3_t1 (col string)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@transform3_t1
+POSTHOOK: query: CREATE TABLE transform3_t1 (col string)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@transform3_t1
+PREHOOK: query: INSERT OVERWRITE TABLE transform3_t1 VALUES('aaaa')
+PREHOOK: type: QUERY
+PREHOOK: Output: default@transform3_t1
+POSTHOOK: query: INSERT OVERWRITE TABLE transform3_t1 VALUES('aaaa')
+POSTHOOK: type: QUERY
+POSTHOOK: Output: default@transform3_t1
+POSTHOOK: Lineage: transform3_t1.col SIMPLE [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col1,
type:string, comment:), ]
+PREHOOK: query: SELECT t.newCol FROM (
+  SELECT TRANSFORM(col) USING 'cat' AS (NewCol string) FROM transform3_t1
+) t
+PREHOOK: type: QUERY
+PREHOOK: Input: default@transform3_t1
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT t.newCol FROM (
+  SELECT TRANSFORM(col) USING 'cat' AS (NewCol string) FROM transform3_t1
+) t
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@transform3_t1
+#### A masked pattern was here ####
+aaaa


Mime
View raw message