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

HCatOutputFormat should expose complete output-schema (including partition-keys) for dynamic-partitioning MR jobs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.0, 3.0.0
    • 2.4.0, 3.0.0
    • HCatalog
    • None

    Description

      Map/Reduce jobs that use HCatalog APIs to write to Hive tables using Dynamic partitioning are expected to call the following API methods:

      1. HCatOutputFormat.setOutput() to indicate which table/partitions to write to. This call populates the OutputJobInfo with details fetched from the Metastore.
      2. HCatOutputFormat.setSchema() to indicate the output-schema for the data being written.

      It is a common mistake to invoke HCatOUtputFormat.setSchema() as follows:

      HCatOutputFormat.setSchema(conf, HCatOutputFormat.getTableSchema(conf));
      

      Unfortunately, getTableSchema() returns only the record-schema, not the entire table's schema. We'll need a better API for use in M/R jobs to get the complete table-schema.

      Attachments

        1. HIVE-17181.1.patch
          2 kB
          Mithun Radhakrishnan
        2. HIVE-17181.1-branch-2.patch
          6 kB
          Mithun Radhakrishnan
        3. HIVE-17181.2.patch
          6 kB
          Mithun Radhakrishnan
        4. HIVE-17181.3.patch
          6 kB
          Mithun Radhakrishnan

        Activity

          People

            mithun Mithun Radhakrishnan
            mithun Mithun Radhakrishnan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: