Details
-
New Feature
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Currently, it is possible to create ROW type values by using the implicit syntax with parentheses. However, when the explicit ROW constructor is used a ParseException is raised.
Example
CREATE TABLE person (id int, name string, age int); EXPLAIN CBO SELECT (id, name), (name, age) FROM person; EXPLAIN CBO SELECT ROW(id, name), ROW(name, age) FROM person;
The first select statement succeeds and returns the CBO plan while the second fails with the exception below:
org.apache.hadoop.hive.ql.parse.ParseException: line 3:19 cannot recognize input near 'ROW' '(' 'id' in select clause at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:125) at org.apache.hadoop.hive.ql.parse.ParseUtils.parse(ParseUtils.java:93) at org.apache.hadoop.hive.ql.parse.ParseUtils.parse(ParseUtils.java:85) at org.apache.hadoop.hive.ql.Compiler.parse(Compiler.java:169) at org.apache.hadoop.hive.ql.Compiler.compile(Compiler.java:102) at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:492) at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:445)