Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-4711

Document is_null semantics in UDF interface

    Details

      Description

      A user ran into some confusion about the semantics of the is_null field of *Val classes in the UDF interface. The intended semantics are that if is_null is true, then no other fields in the class are valid. E.g. StringVal::len and StringVal::ptr.

      However, this isn't explicitly documented anywhere and a user assumed that is_null == true implies that the other fields should be initialised to len == 0 and ptr == NULL

        Activity

        Hide
        tarmstrong Tim Armstrong added a comment -

        IMPALA-4711: clarify is_null semantics in udf.h

        This is to reduce the chance of confusion about what the UDF interface
        guarantees. E.g. I've seen users post code that assumes that the len
        field of a NULL StringVal is 0, which we do not guarantee.

        Change-Id: I2b3fe0b3e57f055682fa93a4ea3c20490058450b
        Reviewed-on: http://gerrit.cloudera.org:8080/6311
        Tested-by: Impala Public Jenkins
        Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>

        Show
        tarmstrong Tim Armstrong added a comment - IMPALA-4711 : clarify is_null semantics in udf.h This is to reduce the chance of confusion about what the UDF interface guarantees. E.g. I've seen users post code that assumes that the len field of a NULL StringVal is 0, which we do not guarantee. Change-Id: I2b3fe0b3e57f055682fa93a4ea3c20490058450b Reviewed-on: http://gerrit.cloudera.org:8080/6311 Tested-by: Impala Public Jenkins Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>

          People

          • Assignee:
            tarmstrong Tim Armstrong
            Reporter:
            tarmstrong Tim Armstrong
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development