Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-22022

Sql. Json object with nested object creation fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • sql

    Description

      json_object function fails when trying to create object with nested object

              assertQuery("select json_object('name': 'Alex', 'address': json_object('city': 'City 17', 'street': 'Elm'))")
                      .returns("{\"name\":\"Alex\",\"address\":{\"city\":\"City 17\",\"street\":\"Elm\"}}")
                      .check();
      
      Caused by: java.lang.reflect.UndeclaredThrowableException
      	at com.sun.proxy.$Proxy96.getExpressionList(Unknown Source)
      	at org.apache.calcite.rel.core.Project.<init>(Project.java:142)
      	at org.apache.ignite.internal.sql.engine.rel.IgniteProject.<init>(IgniteProject.java:83)
      	at SC.apply(Unknown Source)
      	at org.apache.ignite.internal.sql.engine.externalize.RelJson$RelFactory.apply(RelJson.java:128)
      	at org.apache.ignite.internal.sql.engine.externalize.RelJsonReader.readRel(RelJsonReader.java:140)
      	at org.apache.ignite.internal.sql.engine.externalize.RelJsonReader.readRels(RelJsonReader.java:132)
      	at org.apache.ignite.internal.sql.engine.externalize.RelJsonReader.read(RelJsonReader.java:123)
      	at org.apache.ignite.internal.sql.engine.externalize.RelJsonReader.fromJson(RelJsonReader.java:86)
      	at org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl.lambda$relationalTreeFromJsonString$6(ExecutionServiceImpl.java:300)
      	at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$13(BoundedLocalCache.java:2457)
      	at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1908)
      	at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2455)
      	at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2438)
      	at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:107)
      	at org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl.relationalTreeFromJsonString(ExecutionServiceImpl.java:298)
      	at org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.submitFragment(ExecutionServiceImpl.java:833)
      	at org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl.submitFragment(ExecutionServiceImpl.java:514)
      	at org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl.onMessage(ExecutionServiceImpl.java:413)
      	at org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl.lambda$start$1(ExecutionServiceImpl.java:262)
      	at org.apache.ignite.internal.sql.engine.message.MessageServiceImpl.onMessageInternal(MessageServiceImpl.java:151)
      	at org.apache.ignite.internal.sql.engine.message.MessageServiceImpl.lambda$onMessage$0(MessageServiceImpl.java:115)
      	... 4 more
      Caused by: java.lang.reflect.InvocationTargetException
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.apache.ignite.internal.sql.engine.trait.TraitUtils.lambda$changeTraits$0(TraitUtils.java:265)
      	... 26 more
      Caused by: java.lang.NullPointerException: operator
      	at java.base/java.util.Objects.requireNonNull(Objects.java:246)
      	at org.apache.calcite.rex.RexCall.<init>(RexCall.java:81)
      	at org.apache.calcite.rex.RexBuilder.makeCall(RexBuilder.java:258)
      	at org.apache.ignite.internal.sql.engine.externalize.RelJson.toRex(RelJson.java:828)
      	at org.apache.ignite.internal.sql.engine.externalize.RelJson.toRexList(RelJson.java:1027)
      	at org.apache.ignite.internal.sql.engine.externalize.RelJson.toRex(RelJson.java:787)
      	at org.apache.ignite.internal.sql.engine.externalize.RelJsonReader$RelInputImpl.getExpressionList(RelJsonReader.java:303)
      	... 28 more
      

      At first glance, this looks like a bug on the Ignite side.

      Attachments

        Issue Links

          Activity

            People

              mzhuravkov Maksim Zhuravkov
              xtern Pavel Pereslegin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h