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

Hive bug prevents allowed characters in nested column

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.3.5
    • None
    • Hive
    • None

    Description

      Hive allows any unicode character in column name when specified within backtick (`). But this behavior didn’t work for a nested column containing hyphen which points to a possible bug in hive DDL parsing logic.

       

      Special characters at first level column works fine

       CREATE EXTERNAL TABLE test_dwh.sample_parquet_table (
        `user-agent`: string,     -- first level column with “-” works
        `context` struct<
              `os`: struct<
                  `name`: string,
                  `version`: string
                  >
          >
      ) PARTITIONED BY (day string)
      STORED as PARQUET
      LOCATION 's3://xxx/tmp/sample_data/events'
       

       

      Special characters in nested column throws error

       

      CREATE EXTERNAL TABLE test_dwh.sample_parquet_table (
        `context` struct<
              `os`: struct<
                  `name`: string,
                  `version`: string,
                  `is-test`: string  -- nested column with “-” throws error
                  >
          >
      ) PARTITIONED BY (day string)
      STORED as PARQUET
      LOCATION 's3://xxx/tmp/sample_data/events' 

       

      FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.IllegalArgumentException: Error: : expected at the position 46 of 'struct<os:struct<name:string,version:string,is-test:string>>' but '-' is found.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jvora Jainik Vora
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: