Hive
  1. Hive
  2. HIVE-161

for list column x that is sometimes null, select x.y will cause a nullpointerexception

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.3.0
    • Component/s: Query Processor
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Release Note:
      HIVE-161. Fixed xpath x.y when x is a null list. (zshao)

      Activity

      Venky Iyer created issue -
      Ashish Thusoo made changes -
      Field Original Value New Value
      Assignee Ashish Thusoo [ athusoo ]
      Hide
      Ashish Thusoo added a comment -

      The problem seems to be in

      ExprNodeFieldEvaluator.java

      at line 96

      where we are doing list.size() and not checking if list is null before getting the size.

      Show
      Ashish Thusoo added a comment - The problem seems to be in ExprNodeFieldEvaluator.java at line 96 where we are doing list.size() and not checking if list is null before getting the size.
      Zheng Shao made changes -
      Assignee Ashish Thusoo [ athusoo ] Zheng Shao [ zshao ]
      Hide
      Zheng Shao added a comment -

      I've got the code fixed but it's hard to generate a testcase since only thrift serde will generate NULL list for now.
      I am thinking about implementing the CASE statement first.

      Show
      Zheng Shao added a comment - I've got the code fixed but it's hard to generate a testcase since only thrift serde will generate NULL list for now. I am thinking about implementing the CASE statement first.
      Hide
      Jeff Hammerbacher added a comment -

      Adding to "Query Processor" component.

      Show
      Jeff Hammerbacher added a comment - Adding to "Query Processor" component.
      Jeff Hammerbacher made changes -
      Component/s Query Processor [ 12312586 ]
      Ashish Thusoo made changes -
      Priority Major [ 3 ] Critical [ 2 ]
      Hide
      Zheng Shao added a comment -

      Modified complex.seq to include the case that the list is null.

      Show
      Zheng Shao added a comment - Modified complex.seq to include the case that the list is null.
      Zheng Shao made changes -
      Attachment HIVE-161-2.patch [ 12397348 ]
      Zheng Shao made changes -
      Fix Version/s 0.2.0 [ 12313565 ]
      Status Open [ 1 ] Patch Available [ 10002 ]
      Raghotham Murthy made changes -
      Comment [ ql/src/java/org/apache/hadoop/hive/ql/exec/ExprNodeFieldEvaluator.java: Shouldnt you be returning the same thing whether the list is null or empty? right now, you are returning null in the first case and an empty list<Object> in the second case. ]
      Hide
      Prasad Chakka added a comment -

      looks ok to me. +1

      Show
      Prasad Chakka added a comment - looks ok to me. +1
      Hide
      Zheng Shao added a comment -

      Committed revision 732571.

      Show
      Zheng Shao added a comment - Committed revision 732571.
      Zheng Shao made changes -
      Release Note HIVE-161. Fixed xpath x.y when x is a null list. (zshao)
      Resolution Fixed [ 1 ]
      Hadoop Flags [Reviewed]
      Status Patch Available [ 10002 ] Resolved [ 5 ]
      Zheng Shao made changes -
      Fix Version/s 0.6.0 [ 12314524 ]
      Fix Version/s 0.2.0 [ 12313565 ]
      Carl Steinbach made changes -
      Fix Version/s 0.3.0 [ 12313637 ]
      Fix Version/s 0.6.0 [ 12314524 ]
      Carl Steinbach made changes -
      Status Resolved [ 5 ] Closed [ 6 ]
      Transition Time In Source Status Execution Times Last Executer Last Execution Date
      Open Open Patch Available Patch Available
      27d 20h 44m 1 Zheng Shao 07/Jan/09 23:23
      Patch Available Patch Available Resolved Resolved
      1h 25m 1 Zheng Shao 08/Jan/09 00:48
      Resolved Resolved Closed Closed
      1072d 23h 20m 1 Carl Steinbach 17/Dec/11 00:08

        People

        • Assignee:
          Zheng Shao
          Reporter:
          Venky Iyer
        • Votes:
          0 Vote for this issue
          Watchers:
          2 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved:

            Development