WenDing-Y commented on code in PR #49:
URL:
https://github.com/apache/flink-connector-jdbc/pull/49#discussion_r1210360121
##########
flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/databases/clickhouse/table/ClickhouseTableRow.java:
##########
@@ -0,0 +1,35 @@
+package org.apache.flink.connector.jdbc.databases.clickhouse.table;
+
+import org.apache.flink.connector.jdbc.testutils.tables.TableField;
+import org.apache.flink.connector.jdbc.testutils.tables.TableRow;
+
+import java.util.Arrays;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/** ClickhouseTableRow . */
+public class ClickhouseTableRow extends TableRow {
+
+ public ClickhouseTableRow(String name, TableField[] fields) {
+ super(name, fields);
+ }
+
+ @Override
+ public String getCreateQuery() {
+ return String.format(
+ "CREATE TABLE %s (%s) %s PRIMARY KEY (%s)",
+ getTableName(),
+
getStreamFields().map(TableField::asString).collect(Collectors.joining(", ")),
+ "ENGINE = MergeTree",
+ getStreamFields().map(TableField::getName).findFirst().get());
+ }
+
+ @Override
+ protected String getDeleteFromQuery() {
+ return String.format("truncate table %s", getTableName());
+ }
+
+ private Stream<TableField> getStreamFields() {
Review Comment:
This method is private, can I change it to protected
--
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]