Apache Drill
  1. Apache Drill
  2. DRILL-1241

Query that returns 0 rows gives alarming error

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.5.0
    • Component/s: None
    • Labels:
      None

      Description

      When I run a query with 'limit 0' I got an error that sounded like an internal protocol error.

      0: jdbc:drill:zk=local> SELECT * FROM cp.`employee.json` limit 0;
      Query failed: Failure while running fragment. The incoming iterator returned a state of NONE on the first batch. There should always be at least one batch output before returning NONE [a7416ee7-1d9c-4591-a927-2664455f3ef1]
      
      Error: exception while executing query: Failure while trying to get next result batch. (state=,code=0)
      

      Should be more like a user error, since Drill cannot handle queries that return 0 rows. Or maybe (if as I surmise the problem is that Drill just doesn't know the names of the columns) generate a default column 'unknown_result_set_schema' and no rows.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        13d 4h 44m 1 Aman Sinha 15/Aug/14 03:09
        Patch Available Patch Available Resolved Resolved
        3d 14h 17m 1 Jacques Nadeau 18/Aug/14 17:27
        Tony Stevenson made changes -
        Workflow no-reopen-closed, patch-avail, testing [ 12879540 ] Drill workflow [ 12934599 ]
        Jacques Nadeau made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Jacques Nadeau added a comment -

        resolved by 654c879 or earlier.

        Show
        Jacques Nadeau added a comment - resolved by 654c879 or earlier.
        Hide
        Aman Sinha added a comment -

        Every operator should return an output schema even if there are no records (see previously fixed bug DRILL-884). In this particular bug, the LIMIT operator was not obeying that policy. Fixed by adding the appropriate handling for such case in LimitRecordBatch. Added various unit tests with Limit 0 on scans, joins, aggregations; also tested with non-zero Offsets.

        Show
        Aman Sinha added a comment - Every operator should return an output schema even if there are no records (see previously fixed bug DRILL-884 ). In this particular bug, the LIMIT operator was not obeying that policy. Fixed by adding the appropriate handling for such case in LimitRecordBatch. Added various unit tests with Limit 0 on scans, joins, aggregations; also tested with non-zero Offsets.
        Aman Sinha made changes -
        Assignee Aman Sinha [ amansinha100 ] DrillCommitter [ drillcommitter ]
        Aman Sinha made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Aman Sinha made changes -
        Sudheesh Katkam made changes -
        Due Date 15/Aug/14
        Jacques Nadeau made changes -
        Field Original Value New Value
        Assignee Aman Sinha [ amansinha100 ]
        Fix Version/s 0.5.0 [ 12324880 ]
        Julian Hyde created issue -

          People

          • Assignee:
            DrillCommitter
            Reporter:
            Julian Hyde
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:
              Resolved:

              Development