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

Add a query option to get approximation when decimal value not fit column precision and scale

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Backend
    • None
    • ghx-label-3

    Description

      Currently, for text-based formats with decimal type, Impala will return {{NULL }}if values do not fit within the precision and scale, but hive will return a approximation. For example, we execute following statements:

       

      create table text_decimals (x string);
      insert into text_decimals values ("1"), ("2"), ("99.99"), ("1.234"), ("000001"), ("1.000000000");
      alter table text_decimals replace columns (x decimal(4,2));
      

      If we query table by Impala, we will get NULL for line 4 and 6, but if we use Hive, we can get  1.23 and 1.00. So shall we add a new query option to control approximate calculation? If we set true, Impala will also return approximation like Hive, if set false, return NULL.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            skyyws Sheng Wang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: