[ 
https://issues.apache.org/jira/browse/PHOENIX-4588?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16355180#comment-16355180
 ] 

Ankit Singhal commented on PHOENIX-4588:
----------------------------------------

Attaching the fix and verified on the cluster but It's getting difficult to 
create a unit test case for the same.

> Clone expression also if it's children have Determinism.PER_INVOCATION
> ----------------------------------------------------------------------
>
>                 Key: PHOENIX-4588
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4588
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Ankit Singhal
>            Assignee: Ankit Singhal
>            Priority: Major
>             Fix For: 4.14.0
>
>
> In case of parallel UPSERT for non-aggregate SELECT, we should be cloning the 
> expression too if any of it's children needs to be cloned. Otherwise, queries 
> will fail with IllegalDataException
>  
> {code:java}
> Error: ERROR 201 (22000): Illegal data. ERROR 201 (22000): Illegal data. 
> Expected length of at least 32 bytes, but had 31 (state=22000,code=201)
> java.sql.SQLException: ERROR 201 (22000): Illegal data. ERROR 201 (22000): 
> Illegal data. Expected length of at least 32 bytes, but had 31
> at 
> org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:443)
> at 
> org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:145)
> at 
> org.apache.phoenix.util.ServerUtil.parseRemoteException(ServerUtil.java:141)
> at 
> org.apache.phoenix.util.ServerUtil.parseServerExceptionOrNull(ServerUtil.java:125)
> at 
> org.apache.phoenix.util.ServerUtil.parseServerException(ServerUtil.java:111)
> at 
> org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:778)
> at 
> org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:719)
> at 
> org.apache.phoenix.iterate.ConcatResultIterator.getIterators(ConcatResultIterator.java:50)
> at 
> org.apache.phoenix.iterate.ConcatResultIterator.currentIterator(ConcatResultIterator.java:97)
> at 
> org.apache.phoenix.iterate.ConcatResultIterator.next(ConcatResultIterator.java:117)
> at 
> org.apache.phoenix.iterate.DelegateResultIterator.next(DelegateResultIterator.java:44)
> at 
> org.apache.phoenix.compile.UpsertCompiler$2.execute(UpsertCompiler.java:797)
> at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:343)
> at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:331)
> at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:330)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1440)
> at sqlline.Commands.execute(Commands.java:822)
> at sqlline.Commands.sql(Commands.java:732)
> at sqlline.SqlLine.dispatch(SqlLine.java:808)
> at sqlline.SqlLine.begin(SqlLine.java:681)
> at sqlline.SqlLine.start(SqlLine.java:398)
> at sqlline.SqlLine.main(SqlLine.java:292)
> Caused by: java.sql.SQLException: ERROR 201 (22000): Illegal data. Expected 
> length of at least 32 bytes, but had 31
> at 
> org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:443)
> at 
> org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:145)
> at org.apache.phoenix.schema.KeyValueSchema.next(KeyValueSchema.java:213)
> at 
> org.apache.phoenix.expression.ProjectedColumnExpression.evaluate(ProjectedColumnExpression.java:115)
> at 
> org.apache.phoenix.expression.CoerceExpression.evaluate(CoerceExpression.java:148)
> at 
> org.apache.phoenix.compile.ExpressionProjector.getValue(ExpressionProjector.java:69)
> at 
> org.apache.phoenix.jdbc.PhoenixResultSet.getObject(PhoenixResultSet.java:524)
> at 
> org.apache.phoenix.compile.UpsertCompiler.upsertSelect(UpsertCompiler.java:194)
> at 
> org.apache.phoenix.compile.UpsertCompiler.access$000(UpsertCompiler.java:110)
> at 
> org.apache.phoenix.compile.UpsertCompiler$UpsertingParallelIteratorFactory.mutate(UpsertCompiler.java:254)
> at 
> org.apache.phoenix.compile.MutatingParallelIteratorFactory.newIterator(MutatingParallelIteratorFactory.java:59)
> at 
> org.apache.phoenix.iterate.ParallelIterators$1.call(ParallelIterators.java:115)
> at 
> org.apache.phoenix.iterate.ParallelIterators$1.call(ParallelIterators.java:106)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at 
> org.apache.phoenix.job.JobManager$InstrumentedJobFutureTask.run(JobManager.java:183)
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:748){code}



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

Reply via email to