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

SQL CTAS query failed on compilation stage

Log workAgile BoardRank to TopRank to BottomAdd voteVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.1.0
    • Fix Version/s: None
    • Component/s: Hive, Parser, PTF-Windowing, SQL
    • Labels:
      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

          $i18n.getText('security.level.explanation', $currentSelection) Viewable by All Users
          Cancel

            People

            • Assignee:
              Unassigned Assign to me
              Reporter:
              bkotwica Bartosz Kotwica

              Dates

              • Created:
                Updated:

                Issue deployment