Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4717

Lax mode for JSON paths doesn't automatically unnest arrays

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.27.0
    • None
    • core
    • None

    Description

      Given the following test in CalciteSqlOperatorTest:

      @Test
      public void test() {
        tester.checkBoolean("json_exists('{\"a\": [{\"b\": 1}, {\"b\": 2}]}', 'lax $.a.b')", Boolean.TRUE);
      }
      

      Yields:

      expected: <[true]> but was: <[false]>

      However, according to the specification (ISO/IEC TR 19075-6 (a) 6.3, Table 28, First Row and (b) 5.3.1) this should pass, and be equivalent to strict $.a[*].b (which does indeed pass). This is because in lax mode arrays should be automatically unnested.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              airblader Ingo Bürk
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: