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

Query from parquet with case-then and arithmetic operation returns a wrong result

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.14.0
    • 1.16.0
    • Execution - Codegen
    • None

    Description

      Steps to reproduce:
      1) Create sample table:

      create table dfs.tmp.test as 
        select 1 as a, 2 as b
        union all
        select 3 as a, 2 as b
        union all
        select 1 as a, 4 as b
        union all
        select 2 as a, 2 as b
      

      2) Execute query:

      select
        case when s.a > s.b then s.a else s.b end as b, 
        abs(s.a - s.b) as d
      from dfs.tmp.test s
      

      3) Drill returns: result.csv

      4) Result of query without parquet:

      select 
      	case when s.a > s.b then s.a else s.b end as b, 
      	abs(s.a - s.b) as d
      from (
      	select 1 as a, 2 as b
      	union all
      	select 3 as a, 2 as b
      	union all
      	select 1 as a, 4 as b
      	union all
      	select 2 as a, 2 as b
      ) s
      

      correct.csv

      Attachments

        1. result.csv
          0.0 kB
          Oleg Zinoviev
        2. correct.csv
          0.0 kB
          Oleg Zinoviev
        3. JaininoJava.class
          4 kB
          Oleg Zinoviev
        4. JaininoJava2_merged.class
          4 kB
          Oleg Zinoviev

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            volodymyr Vova Vysotskyi
            le.louch Oleg Zinoviev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment