Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-10350

Impala loses double precision because of DECIMAL->DOUBLE cast

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Backend
    • Epic Color:
      ghx-label-7

      Description

      Impala might loses presision of double values. Reproduction: 

      create table double_tbl (d double) stored as textfile;
      insert into double_tbl values (-0.43149576573887316);
      

       Then inspect the data file:

      $ hdfs dfs -cat /test-warehouse/double_tbl/424097c644088674-c55b910100000000_175064830_data.0.txt
       -0.4314957657388731

      The same happens if we store our data in Parquet.

      Hive writes don't lose precision. If the data was written by Hive then Impala can read the values correctly:

      $ bin/run-jdbc-client.sh -t NOSASL -q "select * from double_tbl;"
      Using JDBC Driver Name: org.apache.hive.jdbc.HiveDriver
      Connecting to: jdbc:hive2://localhost:21050/;auth=noSasl
      Executing: select * from double_tbl
      ----[START]----
      -0.43149576573887316
      ----[END]----

        Attachments

        1. test.c
          0.4 kB
          Tim Armstrong

          Activity

            People

            • Assignee:
              amargoor Amogh Margoor
              Reporter:
              boroknagyz Zoltán Borók-Nagy
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: