Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-4036

show create table outputs invalid sql for partitioned tables with comments

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 2.6.0, Impala 2.7.0
    • Impala 2.9.0
    • Frontend
    • CentOS 7, CDH 5.8.0

    Description

      Show create table for partitioned tables with comments results an invalid SQL. "COMMENT" comes before "PARTITIONED BY" instead of reversed.

      You can test it from shell with these commands:

      impala-shell --quiet -q 'create table if not exists parted_table_w_comment (i int) partitioned by (day string) comment "A partitioned table with comment"'
      impala-shell --quiet -Bq 'show create table parted_table_w_comment' -o /tmp/create_parted_table_w_comment.sql
      impala-shell --quiet -q 'drop table parted_table_w_comment'
      sed -i -r 's/^"|"$//' /tmp/create_parted_table_w_comment.sql # remove double-quotes from beginning and end
      impala-shell --quiet -f /tmp/create_parted_table_w_comment.sql
      

      The resulting error is rigthly:

      ERROR: AnalysisException: Syntax error in line 5:
      PARTITIONED BY (
      ^
      Encountered: PARTITIONED
      

      Attachments

        Activity

          People

            joemcdonnell Joe McDonnell
            tothandor@gmail.com_impala_e66b Andor Tóth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: