featzhang commented on code in PR #123:
URL:
https://github.com/apache/flink-connector-pulsar/pull/123#discussion_r3257460361
##########
flink-connector-pulsar/pom.xml:
##########
@@ -133,14 +133,21 @@ under the License.
<artifactId>flink-table-test-utils</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.flink</groupId>
+
<artifactId>flink-table-planner-loader</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
-
<artifactId>flink-table-api-scala-bridge_${scala.binary.version}</artifactId>
+
<artifactId>flink-table-planner_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
</dependency>
+
Review Comment:
Duplicate `flink-table-planner` dependency. Remove one.
##########
flink-connector-pulsar/src/main/java/org/apache/flink/connector/pulsar/table/TableDataTypeUtils.java:
##########
@@ -0,0 +1,98 @@
+/*
+ * 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.flink.connector.pulsar.table;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.FieldsDataType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+import org.apache.flink.table.types.logical.RowType;
+
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+/**
+ * Utility methods for working with table {@link DataType}s.
+ *
+ * <p>This class contains methods that were removed from Flink's {@code
DataTypeUtils} in Flink 2.x.
+ * They are copied here to maintain the connector's functionality.
+ */
+@Internal
+public class TableDataTypeUtils {
+
+ private TableDataTypeUtils() {}
+
+ /**
+ * Removes a prefix from all field names in a row data type.
+ *
+ * @param dataType The row data type whose field names should be stripped.
+ * @param prefix The prefix to remove from each field name.
+ * @return A new data type with the prefix removed from field names.
Review Comment:
New utility class lacks unit tests. Add `TableDataTypeUtilsTest` to verify
`stripRowPrefix()` and `renameRowFields()`.
--
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]