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

DDLTask is inconsistent in creating a table and adding a partition when dealing with location

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.12.0
    • 0.13.0
    • Query Processor
    • None

    Description

      When creating a table, Hive uses URI to represent location:

          if (crtTbl.getLocation() != null) {
            tbl.setDataLocation(new Path(crtTbl.getLocation()).toUri());
          }
      

      When adding a partition, Hive uses Path to represent location:

            // set partition path relative to table
            db.createPartition(tbl, addPartitionDesc.getPartSpec(), new Path(tbl
                          .getPath(), addPartitionDesc.getLocation()), addPartitionDesc.getPartParams(),
                          addPartitionDesc.getInputFormat(),
                          addPartitionDesc.getOutputFormat(),
                          addPartitionDesc.getNumBuckets(),
                          addPartitionDesc.getCols(),
                          addPartitionDesc.getSerializationLib(),
                          addPartitionDesc.getSerdeParams(),
                          addPartitionDesc.getBucketCols(),
                          addPartitionDesc.getSortCols());
      

      This disparity makes the values stored in metastore be encoded differently, causing problems w.r.t. special character as demonstrated in HIVE-5446. As a result, the code dealing with location for table is different for partition, creating maintenance burden.

      We need to standardize it to Path to be in line with other Path related cleanup effort.

      Attachments

        1. HIVE-6185.patch
          25 kB
          Xuefu Zhang
        2. HIVE-6185.patch
          40 kB
          Xuefu Zhang
        3. HIVE-6185.1.patch
          41 kB
          Xuefu Zhang
        4. HIVE-6185.2.patch
          42 kB
          Xuefu Zhang
        5. HIVE-6185.3.patch
          42 kB
          Xuefu Zhang

        Activity

          People

            xuefuz Xuefu Zhang
            xuefuz Xuefu Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: