Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-12161

Structured record null check is too stringent

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3.0
    • Component/s: None
    • Labels:
      None
    • Release Notes:
      Fixed a bug in StructuredRecord where a union of null and at least two other types could not be set to a null value.
    • Rank:
      1|i0059z:

      Description

      When building a StructuredRecord, if you have a field with schema that is a union that includes null and has more than 2 schemas, then you cannot set the value of that field to null.

      This is because the check uses Schema.isNullable(), which doesn't actually check if the value can be null, but checks if the schema is a union of null and one other schema.

        Attachments

          Activity

            People

            • Assignee:
              ashau Albert Shau
              Reporter:
              ashau Albert Shau
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: