[
https://issues.apache.org/jira/browse/PHOENIX-7008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17769452#comment-17769452
]
ASF GitHub Bot commented on PHOENIX-7008:
-----------------------------------------
haridsv commented on code in PR #1681:
URL: https://github.com/apache/phoenix/pull/1681#discussion_r1338152066
##########
phoenix-core/src/it/java/org/apache/phoenix/end2end/CDCMiscIT.java:
##########
@@ -0,0 +1,127 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import org.apache.phoenix.exception.SQLExceptionCode;
+import org.apache.phoenix.query.BaseTest;
+import org.apache.phoenix.util.SchemaUtil;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Properties;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
+
+@Category(ParallelStatsDisabledTest.class)
+public class CDCMiscIT extends ParallelStatsDisabledIT {
+ private void assertCDCState(Connection conn, String cdcName, String
expInclude,
+ int idxType) throws SQLException {
+ try (ResultSet rs = conn.createStatement().executeQuery("SELECT
cdc_include FROM " +
Review Comment:
I have added the check for the change scope on `PTable` as it corresponds to
the protobuf change but left the existing SYSCAT checks as is, as these are
existing fields and don't necessarily have to be validated through `PTable`.
WDYT?
> CDC DDL Compiler
> ----------------
>
> Key: PHOENIX-7008
> URL: https://issues.apache.org/jira/browse/PHOENIX-7008
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: Viraj Jasani
> Assignee: Hari Krishna Dara
> Priority: Major
>
> The purpose of this sub-task is to provide DDL query capability for CDC
> (Change Data Capture) feature.
> The CREATE CDC table query can look something like:
> {code:java}
> Create CDC <CDC Table Name> on <Data Table Name> (PHOENIX_ROW_TIMESTAMP() |
> <Data Table Column>) INCLUDE (pre | post | latest | all) TTL = <Age in
> seconds> INDEX = <GLOBAL | LOCAL> SALT_BUCKETS=<salt bucket count> {code}
>
> The changes include:
> * Create new table type CDC in SYSTEM.CATALOG
> * Provide CDC table to data table link in SYSTEM.CATALOG
> * Query parser/grammer changes
> * PTable link type: CDC_TABLE (from CDC table to data table)
> * MetaDataClient and ConnectionQueryServicesImpl (CQSI) changes to ensure no
> physical table gets created for CDC, it is rather treated as virtual table
> * Create Uncovered global index on data table using either
> PHOENIX_ROW_TIMESTAMP() or a data table column (as provided in the query)
> * Store INCLUDE image values (pre/post/latest/all) as CDC virtual table
> property in SYSTEM.CATALOG
> * ALTER CDC query should be able to update any CDC attributes
>
> ALTER and DROP CDC queries are provided by PHOENIX-7054.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)