ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Kuznetsov (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (IGNITE-10939) SQL: UPDATE of second level fields fails if parent field was set to null previously
Date Tue, 15 Jan 2019 09:30:00 GMT

     [ https://issues.apache.org/jira/browse/IGNITE-10939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Pavel Kuznetsov updated IGNITE-10939:
-------------------------------------
    Description: 
Given table in the cache Integer -> Value
{code:java}
static final class Value implements Serializable {
        @QuerySqlField
        Long longCol;

        /**  Inner type object. */
        @QuerySqlField
        InnerType innerTypeCol;

        static final class InnerType implements Serializable {
            @QuerySqlField
            Long innerLongCol;

            @QuerySqlField
            String innerStrCol;
        }
    }
{code}

We insert so data, to have {{innerTypeCol}} in default value null:
{code:sql}
INSERT INTO Value (_key, longCol) VALUES (42, 123);
{code}

Updates of the inner fields {{innerLongCol}} and {{innerStrCol}} 
{code:sql}
UPDATE AllTypes SET innerLongCol = 3
{code}
will result to error:
{noformat}
javax.cache.CacheException: class org.apache.ignite.IgniteCheckedException: Individual properties
can be set for binary builders only
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuerySafe(GridQueryProcessor.java:2248)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2197)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2124)
    at org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.query(IgniteCacheProxyImpl.java:794)
    at org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.query(IgniteCacheProxyImpl.java:742)
    at org.apache.ignite.internal.processors.cache.GatewayProtectedCacheProxy.query(GatewayProtectedCacheProxy.java:386)
    at org.apache.ignite.internal.processors.cache.IgniteCacheInsertSqlQuerySelfTest.testCacheRestartHandling(IgniteCacheInsertSqlQuerySelfTest.java:253)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.apache.ignite.testframework.junits.GridAbstractTest$6.run(GridAbstractTest.java:2088)
    at java.lang.Thread.run(Thread.java:748)
Caused by: class org.apache.ignite.IgniteCheckedException: Individual properties can be set
for binary builders only
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:2743)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.lambda$querySqlFields$1(GridQueryProcessor.java:2225)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuerySafe(GridQueryProcessor.java:2245)
    ... 16 more
Caused by: java.lang.UnsupportedOperationException: Individual properties can be set for binary
builders only
    at org.apache.ignite.internal.processors.query.property.QueryBinaryProperty.setValue(QueryBinaryProperty.java:194)
    at org.apache.ignite.internal.processors.query.h2.opt.GridH2RowDescriptor.setColumnValue(GridH2RowDescriptor.java:246)
    at org.apache.ignite.internal.processors.query.h2.dml.UpdatePlan.processRowForUpdate(UpdatePlan.java:354)
    at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.doUpdate(DmlStatementsProcessor.java:861)
    at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.processDmlSelectResult(DmlStatementsProcessor.java:739)
    at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.executeUpdateStatement(DmlStatementsProcessor.java:685)
    at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.updateSqlFields(DmlStatementsProcessor.java:208)
    at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.updateSqlFieldsDistributed(DmlStatementsProcessor.java:381)
    at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.doRunPrepared(IgniteH2Indexing.java:1593)
    at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.querySqlFields(IgniteH2Indexing.java:1534)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor$3.applyx(GridQueryProcessor.java:2207)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor$3.applyx(GridQueryProcessor.java:2202)
    at org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:2720)
    ... 18 more
{noformat}

1) Error message doesn't reflect what have happened
2) In my opinion, in this case we should set innerTypeCol to {{new InnerType \{innerLongCol=3,
innerStrCol=default\}}}

  was:
Given table in the cache Integer -> Value
{code:java}
static final class Value implements Serializable {
        @QuerySqlField
        Long longCol;

        /**  Inner type object. */
        @QuerySqlField
        InnerType innerTypeCol;

        static final class InnerType implements Serializable {
            @QuerySqlField
            Long innerLongCol;

            @QuerySqlField
            String innerStrCol;
        }
    }
{code}

We insert so data, to have {{innerTypeCol}} in default value null:
{code:sql}
INSERT INTO Value (_key, longCol) VALUES (42, 123);
{code}

Updates of the inner fields {{innerLongCol}} and {{innerStrCol}} 
{code:sql}
UPDATE AllTypes SET innerLongCol = 3
{code}
will result to error:
{noformat}
javax.cache.CacheException: class org.apache.ignite.IgniteCheckedException: Individual properties
can be set for binary builders only
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuerySafe(GridQueryProcessor.java:2248)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2197)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2124)
    at org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.query(IgniteCacheProxyImpl.java:794)
    at org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.query(IgniteCacheProxyImpl.java:742)
    at org.apache.ignite.internal.processors.cache.GatewayProtectedCacheProxy.query(GatewayProtectedCacheProxy.java:386)
    at org.apache.ignite.internal.processors.cache.IgniteCacheInsertSqlQuerySelfTest.testCacheRestartHandling(IgniteCacheInsertSqlQuerySelfTest.java:253)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.apache.ignite.testframework.junits.GridAbstractTest$6.run(GridAbstractTest.java:2088)
    at java.lang.Thread.run(Thread.java:748)
Caused by: class org.apache.ignite.IgniteCheckedException: Individual properties can be set
for binary builders only
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:2743)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.lambda$querySqlFields$1(GridQueryProcessor.java:2225)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuerySafe(GridQueryProcessor.java:2245)
    ... 16 more
