shubham-roy commented on code in PR #2643:
URL: https://github.com/apache/phoenix/pull/2643#discussion_r4656524829
##########
phoenix-core/src/it/java/org/apache/phoenix/end2end/CDCDefinitionIT.java:
##########
@@ -276,6 +278,43 @@ public void testCreateWithNonDefaultColumnEncoding()
throws Exception {
assertEquals(indexTable.getEncodingScheme(), NON_ENCODED_QUALIFIERS);
}
+ @Test
+ public void testCreateCDCWithSplitPoints() throws Exception {
+ try (Connection conn = newConnection()) {
+ String tableName = generateUniqueName();
+ conn.createStatement()
+ .execute("CREATE TABLE " + tableName + " (k INTEGER PRIMARY KEY, v
INTEGER)");
+ String parentName = tableName;
+ if (forView) {
+ parentName = generateUniqueName();
+ conn.createStatement()
+ .execute("CREATE VIEW " + parentName + " AS SELECT * FROM " +
tableName);
+ }
+ String cdcName = generateUniqueName();
+ byte[][] splitPoints = { Bytes.toBytes("4"), { 0x5a, (byte) 0xff },
Bytes.toBytes("c") };
Review Comment:
Done in ba27a74. The test now uses 7 split points:
- zero and high bytes, including a zero byte in the middle of a key
- a multi-byte UTF-8 string (`8é`)
- a key longer than the 32-character `PARTITION_ID()` column
They are given as a hex literal in the SQL (`X'0001'`), plain string
literals and 4 bind values (one string, three raw bytes). Each region start key
is now compared exactly with the bytes Phoenix computes for it
(`SchemaUtil.processSplit`), instead of a prefix check.
The same commit fixes the new checkstyle and spotbugs warnings from the
precommit general check in `CreateCDCStatement`. The remaining unit-check
failures (`UCFWithDisabledIndexWithDDLValidationIT`,
`HAConnectionWithMasterAndRPCRegistryIT`,
`ParallelPhoenixConnectionFailureTest` and a few timing ones) also fail on
recent master branch builds and other PRs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]