Uploaded image for project: 'Apache AsterixDB'
  1. Apache AsterixDB
  2. ASTERIXDB-1131

The function-generated Null is omitted when construct a List

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: TYPE - Data Model
    • Labels:
      None

      Description

      I hit a failed test case in which I was building a list with the elements generated from a build-in function, as below,

      for $a in [
      starts-with("xyz", null),
      starts-with("xy", "x")
      ]
      return $a

      If any of the elements is Null, it will be omitted in the returned list, e.g. the above query returns the following result:

      [ true
      ]

      However if I explicitly add a null in the list, all the Nulls will be returned.
      the following query:

      for $a in [
      null,
      starts-with("xy", null),
      starts-with("xy", "x")
      ]
      return $a

      will return the expected result:

      [ null
      , null
      , true
      ]
      It applies for other similar functions which return an option value.

        Attachments

          Activity

            People

            • Assignee:
              buyingyi Yingyi Bu
              Reporter:
              javierjia Jianfeng Jia
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: