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

NPE when doing UPSERT SELECT into salted tables

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.10.0
    • 4.11.0, 4.10.1
    • None
    • None

    Description

      We run into NPE when doing UPSERT SELECT into salted tables, client and server both running 4.10.0 release. Here is a minimal reproducer and the stack trace on the client side.

      create table test (id varchar not null primary key, a integer, b integer) salt_buckets = 2;
      upsert into test (id, b) select id, 1 from test;
      
      java.lang.NullPointerException: at index 2
              at com.google.common.collect.ObjectArrays.checkElementNotNull(ObjectArrays.java:191)
              at com.google.common.collect.ImmutableList.construct(ImmutableList.java:320)
              at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:290)
              at org.apache.phoenix.schema.PTableImpl.init(PTableImpl.java:534)
              at org.apache.phoenix.schema.PTableImpl.<init>(PTableImpl.java:408)
              at org.apache.phoenix.schema.PTableImpl.makePTable(PTableImpl.java:297)
              at org.apache.phoenix.compile.UpsertCompiler.compile(UpsertCompiler.java:684)
              at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableUpsertStatement.compilePlan(PhoenixStatement.java:611)
              at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableUpsertStatement.compilePlan(PhoenixStatement.java:597)
              at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:351)
              at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:341)
              at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
              at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:339)
              at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1511)
              at sqlline.Commands.execute(Commands.java:822)
              at sqlline.Commands.sql(Commands.java:732)
              at sqlline.SqlLine.dispatch(SqlLine.java:813)
              at sqlline.SqlLine.begin(SqlLine.java:686)
              at sqlline.SqlLine.start(SqlLine.java:398)
              at sqlline.SqlLine.main(SqlLine.java:291)
      

      Attachments

        1. PHOENIX-3800.patch
          3 kB
          Eiichi Sato

        Activity

          People

            sato_eiichi Eiichi Sato
            sato_eiichi Eiichi Sato
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: