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

Nan/Inf data types: strange query result with INNER JOIN operator when selecting 1 column

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Storage - JSON
    • None

    Description

      AFFECTED_VERSION: drill-1.13.0-SNAPSHOT

      AFFECTED_FUNCTIONALITY: INNER JOIN

      ISSUE_DESCRIPTION: There were added new Json data types in DRILL-5919: NaN, Infinity, -Infinity.
      During testing activities, it was detected a bit strange behavior of INNER JOIN operator - different query results in almost the same queries.
      Query1

       select distinct t.name, tt.name from dfs.tmp.`ObjsX.json` t inner join dfs.tmp.`ObjsX.json` tt on t.attr4 = tt.attr4 

      Query2

       select distinct t.name from dfs.tmp.`ObjsX.json` t inner join dfs.tmp.`ObjsX.json` tt on t.attr4 = tt.attr4 

      Query1 differs from Query2 by 1 columns only:

      • In Query1 - 2 columns are selected - t.name, tt.name
      • In Query2 - 1 column is selected - t.name

      However Query1/Query2 return completely different results:

      • Query1 returns
        	name         name0
        	object2 	object2
        	object2 	object3
        	object2 	object4
        	object3 	object2
        	object3 	object3
        	object3 	object4
        	object4 	object2
        	object4 	object3
        	object4 	object4
        	

        This result seems to be correct.

      • Query2 returns No result found, not expected:

      EXPECTED_RESULT:

      	name
      	object2
      	object3
      	object4
      	

      ACTUAL_RESULT:

      No result found

      NB!: the issue appears only if tables are JOINed by a column which contains newly-added data types (NaN, Infinity, -Infinity). The issue is not reproducible is a user is JOINing tables by a column containing other data types

      Attachments

        1. ObjsX.json
          0.7 kB
          Alexander Malashevsky

        Issue Links

          Activity

            People

              volodymyr.tkach Volodymyr Tkach
              malexx8 Alexander Malashevsky
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: