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

SHOW CREATE TABLE Creates Incorrect Syntax When Database Specified

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.0, 3.1.2
    • 4.0.0-alpha-1
    • None
    • None

    Description

      show create table `sample_07`;
      show create table `default`.`sample_07`;
      show create table `default.sample_07`;
      
      Results
      CREATE TABLE `sample_07`(...)
      CREATE TABLE `default.sample_07`(...)
      CREATE TABLE `default.sample_07`(...);
      

      All three show create table statements complete in Hive 2.x and 3.x and generate CREATE TABLE statements as show above. The first result is correct because it does not include the database name, however, the subsequent two results are invalid: each field must be quoted individually.  This causes a failure in recent versions of Hive because "SemanticException Table or database name may not contain dot(.) character."

      If any components of a multiple-part name require quoting, quote them individually rather than quoting the name as a whole. For example, write `my-table`.`my-column`, not `my-table.my-column`.

      Attachments

        1. HIVE-23128.2.patch
          11 kB
          David Mollitor
        2. HIVE-23128.2.patch
          11 kB
          David Mollitor
        3. HIVE-23128.2.patch
          11 kB
          David Mollitor
        4. HIVE-23128.1.patch
          9 kB
          David Mollitor

        Issue Links

          Activity

            People

              belugabehr David Mollitor
              belugabehr David Mollitor
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: