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

SQL CTAS query failed on compilation stage

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.1.0
    • None
    • Hive, Parser, PTF-Windowing, SQL
    • None

    Description

      I have encountered a compilation error when issue a CTAS query from beeline, but without "create table" query works as expected, narrowed query to reproduce:
       

      create table tab_error as
       with tab2 as (
           select
               id,
               lead(id) over (partition by id order by id) as x
           from
               (select 1 id) a
       )
       select
         lead(x) over (partition by id order by id) = 1
       from
           tab2
       ;

       
      ERROR:

      Error: Error while compiling statement: FAILED: SemanticException Failed to breakup Windowing invocations into Groups. At least 1 group must only depend on input columns. Also check for circular dependencies.Underlying error: org.apache.hadoop.hive.ql.parse.SemanticException: Line 0:-1 Invalid column reference '1': (possible column names are: ) (state=42000,code=40000)

      Attachments

        Activity

          People

            Unassigned Unassigned
            bkotwica Bartosz Kotwica
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: