Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-2729

Hive partition columns of decimal type are deserialized incorrectly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.6.0
    • 0.9.0
    • Storage - Hive
    • None

    Description

      Repro steps:

      CREATE TABLE IF NOT EXISTS readtest2 (
        a BOOLEAN
      ) PARTITIONED BY (
        decimal0_part DECIMAL,
        decimal9_part DECIMAL(6, 2),
        decimal18_part DECIMAL(15, 5),
        decimal28_part DECIMAL(23, 1),
        decimal38_part DECIMAL(30, 3)
      ) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS TEXTFILE;
      
      ALTER TABLE readtest2 ADD IF NOT EXISTS PARTITION (
        decimal0_part='36.9',
        decimal9_part='36.9',
        decimal18_part='3289379872.945645',
        decimal28_part='39579334534534.35345',
        decimal38_part='363945093845093890.9');
      
      LOAD DATA LOCAL INPATH '/tmp/data.txt' OVERWRITE INTO TABLE default.readtest2 PARTITION (
        decimal0_part='36.9',
        decimal9_part='36.9',
        decimal18_part='3289379872.945645',
        decimal28_part='39579334534534.35345',
        decimal38_part='363945093845093890.9');
      

      Contents of /tmp/data.txt:

      false
      true
      

      Drill output:

      0: jdbc:drill:zk=10.10.30.143:5181> select * from readtest2;
      +------------+---------------+---------------+----------------+----------------+----------------+
      |     a      | decimal0_part | decimal9_part | decimal18_part | decimal28_part | decimal38_part |
      +------------+---------------+---------------+----------------+----------------+----------------+
      | false      | 370000000000  | 369000.00     | -66367900898250.61888 | 39579334534534.4 | 363945093845093890.900 |
      | true       | 370000000000  | 369000.00     | -66367900898250.61888 | 39579334534534.4 | 363945093845093890.900 |
      +------------+---------------+---------------+----------------+----------------+----------------+
      

      Hive output:

      hive> select * from readtest2;
      OK
      false	37	36.9	3289379872.94565	39579334534534.4	363945093845093890.9
      true	37	36.9	3289379872.94565	39579334534534.4	363945093845093890.9
      Time taken: 0.053 seconds, Fetched: 2 row(s)
      

      Attachments

        1. DRILL-2729-1.patch
          4 kB
          Venki Korukanti

        Activity

          People

            vkorukanti Venki Korukanti
            vkorukanti Venki Korukanti
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: