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

With json data drill is not returning all the columns in the query involving a join

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Duplicate
    • None
    • 0.5.0
    • Storage - JSON
    • None

    Description

      git.commit.id.abbrev

      In the below case drill does not return the 3rd column

      select
            s.s_suppkey,
            s.s_nationkey,
            n.n_name
          from
            supplier s,
            nation n
          where
            s.s_nationkey = n.n_nationkey limit 1;
      
      +------------+-------------+
      | s_suppkey  | s_nationkey |
      +------------+-------------+
      | 1          | 17          |
      +------------+-------------+
      
      

      In the below case drill does not return the second column

      select
            n.n_name,
            s.s_suppkey
          from
            supplier s,
            nation n
          where
            s.s_nationkey = n.n_nationkey limit 1;
      
      +------------+
      |   n_name   |
      +------------+
      | PERU       |
      +------------+
      

      Looks like drill is only returning the columns from table/file of the first column. If the first column is from nation, drill returns all subsequent columns from nation but does not return anything from supplier.

      However if use a function on columns from the second table, drill does return everything normally

      select
            s.s_suppkey,
            char_length(n.n_name) as name_length
          from
            supplier s,
            nation n
          where
            s.s_nationkey = n.n_nationkey limit 1;
      
      +------------+-------------+
      | s_suppkey  | name_length |
      +------------+-------------+
      | 1          | 4           |
      +------------+-------------+
      

      This issue is affecting TPCH queries 10, 7, 3 on top of JSON data.
      Data used is provided as an attachement

      Attachments

        1. supplier.json
          26 kB
          Rahul Kumar Challapalli
        2. nation.json
          4 kB
          Rahul Kumar Challapalli

        Issue Links

          Activity

            People

              mehant Mehant Baid
              rkins Rahul Kumar Challapalli
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: