Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-6546

Hive dialect does not support a sub-query in the FROM clause without alias

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.38.0
    • core

    Description

      In Hive, the SQL:

       select * from (select * from table1);
      

      will throw an exception:

      Error: Error while compiling statement: FAILED: ParseException line 1:36 cannot recognize input near '<EOF>' '<EOF>' '<EOF>' in subquery source (state=42000,code=40000)
      

      The SQL:

      select * from (select * from table1) as table2;
      

      works well.

      So when we generate the Hive SQL in the Jdbc adapter, we need to create an alias for the sub-query in the From clause.

      Attachments

        Issue Links

          Activity

            People

              nobigo xiong duan
              nobigo xiong duan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: