Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive, mail # dev - Review Request 16299: HIVE-6013: Supporting Quoted Identifiers in Column Names


Copy link to this message
-
Re: Review Request 16299: HIVE-6013: Supporting Quoted Identifiers in Column Names
Harish Butani 2013-12-18, 20:38

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/16299/
-----------------------------------------------------------

(Updated Dec. 18, 2013, 8:38 p.m.)
Review request for hive, Ashutosh Chauhan and Alan Gates.
Changes
-------

the null check in HiveUtils.unparseIdentifier is needed.
Most existing invocations(for everything other than columns) invoke the old function(line 273),
which doesn't take a context object.
Bugs: HIVE-6013
    https://issues.apache.org/jira/browse/HIVE-6013
Repository: hive-git
Description
-------

Hive's current behavior on Quoted Identifiers is different from the normal interpretation. Quoted Identifier (using backticks) has a special interpretation for Select expressions(as Regular Expressions). Have documented current behavior and proposed a solution in attached doc.
Summary of solution is:
Introduce 'standard' quoted identifiers for columns only.
At the langauage level this is turned on by a flag.
At the metadata level we relax the constraint on column names.
Diffs (updated)
-----

  common/src/java/org/apache/hadoop/hive/conf/HiveConf.java fa3e048
  itests/qtest/pom.xml 971c5d3
  metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java 5b75ef3
  ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveUtils.java eb26e7f
  ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java 321759b
  ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java dbf3f91
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g ed9917d
  ql/src/java/org/apache/hadoop/hive/ql/parse/ParseDriver.java 1e6826f
  ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java b9cd65c
  ql/src/java/org/apache/hadoop/hive/ql/parse/UnparseTranslator.java 8fe2262
  ql/src/test/queries/clientnegative/invalid_columns.q f8be8c8
  ql/src/test/queries/clientpositive/quotedid_alter.q PRE-CREATION
  ql/src/test/queries/clientpositive/quotedid_basic.q PRE-CREATION
  ql/src/test/queries/clientpositive/quotedid_partition.q PRE-CREATION
  ql/src/test/queries/clientpositive/quotedid_skew.q PRE-CREATION
  ql/src/test/queries/clientpositive/quotedid_smb.q PRE-CREATION
  ql/src/test/queries/clientpositive/quotedid_tblproperty.q PRE-CREATION
  ql/src/test/results/clientnegative/invalid_columns.q.out 3311b0a
  ql/src/test/results/clientpositive/quotedid_alter.q.out PRE-CREATION
  ql/src/test/results/clientpositive/quotedid_basic.q.out PRE-CREATION
  ql/src/test/results/clientpositive/quotedid_partition.q.out PRE-CREATION
  ql/src/test/results/clientpositive/quotedid_skew.q.out PRE-CREATION
  ql/src/test/results/clientpositive/quotedid_smb.q.out PRE-CREATION
  ql/src/test/results/clientpositive/quotedid_tblproperty.q.out PRE-CREATION

Diff: https://reviews.apache.org/r/16299/diff/
Testing
-------

added new tests for create, alter, delete, query with columns containing special characters.
Tests start with quotedid
Thanks,

Harish Butani