Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-25053

Support explicit ROW value constructor in SQL statements

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Query Processor
    • 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)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            zabetak Stamatis Zampetakis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: