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

NPE when querying view with where clause and derived table

    XMLWordPrintableJSON

Details

    Description

      #Wed Jan 21 12:38:45 EST 2015
      git.commit.id.abbrev=8d1e1af
      

      `customer.json`

      { "CustomerId": "100", "cityId": 10 }
      { "CustomerId": "101", "cityId": 10 }
      { "CustomerId": "102", "cityId": 10 }
      { "CustomerId": "103", "cityId": 20 }
      { "CustomerId": "104", "cityId": 30 }
      { "CustomerId": "105", "cityId": null }
      { "CustomerId": null,  "cityId": 50 }
      
      0: jdbc:drill:schema=dfs> create view v3 as select * from ( select * from `customer.json` ) where customerid >= 100;
      +------------+------------+
      |     ok     |  summary   |
      +------------+------------+
      | true       | View 'v3' created successfully in 'dfs.identifiers' schema |
      +------------+------------+
      1 row selected (0.063 seconds)
      0: jdbc:drill:schema=dfs> select * from v3;
      Query failed: NullPointerException: 
      
      Error: exception while executing query: Failure while executing query. (state=,code=0)
      

      Query by itself works fine:

      0: jdbc:drill:schema=dfs> select * from ( select * from `customer.json` ) where CustomerId >= 100;
      +------------+------------+
      | CustomerId |   cityId   |
      +------------+------------+
      | 100        | 10         |
      | 101        | 10         |
      | 102        | 10         |
      | 103        | 20         |
      | 104        | 30         |
      | 105        | null       |
      +------------+------------+
      6 rows selected (0.117 seconds)
      

      If you remove where clause and leave just derived table in the view creation, you can query the view as well.

      Attachments

        1. drill-2051.log
          14 kB
          Victoria Markman

        Activity

          People

            Unassigned Unassigned
            vicky Victoria Markman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: