You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "Carl-Zhou-CN (via GitHub)" <gi...@apache.org> on 2024/07/29 08:27:48 UTC
[PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Carl-Zhou-CN opened a new pull request, #7283:
URL: https://github.com/apache/seatunnel/pull/7283
close #7009
<!--
Thank you for contributing to SeaTunnel! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
## Contribution Checklist
- Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/seatunnel/issues).
- Name the pull request in the form "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
- Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
-->
### Purpose of this pull request
<!-- Describe the purpose of this pull request. For example: This pull request adds checkstyle plugin.-->
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released SeaTunnel versions or within the unreleased branches such as dev.
If no, write 'No'.
If you are adding/modifying connector documents, please follow our new specifications: https://github.com/apache/seatunnel/issues/4544.
-->
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
If you are adding E2E test cases, maybe refer to https://github.com/apache/seatunnel/blob/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-mysql-e2e/src/test/resources/mysqlcdc_to_mysql.conf, here is a good example.
-->
### Check list
* [ ] If any new Jar binary package adding in your PR, please add License Notice according
[New License Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/contribution/new-license.md)
* [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/seatunnel/tree/dev/docs
* [ ] If you are contributing the connector code, please check that the following files are updated:
1. Update change log that in connector document. For more details you can refer to [connector-v2](https://github.com/apache/seatunnel/tree/dev/docs/en/connector-v2)
2. Update [plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it
3. Update the pom file of [seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml)
* [ ] Update the [`release-note`](https://github.com/apache/seatunnel/blob/dev/release-note.md).
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "Carl-Zhou-CN (via GitHub)" <gi...@apache.org>.
Carl-Zhou-CN commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1708450845
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/JdbcMysqlMultipleTablesIT.java:
##########
@@ -171,7 +171,7 @@ public void testMysqlJdbcSingleTableE2e(TestContainer container)
@DisabledOnContainer(
value = {},
- type = {EngineType.SPARK, EngineType.FLINK},
+ type = {EngineType.FLINK},
Review Comment:
ok
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "Carl-Zhou-CN (via GitHub)" <gi...@apache.org>.
Carl-Zhou-CN commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1713388590
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/java/org/apache/seatunnel/e2e/connector/http/HttpIT.java:
##########
@@ -245,6 +246,9 @@ public void testMultiTableHttp(TestContainer container)
mockServerClient.retrieveRecordedRequests(
request().withPath("/example/httpMultiTableContentSink").withMethod("POST"),
Format.JSON);
+ mockServerClient.clear(
+ request().withPath("/example/httpMultiTableContentSink").withMethod("POST"),
+ ClearType.LOG);
Review Comment:
Thank you very much @jackyyyyyssss ,Please cc
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/java/org/apache/seatunnel/e2e/connector/http/HttpIT.java:
##########
@@ -245,6 +246,9 @@ public void testMultiTableHttp(TestContainer container)
mockServerClient.retrieveRecordedRequests(
request().withPath("/example/httpMultiTableContentSink").withMethod("POST"),
Format.JSON);
+ mockServerClient.clear(
Review Comment:
Thank you very much @jackyyyyyssss ,Please cc
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "CheneyYin (via GitHub)" <gi...@apache.org>.
CheneyYin commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1699416297
##########
seatunnel-core/seatunnel-spark-starter/seatunnel-spark-starter-common/src/main/java/org/apache/seatunnel/core/starter/spark/execution/SparkRuntimeEnvironment.java:
##########
@@ -106,12 +106,14 @@ public SparkRuntimeEnvironment prepare() {
this.jobName = config.getString("job.name");
}
sparkConf = createSparkConf();
+ sparkConf.set("spark.sql.unsafe.enabled", "false");
Review Comment:
why disable unsafe?
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "Carl-Zhou-CN (via GitHub)" <gi...@apache.org>.
Carl-Zhou-CN commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1712858303
##########
seatunnel-core/seatunnel-spark-starter/seatunnel-spark-starter-common/src/main/java/org/apache/seatunnel/core/starter/spark/execution/TransformExecuteProcessor.java:
##########
@@ -129,10 +130,11 @@ public List<DatasetTableInfo> execute(List<DatasetTableInfo> upstreamDataStreams
private Dataset<Row> sparkTransform(SeaTunnelTransform transform, DatasetTableInfo tableInfo) {
Dataset<Row> stream = tableInfo.getDataset();
- SeaTunnelDataType<?> inputDataType = tableInfo.getCatalogTable().getSeaTunnelRowType();
+ SeaTunnelDataType<?> inputDataType =
+ tableInfo.getCatalogTables().get(0).getSeaTunnelRowType();
Review Comment:
This is because 'ransform' now supports only single tables
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "Carl-Zhou-CN (via GitHub)" <gi...@apache.org>.
Carl-Zhou-CN commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1712560030
##########
seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/execution/PluginUtil.java:
##########
@@ -98,10 +104,11 @@ public static SourceTableInfo createSource(
CatalogTableUtil.convertDataTypeToCatalogTables(seaTunnelDataType, tableId);
}
- if (catalogTables.size() != 1) {
- throw new SeaTunnelException(
- String.format("Unsupported table number: %d on flink", catalogTables.size()));
- }
+ // if (catalogTables.size() != 1) {
+ // throw new SeaTunnelException(
+ // String.format("Unsupported table number: %d on flink",
+ // catalogTables.size()));
+ // }
Review Comment:
This is specifically for multi-table exceptions and can be removed when both spark and flink are implemented
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1712563222
##########
seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/execution/PluginUtil.java:
##########
@@ -98,10 +104,11 @@ public static SourceTableInfo createSource(
CatalogTableUtil.convertDataTypeToCatalogTables(seaTunnelDataType, tableId);
}
- if (catalogTables.size() != 1) {
- throw new SeaTunnelException(
- String.format("Unsupported table number: %d on flink", catalogTables.size()));
- }
+ // if (catalogTables.size() != 1) {
+ // throw new SeaTunnelException(
+ // String.format("Unsupported table number: %d on flink",
+ // catalogTables.size()));
+ // }
Review Comment:
flink is currently not supported
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1695284719
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/JdbcMysqlMultipleTablesIT.java:
##########
@@ -171,7 +171,7 @@ public void testMysqlJdbcSingleTableE2e(TestContainer container)
@DisabledOnContainer(
value = {},
- type = {EngineType.SPARK, EngineType.FLINK},
+ type = {EngineType.FLINK},
Review Comment:
check other testcase and remove EngineType.SPARK
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X merged PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1695284719
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/JdbcMysqlMultipleTablesIT.java:
##########
@@ -171,7 +171,7 @@ public void testMysqlJdbcSingleTableE2e(TestContainer container)
@DisabledOnContainer(
value = {},
- type = {EngineType.SPARK, EngineType.FLINK},
+ type = {EngineType.FLINK},
Review Comment:
check all e2e testcase and remove EngineType.SPARK
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "CheneyYin (via GitHub)" <gi...@apache.org>.
CheneyYin commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1699461739
##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-common/src/main/java/org/apache/seatunnel/translation/spark/serialization/InternalRowConverter.java:
##########
@@ -213,9 +245,27 @@ private static MutableValue createMutableValue(SeaTunnelDataType<?> dataType) {
}
}
+ public SeaTunnelRow unpack(InternalRow engineRow, SeaTunnelRowType rowType) throws IOException {
+ RowKind rowKind = RowKind.fromByteValue(engineRow.getByte(0));
+ String tableId = engineRow.getString(1);
+ Object[] fields = new Object[indexes.length];
+ for (int i = 0; i < indexes.length; i++) {
+ fields[i] =
+ reconvert(
+ engineRow.get(
+ indexes[i] + 2,
+ TypeConverterUtils.convert(rowType.getFieldType(indexes[i]))),
+ rowType.getFieldType(indexes[i]));
+ }
+ SeaTunnelRow seaTunnelRow = new SeaTunnelRow(fields);
+ seaTunnelRow.setRowKind(rowKind);
+ seaTunnelRow.setTableId(tableId);
+ return seaTunnelRow;
+ }
+
@Override
public SeaTunnelRow reconvert(InternalRow engineRow) throws IOException {
- return (SeaTunnelRow) reconvert(engineRow, dataType);
+ return unpack(engineRow, (SeaTunnelRowType) dataType);
}
Review Comment:
ditto
##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-common/src/main/java/org/apache/seatunnel/translation/spark/serialization/InternalRowConverter.java:
##########
@@ -63,17 +64,24 @@
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
+import java.util.stream.IntStream;
public final class InternalRowConverter extends RowConverter<InternalRow> {
+ private final int[] indexes;
public InternalRowConverter(SeaTunnelDataType<?> dataType) {
super(dataType);
+ indexes = IntStream.range(0, ((SeaTunnelRowType) dataType).getTotalFields()).toArray();
+ }
+
+ public InternalRowConverter(SeaTunnelDataType<?> dataType, int[] indexes) {
+ super(dataType);
+ this.indexes = indexes;
}
@Override
public InternalRow convert(SeaTunnelRow seaTunnelRow) throws IOException {
- validate(seaTunnelRow);
- return (InternalRow) convert(seaTunnelRow, dataType);
+ return parcel(seaTunnelRow, (SeaTunnelRowType) dataType);
}
Review Comment:
It might be more reliable to add unit tests for it. It would be best if it covers all data types.
##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-common/src/main/java/org/apache/seatunnel/translation/spark/serialization/SeaTunnelRowConverter.java:
##########
@@ -56,11 +57,25 @@ public SeaTunnelRow convert(SeaTunnelRow seaTunnelRow) throws IOException {
validate(seaTunnelRow);
GenericRowWithSchema rowWithSchema = (GenericRowWithSchema) convert(seaTunnelRow, dataType);
SeaTunnelRow newRow = new SeaTunnelRow(rowWithSchema.values());
- newRow.setRowKind(seaTunnelRow.getRowKind());
- newRow.setTableId(seaTunnelRow.getTableId());
return newRow;
}
+ public GenericRowWithSchema parcel(SeaTunnelRow seaTunnelRow) {
Review Comment:
ditto
##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-common/src/main/java/org/apache/seatunnel/translation/spark/serialization/SeaTunnelRowConverter.java:
##########
@@ -156,6 +171,20 @@ public SeaTunnelRow reconvert(SeaTunnelRow engineRow) throws IOException {
return (SeaTunnelRow) reconvert(engineRow, dataType);
}
+ public SeaTunnelRow unpack(GenericRowWithSchema engineRow) throws IOException {
Review Comment:
ditto
##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-common/src/main/java/org/apache/seatunnel/translation/spark/utils/SchemaUtil.java:
##########
@@ -0,0 +1,107 @@
+/*
+ * 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.seatunnel.translation.spark.utils;
+
+import org.apache.seatunnel.api.table.catalog.CatalogTable;
+import org.apache.seatunnel.api.table.catalog.CatalogTableUtil;
+import org.apache.seatunnel.api.table.type.SeaTunnelDataType;
+import org.apache.seatunnel.api.table.type.SeaTunnelRowType;
+import org.apache.seatunnel.translation.spark.execution.ColumnWithIndex;
+import org.apache.seatunnel.translation.spark.execution.IndexQueue;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+public class SchemaUtil {
+
+ public static ColumnWithIndex[] mergeSchema(List<CatalogTable> catalogTables) {
+ if (catalogTables.size() == 1) {
+ CatalogTable catalogTable = catalogTables.get(0);
+ return new ColumnWithIndex[] {
+ new ColumnWithIndex(
+ IntStream.rangeClosed(
+ 0, catalogTable.getSeaTunnelRowType().getTotalFields())
+ .toArray(),
+ catalogTable,
+ null)
+ };
+ }
+ List<String> fieldNames = new ArrayList<>();
+ List<SeaTunnelDataType<?>> fieldTypes = new ArrayList<>();
+ List<ColumnWithIndex> columnWithIndexes = new ArrayList<>();
+ fieldTypes.sort(Comparator.comparingInt(o -> o.getSqlType().ordinal()));
Review Comment:
`fieldTypes` is empty. It's meaningless to sort it.
##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-common/src/main/java/org/apache/seatunnel/translation/spark/utils/SchemaUtil.java:
##########
@@ -0,0 +1,107 @@
+/*
+ * 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.seatunnel.translation.spark.utils;
+
+import org.apache.seatunnel.api.table.catalog.CatalogTable;
+import org.apache.seatunnel.api.table.catalog.CatalogTableUtil;
+import org.apache.seatunnel.api.table.type.SeaTunnelDataType;
+import org.apache.seatunnel.api.table.type.SeaTunnelRowType;
+import org.apache.seatunnel.translation.spark.execution.ColumnWithIndex;
+import org.apache.seatunnel.translation.spark.execution.IndexQueue;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+public class SchemaUtil {
+
+ public static ColumnWithIndex[] mergeSchema(List<CatalogTable> catalogTables) {
Review Comment:
It would be better to add unit test cases.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "Carl-Zhou-CN (via GitHub)" <gi...@apache.org>.
Carl-Zhou-CN commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1712862376
##########
seatunnel-core/seatunnel-spark-starter/seatunnel-spark-starter-common/src/main/java/org/apache/seatunnel/core/starter/spark/execution/SparkRuntimeEnvironment.java:
##########
@@ -112,6 +112,7 @@ public SparkRuntimeEnvironment prepare() {
}
this.sparkSession = builder.getOrCreate();
createStreamingContext();
+
Review Comment:
done, good fix
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "Carl-Zhou-CN (via GitHub)" <gi...@apache.org>.
Carl-Zhou-CN commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1712563829
##########
seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/execution/PluginUtil.java:
##########
@@ -98,10 +104,11 @@ public static SourceTableInfo createSource(
CatalogTableUtil.convertDataTypeToCatalogTables(seaTunnelDataType, tableId);
}
- if (catalogTables.size() != 1) {
- throw new SeaTunnelException(
- String.format("Unsupported table number: %d on flink", catalogTables.size()));
- }
+ // if (catalogTables.size() != 1) {
+ // throw new SeaTunnelException(
+ // String.format("Unsupported table number: %d on flink",
+ // catalogTables.size()));
+ // }
Review Comment:
It affects not only flink but also spark
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "Carl-Zhou-CN (via GitHub)" <gi...@apache.org>.
Carl-Zhou-CN commented on PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#issuecomment-2279653839

--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#issuecomment-2261960865
cc @CheneyYin
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "Carl-Zhou-CN (via GitHub)" <gi...@apache.org>.
Carl-Zhou-CN commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1699517351
##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-common/src/main/java/org/apache/seatunnel/translation/spark/utils/SchemaUtil.java:
##########
@@ -0,0 +1,107 @@
+/*
+ * 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.seatunnel.translation.spark.utils;
+
+import org.apache.seatunnel.api.table.catalog.CatalogTable;
+import org.apache.seatunnel.api.table.catalog.CatalogTableUtil;
+import org.apache.seatunnel.api.table.type.SeaTunnelDataType;
+import org.apache.seatunnel.api.table.type.SeaTunnelRowType;
+import org.apache.seatunnel.translation.spark.execution.ColumnWithIndex;
+import org.apache.seatunnel.translation.spark.execution.IndexQueue;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+public class SchemaUtil {
+
+ public static ColumnWithIndex[] mergeSchema(List<CatalogTable> catalogTables) {
+ if (catalogTables.size() == 1) {
+ CatalogTable catalogTable = catalogTables.get(0);
+ return new ColumnWithIndex[] {
+ new ColumnWithIndex(
+ IntStream.rangeClosed(
+ 0, catalogTable.getSeaTunnelRowType().getTotalFields())
+ .toArray(),
+ catalogTable,
+ null)
+ };
+ }
+ List<String> fieldNames = new ArrayList<>();
+ List<SeaTunnelDataType<?>> fieldTypes = new ArrayList<>();
+ List<ColumnWithIndex> columnWithIndexes = new ArrayList<>();
+ fieldTypes.sort(Comparator.comparingInt(o -> o.getSqlType().ordinal()));
Review Comment:
It's not being used. I'll remove it. Thank you
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "Carl-Zhou-CN (via GitHub)" <gi...@apache.org>.
Carl-Zhou-CN commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1716342045
##########
seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/execution/PluginUtil.java:
##########
@@ -98,10 +104,11 @@ public static SourceTableInfo createSource(
CatalogTableUtil.convertDataTypeToCatalogTables(seaTunnelDataType, tableId);
}
- if (catalogTables.size() != 1) {
- throw new SeaTunnelException(
- String.format("Unsupported table number: %d on flink", catalogTables.size()));
- }
+ // if (catalogTables.size() != 1) {
+ // throw new SeaTunnelException(
+ // String.format("Unsupported table number: %d on flink",
+ // catalogTables.size()));
+ // }
Review Comment:
Let's clean it up when flink implements multiple tables
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "jackyyyyyssss (via GitHub)" <gi...@apache.org>.
jackyyyyyssss commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1713388838
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/java/org/apache/seatunnel/e2e/connector/http/HttpIT.java:
##########
@@ -245,6 +246,9 @@ public void testMultiTableHttp(TestContainer container)
mockServerClient.retrieveRecordedRequests(
request().withPath("/example/httpMultiTableContentSink").withMethod("POST"),
Format.JSON);
+ mockServerClient.clear(
Review Comment:
Sorry, I forgot to clear the records, which caused the run to fail. This test case will run multiple times. Please help add it
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1707068561
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/JdbcMysqlMultipleTablesIT.java:
##########
@@ -171,7 +171,7 @@ public void testMysqlJdbcSingleTableE2e(TestContainer container)
@DisabledOnContainer(
value = {},
- type = {EngineType.SPARK, EngineType.FLINK},
+ type = {EngineType.FLINK},
Review Comment:
check all e2e testcase and remove EngineType.SPARK
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1707069218
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/JdbcMysqlMultipleTablesIT.java:
##########
@@ -171,7 +171,7 @@ public void testMysqlJdbcSingleTableE2e(TestContainer container)
@DisabledOnContainer(
value = {},
- type = {EngineType.SPARK, EngineType.FLINK},
+ type = {EngineType.FLINK},
Review Comment:
@Carl-Zhou-CN
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "CheneyYin (via GitHub)" <gi...@apache.org>.
CheneyYin commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1712634235
##########
seatunnel-core/seatunnel-spark-starter/seatunnel-spark-starter-common/src/main/java/org/apache/seatunnel/core/starter/spark/execution/TransformExecuteProcessor.java:
##########
@@ -101,7 +102,7 @@ public List<DatasetTableInfo> execute(List<DatasetTableInfo> upstreamDataStreams
TableTransformFactory factory = plugins.get(i);
TableTransformFactoryContext context =
Review Comment:
Maybe you can use `dataset.getCatalogTables()` instead of `Collections.singletonList(dataset.getCatalogTables().get(0))` ?. Like this:
```java
TableTransformFactoryContext context =
new TableTransformFactoryContext(
dataset.getCatalogTables(),
ReadonlyConfig.fromConfig(pluginConfig),
classLoader);
```
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "CheneyYin (via GitHub)" <gi...@apache.org>.
CheneyYin commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1712634235
##########
seatunnel-core/seatunnel-spark-starter/seatunnel-spark-starter-common/src/main/java/org/apache/seatunnel/core/starter/spark/execution/TransformExecuteProcessor.java:
##########
@@ -101,7 +102,7 @@ public List<DatasetTableInfo> execute(List<DatasetTableInfo> upstreamDataStreams
TableTransformFactory factory = plugins.get(i);
TableTransformFactoryContext context =
Review Comment:
Maybe you can use `dataset.getCatalogTables()` instead of `Collections.singletonList(dataset.getCatalogTables().get(0))` ?. Like this:
```java
TableTransformFactoryContext context =
new TableTransformFactoryContext(
dataset.getCatalogTables(),
ReadonlyConfig.fromConfig(pluginConfig),
classLoader);
```
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "jackyyyyyssss (via GitHub)" <gi...@apache.org>.
jackyyyyyssss commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1713398269
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/java/org/apache/seatunnel/e2e/connector/http/HttpIT.java:
##########
@@ -245,6 +246,9 @@ public void testMultiTableHttp(TestContainer container)
mockServerClient.retrieveRecordedRequests(
request().withPath("/example/httpMultiTableContentSink").withMethod("POST"),
Format.JSON);
+ mockServerClient.clear(
Review Comment:
LGTM
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "Carl-Zhou-CN (via GitHub)" <gi...@apache.org>.
Carl-Zhou-CN commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1699519199
##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-common/src/main/java/org/apache/seatunnel/translation/spark/serialization/InternalRowConverter.java:
##########
@@ -63,17 +64,24 @@
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
+import java.util.stream.IntStream;
public final class InternalRowConverter extends RowConverter<InternalRow> {
+ private final int[] indexes;
public InternalRowConverter(SeaTunnelDataType<?> dataType) {
super(dataType);
+ indexes = IntStream.range(0, ((SeaTunnelRowType) dataType).getTotalFields()).toArray();
+ }
+
+ public InternalRowConverter(SeaTunnelDataType<?> dataType, int[] indexes) {
+ super(dataType);
+ this.indexes = indexes;
}
@Override
public InternalRow convert(SeaTunnelRow seaTunnelRow) throws IOException {
- validate(seaTunnelRow);
- return (InternalRow) convert(seaTunnelRow, dataType);
+ return parcel(seaTunnelRow, (SeaTunnelRowType) dataType);
}
Review Comment:
I will refactor and consolidate this part of the logic and provide test cases.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "Carl-Zhou-CN (via GitHub)" <gi...@apache.org>.
Carl-Zhou-CN commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1699447653
##########
seatunnel-core/seatunnel-spark-starter/seatunnel-spark-starter-common/src/main/java/org/apache/seatunnel/core/starter/spark/execution/SparkRuntimeEnvironment.java:
##########
@@ -106,12 +106,14 @@ public SparkRuntimeEnvironment prepare() {
this.jobName = config.getString("job.name");
}
sparkConf = createSparkConf();
+ sparkConf.set("spark.sql.unsafe.enabled", "false");
Review Comment:
I'll remove it. Thank you
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "Carl-Zhou-CN (via GitHub)" <gi...@apache.org>.
Carl-Zhou-CN commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1713388590
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/java/org/apache/seatunnel/e2e/connector/http/HttpIT.java:
##########
@@ -245,6 +246,9 @@ public void testMultiTableHttp(TestContainer container)
mockServerClient.retrieveRecordedRequests(
request().withPath("/example/httpMultiTableContentSink").withMethod("POST"),
Format.JSON);
+ mockServerClient.clear(
+ request().withPath("/example/httpMultiTableContentSink").withMethod("POST"),
+ ClearType.LOG);
Review Comment:
Thank you very much @jackyyyyyssss ,Please cc
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "CheneyYin (via GitHub)" <gi...@apache.org>.
CheneyYin commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1712633043
##########
seatunnel-core/seatunnel-spark-starter/seatunnel-spark-starter-common/src/main/java/org/apache/seatunnel/core/starter/spark/execution/SparkRuntimeEnvironment.java:
##########
@@ -112,6 +112,7 @@ public SparkRuntimeEnvironment prepare() {
}
this.sparkSession = builder.getOrCreate();
createStreamingContext();
+
Review Comment:
FYA
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#issuecomment-2279486413
waiting for this pr merge
https://github.com/apache/seatunnel/pull/7356
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1712558935
##########
seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/execution/PluginUtil.java:
##########
@@ -98,10 +104,11 @@ public static SourceTableInfo createSource(
CatalogTableUtil.convertDataTypeToCatalogTables(seaTunnelDataType, tableId);
}
- if (catalogTables.size() != 1) {
- throw new SeaTunnelException(
- String.format("Unsupported table number: %d on flink", catalogTables.size()));
- }
+ // if (catalogTables.size() != 1) {
+ // throw new SeaTunnelException(
+ // String.format("Unsupported table number: %d on flink",
+ // catalogTables.size()));
+ // }
Review Comment:
why?
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "CheneyYin (via GitHub)" <gi...@apache.org>.
CheneyYin commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1712635210
##########
seatunnel-core/seatunnel-spark-starter/seatunnel-spark-starter-common/src/main/java/org/apache/seatunnel/core/starter/spark/execution/TransformExecuteProcessor.java:
##########
@@ -129,10 +130,11 @@ public List<DatasetTableInfo> execute(List<DatasetTableInfo> upstreamDataStreams
private Dataset<Row> sparkTransform(SeaTunnelTransform transform, DatasetTableInfo tableInfo) {
Dataset<Row> stream = tableInfo.getDataset();
- SeaTunnelDataType<?> inputDataType = tableInfo.getCatalogTable().getSeaTunnelRowType();
+ SeaTunnelDataType<?> inputDataType =
+ tableInfo.getCatalogTables().get(0).getSeaTunnelRowType();
Review Comment:
Does Covenant `transform` only deal with the first one?
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "CheneyYin (via GitHub)" <gi...@apache.org>.
CheneyYin commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1712634320
##########
seatunnel-core/seatunnel-spark-starter/seatunnel-spark-starter-common/src/main/java/org/apache/seatunnel/core/starter/spark/execution/TransformExecuteProcessor.java:
##########
@@ -101,7 +102,7 @@ public List<DatasetTableInfo> execute(List<DatasetTableInfo> upstreamDataStreams
TableTransformFactory factory = plugins.get(i);
TableTransformFactoryContext context =
new TableTransformFactoryContext(
- Collections.singletonList(dataset.getCatalogTable()),
+ Collections.singletonList(dataset.getCatalogTables().get(0)),
Review Comment:
Maybe you can use `dataset.getCatalogTables()` instead of `Collections.singletonList(dataset.getCatalogTables().get(0))` ?. Like this:
```java
TableTransformFactoryContext context =
new TableTransformFactoryContext(
dataset.getCatalogTables(),
ReadonlyConfig.fromConfig(pluginConfig),
classLoader);
```
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "Carl-Zhou-CN (via GitHub)" <gi...@apache.org>.
Carl-Zhou-CN commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1712858303
##########
seatunnel-core/seatunnel-spark-starter/seatunnel-spark-starter-common/src/main/java/org/apache/seatunnel/core/starter/spark/execution/TransformExecuteProcessor.java:
##########
@@ -129,10 +130,11 @@ public List<DatasetTableInfo> execute(List<DatasetTableInfo> upstreamDataStreams
private Dataset<Row> sparkTransform(SeaTunnelTransform transform, DatasetTableInfo tableInfo) {
Dataset<Row> stream = tableInfo.getDataset();
- SeaTunnelDataType<?> inputDataType = tableInfo.getCatalogTable().getSeaTunnelRowType();
+ SeaTunnelDataType<?> inputDataType =
+ tableInfo.getCatalogTables().get(0).getSeaTunnelRowType();
Review Comment:
This is because 'transform' now supports only single tables
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "Carl-Zhou-CN (via GitHub)" <gi...@apache.org>.
Carl-Zhou-CN commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1712862182
##########
seatunnel-core/seatunnel-spark-starter/seatunnel-spark-starter-common/src/main/java/org/apache/seatunnel/core/starter/spark/execution/TransformExecuteProcessor.java:
##########
@@ -101,7 +102,7 @@ public List<DatasetTableInfo> execute(List<DatasetTableInfo> upstreamDataStreams
TableTransformFactory factory = plugins.get(i);
TableTransformFactoryContext context =
new TableTransformFactoryContext(
- Collections.singletonList(dataset.getCatalogTable()),
+ Collections.singletonList(dataset.getCatalogTables().get(0)),
Review Comment:
done, excellent advice
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1716249464
##########
seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/execution/PluginUtil.java:
##########
@@ -98,10 +104,11 @@ public static SourceTableInfo createSource(
CatalogTableUtil.convertDataTypeToCatalogTables(seaTunnelDataType, tableId);
}
- if (catalogTables.size() != 1) {
- throw new SeaTunnelException(
- String.format("Unsupported table number: %d on flink", catalogTables.size()));
- }
+ // if (catalogTables.size() != 1) {
+ // throw new SeaTunnelException(
+ // String.format("Unsupported table number: %d on flink",
+ // catalogTables.size()));
+ // }
Review Comment:
So flink will not throw exception now?
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "Carl-Zhou-CN (via GitHub)" <gi...@apache.org>.
Carl-Zhou-CN commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1716338879
##########
seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/execution/PluginUtil.java:
##########
@@ -98,10 +104,11 @@ public static SourceTableInfo createSource(
CatalogTableUtil.convertDataTypeToCatalogTables(seaTunnelDataType, tableId);
}
- if (catalogTables.size() != 1) {
- throw new SeaTunnelException(
- String.format("Unsupported table number: %d on flink", catalogTables.size()));
- }
+ // if (catalogTables.size() != 1) {
+ // throw new SeaTunnelException(
+ // String.format("Unsupported table number: %d on flink",
+ // catalogTables.size()));
+ // }
Review Comment:
yes, I think flink is about to implement multiple tables as well
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Spark] Support multiple tables read and write [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1716340494
##########
seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/execution/PluginUtil.java:
##########
@@ -98,10 +104,11 @@ public static SourceTableInfo createSource(
CatalogTableUtil.convertDataTypeToCatalogTables(seaTunnelDataType, tableId);
}
- if (catalogTables.size() != 1) {
- throw new SeaTunnelException(
- String.format("Unsupported table number: %d on flink", catalogTables.size()));
- }
+ // if (catalogTables.size() != 1) {
+ // throw new SeaTunnelException(
+ // String.format("Unsupported table number: %d on flink",
+ // catalogTables.size()));
+ // }
Review Comment:
Ok. Please clean the code.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org