Caused by: java.lang.UnsupportedOperationException: Individual properties can be set for binary
builders only
    at org.apache.ignite.internal.processors.query.property.QueryBinaryProperty.setValue(QueryBinaryProperty.java:194)
    at org.apache.ignite.internal.processors.query.h2.opt.GridH2RowDescriptor.setColumnValue(GridH2RowDescriptor.java:246)
    at org.apache.ignite.internal.processors.query.h2.dml.UpdatePlan.processRowForUpdate(UpdatePlan.java:354)
    at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.doUpdate(DmlStatementsProcessor.java:861)
    at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.processDmlSelectResult(DmlStatementsProcessor.java:739)
    at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.executeUpdateStatement(DmlStatementsProcessor.java:685)
    at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.updateSqlFields(DmlStatementsProcessor.java:208)
    at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.updateSqlFieldsDistributed(DmlStatementsProcessor.java:381)
    at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.doRunPrepared(IgniteH2Indexing.java:1593)
    at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.querySqlFields(IgniteH2Indexing.java:1534)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor$3.applyx(GridQueryProcessor.java:2207)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor$3.applyx(GridQueryProcessor.java:2202)
    at org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:2720)
    ... 18 more
{noformat}

1) Error message doesn't reflect what have happened
2) In my opinion, in this case we should set innerTypeCol to {{new InnerType \{innerLongCol=3,
innerStrCol=default\} }}


> SQL: UPDATE of second level fields fails if parent field was set to null previously
> -----------------------------------------------------------------------------------
>
>                 Key: IGNITE-10939
>                 URL: https://issues.apache.org/jira/browse/IGNITE-10939
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>            Reporter: Pavel Kuznetsov
>            Priority: Major
>
> Given table in the cache Integer -> Value
> {code:java}
> static final class Value implements Serializable {
>         @QuerySqlField
>         Long longCol;
>         /**  Inner type object. */
>         @QuerySqlField
>         InnerType innerTypeCol;
>         static final class InnerType implements Serializable {
>             @QuerySqlField
>             Long innerLongCol;
>             @QuerySqlField
>             String innerStrCol;
>         }
>     }
> {code}
> We insert so data, to have {{innerTypeCol}} in default value null:
> {code:sql}
> INSERT INTO Value (_key, longCol) VALUES (42, 123);
> {code}
> Updates of the inner fields {{innerLongCol}} and {{innerStrCol}} 
> {code:sql}
> UPDATE AllTypes SET innerLongCol = 3
> {code}
> will result to error:
> {noformat}
> javax.cache.CacheException: class org.apache.ignite.IgniteCheckedException: Individual
properties can be set for binary builders only
>     at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuerySafe(GridQueryProcessor.java:2248)
>     at org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2197)
>     at org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2124)
>     at org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.query(IgniteCacheProxyImpl.java:794)
>     at org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.query(IgniteCacheProxyImpl.java:742)
>     at org.apache.ignite.internal.processors.cache.GatewayProtectedCacheProxy.query(GatewayProtectedCacheProxy.java:386)
>     at org.apache.ignite.internal.processors.cache.IgniteCacheInsertSqlQuerySelfTest.testCacheRestartHandling(IgniteCacheInsertSqlQuerySelfTest.java:253)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:498)
>     at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
>     at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>     at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
>     at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>     at org.apache.ignite.testframework.junits.GridAbstractTest$6.run(GridAbstractTest.java:2088)
>     at java.lang.Thread.run(Thread.java:748)
> Caused by: class org.apache.ignite.IgniteCheckedException: Individual properties can
be set for binary builders only
>     at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:2743)
>     at org.apache.ignite.internal.processors.query.GridQueryProcessor.lambda$querySqlFields$1(GridQueryProcessor.java:2225)
>     at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuerySafe(GridQueryProcessor.java:2245)
>     ... 16 more
> Caused by: java.lang.UnsupportedOperationException: Individual properties can be set
for binary builders only
>     at org.apache.ignite.internal.processors.query.property.QueryBinaryProperty.setValue(QueryBinaryProperty.java:194)
>     at org.apache.ignite.internal.processors.query.h2.opt.GridH2RowDescriptor.setColumnValue(GridH2RowDescriptor.java:246)
>     at org.apache.ignite.internal.processors.query.h2.dml.UpdatePlan.processRowForUpdate(UpdatePlan.java:354)
>     at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.doUpdate(DmlStatementsProcessor.java:861)
>     at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.processDmlSelectResult(DmlStatementsProcessor.java:739)
>     at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.executeUpdateStatement(DmlStatementsProcessor.java:685)
>     at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.updateSqlFields(DmlStatementsProcessor.java:208)
>     at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.updateSqlFieldsDistributed(DmlStatementsProcessor.java:381)
>     at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.doRunPrepared(IgniteH2Indexing.java:1593)
>     at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.querySqlFields(IgniteH2Indexing.java:1534)
>     at org.apache.ignite.internal.processors.query.GridQueryProcessor$3.applyx(GridQueryProcessor.java:2207)
>     at org.apache.ignite.internal.processors.query.GridQueryProcessor$3.applyx(GridQueryProcessor.java:2202)
>     at org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
>     at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:2720)
>     ... 18 more
> {noformat}
> 1) Error message doesn't reflect what have happened
> 2) In my opinion, in this case we should set innerTypeCol to {{new InnerType \{innerLongCol=3,
innerStrCol=default\}}}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message