You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "immustard (via GitHub)" <gi...@apache.org> on 2023/07/13 07:00:05 UTC
[GitHub] [seatunnel] immustard opened a new pull request, #5072: [Feature][connector-v2][Iceberg] sink plugin
immustard opened a new pull request, #5072:
URL: https://github.com/apache/seatunnel/pull/5072
<!--
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.-->
## Check list
* [x] Code changed are covered with tests, or it does not need tests for reason:
* [x] 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
[GitHub] [seatunnel] liugddx commented on pull request #5072: [Feature][connector-v2][Iceberg] sink plugin
Posted by "liugddx (via GitHub)" <gi...@apache.org>.
liugddx commented on PR #5072:
URL: https://github.com/apache/seatunnel/pull/5072#issuecomment-1635193941
Thanks for your contribution, Here are some comments.
--
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][connector-v2][Iceberg] sink plugin [seatunnel]
Posted by "EricJoy2048 (via GitHub)" <gi...@apache.org>.
EricJoy2048 closed pull request #5072: [Feature][connector-v2][Iceberg] sink plugin
URL: https://github.com/apache/seatunnel/pull/5072
--
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
[GitHub] [seatunnel] immustard commented on pull request #5072: [Feature][connector-v2][Iceberg] sink plugin
Posted by "immustard (via GitHub)" <gi...@apache.org>.
immustard commented on PR #5072:
URL: https://github.com/apache/seatunnel/pull/5072#issuecomment-1639149755
@liugddx PTAL
--
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
[GitHub] [seatunnel] liugddx commented on a diff in pull request #5072: [Feature][connector-v2][Iceberg] sink plugin
Posted by "liugddx (via GitHub)" <gi...@apache.org>.
liugddx commented on code in PR #5072:
URL: https://github.com/apache/seatunnel/pull/5072#discussion_r1263239895
##########
seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/config/SinkConfig.java:
##########
@@ -0,0 +1,48 @@
+package org.apache.seatunnel.connectors.seatunnel.iceberg.config;
Review Comment:
Please add apache license.
--
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
[GitHub] [seatunnel] liugddx commented on pull request #5072: [Feature][connector-v2][Iceberg] sink plugin
Posted by "liugddx (via GitHub)" <gi...@apache.org>.
liugddx commented on PR #5072:
URL: https://github.com/apache/seatunnel/pull/5072#issuecomment-1635199992
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
[GitHub] [seatunnel] liugddx commented on pull request #5072: [Feature][connector-v2][Iceberg] sink plugin
Posted by "liugddx (via GitHub)" <gi...@apache.org>.
liugddx commented on PR #5072:
URL: https://github.com/apache/seatunnel/pull/5072#issuecomment-1641881311
> @liugddx PTAL
Fix CI error.
--
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
[GitHub] [seatunnel] liugddx commented on a diff in pull request #5072: [Feature][connector-v2][Iceberg] sink plugin
Posted by "liugddx (via GitHub)" <gi...@apache.org>.
liugddx commented on code in PR #5072:
URL: https://github.com/apache/seatunnel/pull/5072#discussion_r1263242679
##########
seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/data/DataConverter.java:
##########
@@ -0,0 +1,19 @@
+package org.apache.seatunnel.connectors.seatunnel.iceberg.data;
+
+import org.apache.iceberg.data.Record;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+
+/**
+ *
+ *
+ * @author mustard
+ * @version 1.0
+ * Create by 2023-07-05
+ */
Review Comment:
The same above
##########
seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/config/SinkConfig.java:
##########
@@ -0,0 +1,48 @@
+package org.apache.seatunnel.connectors.seatunnel.iceberg.config;
+
+import lombok.Getter;
+import lombok.ToString;
+import org.apache.seatunnel.api.configuration.Option;
+import org.apache.seatunnel.api.configuration.Options;
+import org.apache.seatunnel.shade.com.typesafe.config.Config;
+
+/**
+ *
+ *
+ * @author mustard
+ * @version 1.0
+ * Create by 2023-07-05
+ */
Review Comment:
Remove these.
##########
seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/data/DefaultDataConverter.java:
##########
@@ -0,0 +1,219 @@
+package org.apache.seatunnel.connectors.seatunnel.iceberg.data;
Review Comment:
The same above
##########
seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/data/DefaultDataConverter.java:
##########
@@ -0,0 +1,219 @@
+package org.apache.seatunnel.connectors.seatunnel.iceberg.data;
+
+import lombok.NonNull;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.iceberg.Schema;
+import org.apache.iceberg.data.GenericRecord;
+import org.apache.iceberg.data.Record;
+import org.apache.iceberg.types.Type;
+import org.apache.iceberg.types.Types;
+import org.apache.seatunnel.api.table.type.*;
+import org.apache.seatunnel.common.exception.CommonErrorCode;
+import org.apache.seatunnel.connectors.seatunnel.iceberg.exception.IcebergConnectorException;
+
+import java.math.BigDecimal;
+import java.nio.ByteBuffer;
+import java.time.*;
+import java.util.*;
+
+import static org.apache.iceberg.types.Type.TypeID.*;
+
+/**
+ *
+ *
+ * @author mustard
+ * @version 1.0
+ * Create by 2023-07-05
+ */
Review Comment:
The same above
##########
seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/data/DefaultDataConverter.java:
##########
@@ -0,0 +1,219 @@
+package org.apache.seatunnel.connectors.seatunnel.iceberg.data;
+
+import lombok.NonNull;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.iceberg.Schema;
+import org.apache.iceberg.data.GenericRecord;
+import org.apache.iceberg.data.Record;
+import org.apache.iceberg.types.Type;
+import org.apache.iceberg.types.Types;
+import org.apache.seatunnel.api.table.type.*;
+import org.apache.seatunnel.common.exception.CommonErrorCode;
+import org.apache.seatunnel.connectors.seatunnel.iceberg.exception.IcebergConnectorException;
+
+import java.math.BigDecimal;
+import java.nio.ByteBuffer;
+import java.time.*;
+import java.util.*;
+
+import static org.apache.iceberg.types.Type.TypeID.*;
+
+/**
+ *
+ *
+ * @author mustard
+ * @version 1.0
+ * Create by 2023-07-05
+ */
+@RequiredArgsConstructor
Review Comment:
The same above
##########
seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/sink/IcebergSink.java:
##########
@@ -0,0 +1,118 @@
+package org.apache.seatunnel.connectors.seatunnel.iceberg.sink;
+
+import com.google.auto.service.AutoService;
+import lombok.SneakyThrows;
+import org.apache.iceberg.Schema;
+import org.apache.iceberg.types.Types;
+import org.apache.seatunnel.api.common.PrepareFailException;
+import org.apache.seatunnel.api.sink.SeaTunnelSink;
+import org.apache.seatunnel.api.sink.SinkWriter;
+import org.apache.seatunnel.api.table.catalog.CatalogTableUtil;
+import org.apache.seatunnel.api.table.type.SeaTunnelDataType;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.api.table.type.SeaTunnelRowType;
+import org.apache.seatunnel.common.config.CheckConfigUtil;
+import org.apache.seatunnel.common.config.CheckResult;
+import org.apache.seatunnel.connectors.seatunnel.common.sink.AbstractSimpleSink;
+import org.apache.seatunnel.connectors.seatunnel.common.sink.AbstractSinkWriter;
+import org.apache.seatunnel.connectors.seatunnel.iceberg.IcebergTableLoader;
+import org.apache.seatunnel.connectors.seatunnel.iceberg.config.CommonConfig;
+import org.apache.seatunnel.connectors.seatunnel.iceberg.config.SinkConfig;
+import org.apache.seatunnel.connectors.seatunnel.iceberg.data.IcebergTypeMapper;
+import org.apache.seatunnel.connectors.seatunnel.iceberg.sink.writer.IcebergSinkWriter;
+import org.apache.seatunnel.shade.com.typesafe.config.Config;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import static com.google.common.base.Preconditions.checkArgument;
+
+/**
+ *
+ *
+ * @author mustard
+ * @version 1.0
+ * Create by 2023-07-05
+ */
Review Comment:
The same above
##########
seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/sink/IcebergSinkFactory.java:
##########
@@ -0,0 +1,46 @@
+package org.apache.seatunnel.connectors.seatunnel.iceberg.sink;
+
+import com.google.auto.service.AutoService;
+import org.apache.seatunnel.api.configuration.util.OptionRule;
+import org.apache.seatunnel.api.table.connector.TableSink;
+import org.apache.seatunnel.api.table.factory.Factory;
+import org.apache.seatunnel.api.table.factory.TableFactoryContext;
+import org.apache.seatunnel.api.table.factory.TableSinkFactory;
+import org.apache.seatunnel.connectors.seatunnel.iceberg.config.SinkConfig;
+
+/**
+ *
+ *
+ * @author mustard
+ * @version 1.0
+ * Create by 2023-07-05
+ */
Review Comment:
The same above
##########
seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/data/DataConverter.java:
##########
@@ -0,0 +1,19 @@
+package org.apache.seatunnel.connectors.seatunnel.iceberg.data;
+
+import org.apache.iceberg.data.Record;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+
+/**
+ *
+ *
+ * @author mustard
+ * @version 1.0
+ * Create by 2023-07-05
+ */
+public interface DataConverter {
Review Comment:
The same above
--
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][connector-v2][Iceberg] sink plugin [seatunnel]
Posted by "immustard (via GitHub)" <gi...@apache.org>.
immustard commented on PR #5072:
URL: https://github.com/apache/seatunnel/pull/5072#issuecomment-2167726948
您好,您的邮件已经收到。
--
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
[GitHub] [seatunnel] immustard commented on pull request #5072: [Feature][connector-v2][Iceberg] sink plugin
Posted by "immustard (via GitHub)" <gi...@apache.org>.
immustard commented on PR #5072:
URL: https://github.com/apache/seatunnel/pull/5072#issuecomment-1633695031
@hailin0 @EricJoy2048 PTAL
--
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
[GitHub] [seatunnel] liugddx commented on pull request #5072: [Feature][connector-v2][Iceberg] sink plugin
Posted by "liugddx (via GitHub)" <gi...@apache.org>.
liugddx commented on PR #5072:
URL: https://github.com/apache/seatunnel/pull/5072#issuecomment-1635199431
Run `mvn spotless:apply` before submitting 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