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

INT64 Parquet timestamps cannot be mapped to most Hive numeric types

    XMLWordPrintableJSON

Details

    Description

      When attempting to read a Parquet file with column of primitive type INT64 and logical type TIMESTAMP an error is raised when the Hive type is different from TIMESTAMP and BIGINT.

      Consider a Parquet file (e.g., ts_file.parquet) with the following schema:

      {
        "name": "eventtime",
        "type": ["null", {
          "type": "long",
          "logicalType": "timestamp-millis"
        }],
        "default": null
      }
      

       
      Mapping the column to a Hive numeric type among TINYINT, SMALLINT, INT, FLOAT, DOUBLE, DECIMAL, and trying to run a SELECT will give back an error.

      The following snippet can be used to reproduce the problem.

      CREATE TABLE ts_table (eventtime INT) STORED AS PARQUET;
      LOAD DATA LOCAL INPATH 'ts_file.parquet' into table ts_table;
      SELECT * FROM ts_table;
      

      This is a regression caused by HIVE-21215. Although, HIVE-21215 allows to read INT64 types as Hive TIMESTAMP, which was not possible before, at the same time it broke the mapping to every other Hive numeric type. The problem was addressed selectively for BIGINT type very recently (HIVE-26612).

      The primary goal of this ticket is to restore backward compatibility since these use-cases were working before HIVE-21215.

      Attachments

        Issue Links

          Activity

            People

              zabetak Stamatis Zampetakis
              zabetak Stamatis Zampetakis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h