[
https://issues.apache.org/jira/browse/PHOENIX-7636?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Viraj Jasani reassigned PHOENIX-7636:
-------------------------------------
Assignee: Viraj Jasani
> CDC on table with case-sensitive pk fails to read partition records
> -------------------------------------------------------------------
>
> Key: PHOENIX-7636
> URL: https://issues.apache.org/jira/browse/PHOENIX-7636
> Project: Phoenix
> Issue Type: Bug
> Reporter: Viraj Jasani
> Assignee: Viraj Jasani
> Priority: Major
> Fix For: 5.3.0
>
>
> While creating CDC object on table with case-sensitive pk columns, the CDC
> PTable definition does not include case-sensitive pk columns of the data
> table. Therefore, reading of the CDC records fails as the query optimizer
> cannot select any plan.
> e.g.
> SQL statements
>
> {code:java}
> CREATE TABLE XYZ."test.table" ("key1" VARCHAR NOT NULL, COL BSON CONSTRAINT
> pk PRIMARY KEY ("key1"));
> CREATE CDC "CDC_test.table" on XYZ."test.table";
> UPSERT INTO XYZ."test.table" VALUES (?,?);
> SELECT /*+ CDC_INCLUDE(PRE, POST) */ * FROM XYZ."CDC_test.table" WHERE
> PARTITION_ID() = ? AND PHOENIX_ROW_TIMESTAMP() >= CAST(CAST(? AS BIGINT) AS
> TIMESTAMP) LIMIT ?;{code}
>
>
>
> {code:java}
> Caused by:
> org.apache.phoenix.schema.RowValueConstructorOffsetNotCoercibleException:
> ERROR 2014 (INT16): Row Value Constructor Offset Not Coercible to a Primary
> or Indexed RowKey. No table or index could be coerced to the PK as the
> offset. Or an uncovered index was attempted
> at
> org.apache.phoenix.optimize.QueryOptimizer.getApplicablePlansForSingleFlatQuery(QueryOptimizer.java:331)
> ~[phoenix-core-client-5.3.0-sfdc-13.0.24.jar:5.3.0-sfdc-13.0.24]
> at
> org.apache.phoenix.optimize.QueryOptimizer.getApplicablePlans(QueryOptimizer.java:142)
> ~[phoenix-core-client-5.3.0-sfdc-13.0.24.jar:5.3.0-sfdc-13.0.24]
> at
> org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:120)
> ~[phoenix-core-client-5.3.0-sfdc-13.0.24.jar:5.3.0-sfdc-13.0.24]
> at
> org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:106)
> ~[phoenix-core-client-5.3.0-sfdc-13.0.24.jar:5.3.0-sfdc-13.0.24]
> at
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:392)
> ~[phoenix-core-client-5.3.0-sfdc-13.0.24.jar:5.3.0-sfdc-13.0.24]
> at
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:360)
> ~[phoenix-core-client-5.3.0-sfdc-13.0.24.jar:5.3.0-sfdc-13.0.24]
> at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> ~[phoenix-core-client-5.3.0-sfdc-13.0.24.jar:5.3.0-sfdc-13.0.24]
> at
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:360)
> ~[phoenix-core-client-5.3.0-sfdc-13.0.24.jar:5.3.0-sfdc-13.0.24]
> at
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:342)
> ~[phoenix-core-client-5.3.0-sfdc-13.0.24.jar:5.3.0-sfdc-13.0.24]
> at
> org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeQuery(PhoenixPreparedStatement.java:197)
> ~[phoenix-core-client-5.3.0-sfdc-13.0.24.jar:5.3.0-sfdc-13.0.24]
> at
> org.apache.phoenix.ddb.service.GetRecordsService.getRecords(GetRecordsService.java:71)
> ~[classes/:?]
> at org.apache.phoenix.ddb.rest.RootResource.get(RootResource.java:196)
> ~[classes/:?]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> ~[?:1.8.0_362]
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> ~[?:1.8.0_362]
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> ~[?:1.8.0_362]
> at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_362]{code}
>
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)