Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-4588

Clone expression also if it's children have Determinism.PER_INVOCATION

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 5.0.0-alpha, 4.14.0
    • None
    • None

    Description

      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

       

      
      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)

      Attachments

        1. PHOENIX-4588.patch
          9 kB
          Ankit Singhal
        2. PHOENIX-4588_v1.patch
          7 kB
          Ankit Singhal
        3. PHOENIX-4588_v2.patch
          0.7 kB
          Ankit Singhal

        Issue Links

          Activity

            People

              ankit@apache.org Ankit Singhal
              ankit@apache.org Ankit Singhal
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: