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

Avg function against decimal data returns incorrect result from drill

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0.0
    • 0.4.0
    • Functions - Drill
    • None

    Description

      Ran the following sql query:
      0: jdbc:drill:schema=dfs> select avg(gpa) from dfs.`student`;
      ------------

      EXPR$0

      ------------

      1.999

      ------------
      1 row selected (0.22 seconds)

      The same query against the same dataset from oracle, postgres and impala returns value of 2.49826.

      Here is the schema of the student table:
      message pig_schema {
      optional int32 rownum;
      optional binary name;
      optional int32 age;
      optional double gpa;
      optional int64 studentnum;
      optional binary create_time;
      }

      The same avg function against int data types returns correct result.

      Attachments

        1. DRILL-502.patch
          2 kB
          Mehant Baid
        2. student.parquet
          63 kB
          Krystal

        Activity

          People

            DrillCommitter DrillCommitter
            knguyen Krystal
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: