You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "HaoXuAI (via GitHub)" <gi...@apache.org> on 2023/08/24 03:03:40 UTC
[GitHub] [seatunnel] HaoXuAI opened a new pull request, #5367: [Feature] connector-amazonsqs
HaoXuAI opened a new pull request, #5367:
URL: https://github.com/apache/seatunnel/pull/5367
<!--
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.-->
Add new connector amazon sqs (https://aws.amazon.com/sqs/)
## Check list
* [ ] Code changed are covered with tests, or it does not need tests for reason:
* [ ] 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] [Connector-V2] Add connector amazonsqs [seatunnel]
Posted by "HaoXuAI (via GitHub)" <gi...@apache.org>.
HaoXuAI commented on PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#issuecomment-1770154709
> The test case seem like not passed. Could you fix it? Thanks.
@Hisoka-X the error is not clear to me: https://github.com/HaoXuAI/incubator-seatunnel/actions/runs/6570589755/job/17848343358, can you help to take a look of it. thanks!
--
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-amazonsqs [seatunnel]
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1349668522
##########
docs/en/connector-v2/source/AmazonSqs.md:
##########
@@ -0,0 +1,79 @@
+# AmazonSqs
+
+> AmazonSqs source connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [x] [stream](../../concept/connector-v2-features.md)
+- [ ] [exactly-once](../../concept/connector-v2-features.md)
+- [ ] [column projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+
+## Description
+
+Read data from Amazon SQS.
+
Review Comment:
Add type mapping as 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-amazonsqs [seatunnel]
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1351519798
##########
docs/en/connector-v2/sink/AmazonSqs.md:
##########
@@ -0,0 +1,46 @@
+# AmazonSqs
+
+> Amazon SQS sink connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Description
+
+Write data to Amazon SQS
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [x] [stream](../../concept/connector-v2-features.md)
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+- [ ] [column projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+
+## Options
+
+| Name | Type | Required | Default | Description |
+|-------------------------|--------|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| url | String | Yes | - | The Queue URL to read from Amazon SQS. |
+| region | String | No | - | The AWS region for the SQS service |
+| format | String | No | json | Data format. The default format is json. Optional text format, canal-json and debezium-json.If you use json or text format. The default field separator is ", ". If you customize the delimiter, add the "field_delimiter" option.If you use canal format, please refer to [canal-json](../formats/canal-json.md) for details.If you use debezium format, please refer to [debezium-json](../formats/debezium-json.md) for details. |
+| format_error_handle_way | String | No | fail | The processing method of data format error. The default value is fail, and the optional value is (fail, skip). When fail is selected, data format error will block and an exception will be thrown. When skip is selected, data format error will skip this line data. |
+| field_delimiter | String | No | , | Customize the field delimiter for data format. |
+
+## Task Example
+
+```bash
+amazonsqs {
+ url = "http://127.0.0.1:8000"
+ region = "us-east-1"
+ queue = "queueName"
+ format = text
+ field_delimiter = "|"
+
Review Comment:
Delete line feed
##########
docs/en/connector-v2/source/AmazonSqs.md:
##########
@@ -0,0 +1,81 @@
+# AmazonSqs
+
+> AmazonSqs source connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Key features
Review Comment:
Key Features
--
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] Add connector amazonsqs [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X merged PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367
--
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-amazonsqs [seatunnel]
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1351518223
##########
docs/en/connector-v2/sink/AmazonSqs.md:
##########
@@ -0,0 +1,46 @@
+# AmazonSqs
+
+> Amazon SQS sink connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Description
+
+Write data to Amazon SQS
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [x] [stream](../../concept/connector-v2-features.md)
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+- [ ] [column projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+
+## Options
Review Comment:
Sink Options
--
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-amazonsqs [seatunnel]
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#issuecomment-1754428939
I add a few small suggestions, others look good
@HaoXuAI
--
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-amazonsqs [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1361429988
##########
seatunnel-connectors-v2/connector-amazonsqs/src/main/java/org/apache/seatunnel/connectors/seatunnel/amazonsqs/sink/AmazonSqsSinkFactory.java:
##########
@@ -0,0 +1,40 @@
+/*
+ * 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.connectors.seatunnel.amazonsqs.sink;
+
+import org.apache.seatunnel.api.configuration.util.OptionRule;
+import org.apache.seatunnel.api.table.factory.Factory;
+import org.apache.seatunnel.api.table.factory.TableSinkFactory;
+
+import com.google.auto.service.AutoService;
+
+import static org.apache.seatunnel.connectors.seatunnel.amazonsqs.config.AmazonSqsConfig.REGION;
+import static org.apache.seatunnel.connectors.seatunnel.amazonsqs.config.AmazonSqsConfig.URL;
+
+@AutoService(Factory.class)
+public class AmazonSqsSinkFactory implements TableSinkFactory {
Review Comment:
Could you implement `TabkeSinkFactory::createSink` to create sink instance? We will remove `SeaTunnelSink::prepare` method in the future. You can refer `JdbcSinkFactory`
--
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-amazonsqs [seatunnel]
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1349668435
##########
docs/en/connector-v2/sink/AmazonSqs.md:
##########
@@ -0,0 +1,45 @@
+# AmazonSqs
+
+> Amazon SQS sink connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Description
+
+Write data to Amazon SQS
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [x] [stream](../../concept/connector-v2-features.md)
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+- [ ] [column projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+
+## Options
Review Comment:
amazonsqs and SeaTunnel type mapping We also want to tell users that it is best to reflect this in the documentation
--
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-amazonsqs [seatunnel]
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1349668336
##########
docs/en/connector-v2/sink/AmazonSqs.md:
##########
@@ -0,0 +1,45 @@
+# AmazonSqs
+
+> Amazon SQS sink connector
+
+## Support Those Engines
Review Comment:
Add titles for supported versions : `localstack/localstack:0.11.2` For user reference
--
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-amazonsqs [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1356558683
##########
seatunnel-connectors-v2/connector-amazonsqs/src/main/java/org/apache/seatunnel/connectors/seatunnel/amazonsqs/source/AmazonSqsSourceFactory.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.connectors.seatunnel.amazonsqs.source;
+
+import org.apache.seatunnel.api.configuration.util.OptionRule;
+import org.apache.seatunnel.api.source.SeaTunnelSource;
+import org.apache.seatunnel.api.table.catalog.CatalogTableUtil;
+import org.apache.seatunnel.api.table.factory.Factory;
+import org.apache.seatunnel.api.table.factory.TableSourceFactory;
+
+import com.google.auto.service.AutoService;
+
+import static org.apache.seatunnel.connectors.seatunnel.amazonsqs.config.AmazonSqsConfig.REGION;
+import static org.apache.seatunnel.connectors.seatunnel.amazonsqs.config.AmazonSqsConfig.URL;
+
+@AutoService(Factory.class)
+public class AmazonSqsSourceFactory implements TableSourceFactory {
+ @Override
+ public String factoryIdentifier() {
+ return "AmazonSqs";
+ }
+
+ @Override
+ public OptionRule optionRule() {
+ return OptionRule.builder().required(URL, REGION, CatalogTableUtil.SCHEMA).build();
Review Comment:
Please rebase from dev, I believe this field already move to `TableSchemaOptions`
##########
seatunnel-connectors-v2/connector-amazonsqs/src/main/java/org/apache/seatunnel/connectors/seatunnel/amazonsqs/config/AmazonSqsConfig.java:
##########
@@ -0,0 +1,84 @@
+/*
+ * 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.connectors.seatunnel.amazonsqs.config;
+
+import org.apache.seatunnel.api.configuration.Option;
+import org.apache.seatunnel.api.configuration.Options;
+
+import java.io.Serializable;
+
+public class AmazonSqsConfig implements Serializable {
+
+ public static final String DEFAULT_FIELD_DELIMITER = ",";
+
+ public static final Option<String> URL =
+ Options.key("url")
+ .stringType()
+ .noDefaultValue()
+ .withDescription("url to read to Amazon SQS Service");
+ public static final Option<String> REGION =
+ Options.key("region")
+ .stringType()
+ .noDefaultValue()
+ .withDescription("The region of Amazon SQS Service");
+ public static final Option<String> ACCESS_KEY_ID =
+ Options.key("access_key_id")
+ .stringType()
+ .noDefaultValue()
+ .withDescription("The access id of Amazon SQS Service");
+ public static final Option<String> SECRET_ACCESS_KEY =
+ Options.key("secret_access_key")
+ .stringType()
+ .noDefaultValue()
+ .withDescription("The access secret key of Amazon SQS Service");
+
+ public static final Option<String> MESSAGE_GROUP_ID =
+ Options.key("message_group_id")
+ .stringType()
+ .noDefaultValue()
+ .withDescription("The message group id of Amazon SQS Service");
+ public static final Option<String> SCHEMA =
Review Comment:
Please reuse `TableSchemaOptions.SCHEMA`, do not create new `schema` option.
--
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-amazonsqs [seatunnel]
Posted by "HaoXuAI (via GitHub)" <gi...@apache.org>.
HaoXuAI commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1361554944
##########
seatunnel-connectors-v2/connector-amazonsqs/src/main/java/org/apache/seatunnel/connectors/seatunnel/amazonsqs/sink/AmazonSqsSinkFactory.java:
##########
@@ -0,0 +1,40 @@
+/*
+ * 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.connectors.seatunnel.amazonsqs.sink;
+
+import org.apache.seatunnel.api.configuration.util.OptionRule;
+import org.apache.seatunnel.api.table.factory.Factory;
+import org.apache.seatunnel.api.table.factory.TableSinkFactory;
+
+import com.google.auto.service.AutoService;
+
+import static org.apache.seatunnel.connectors.seatunnel.amazonsqs.config.AmazonSqsConfig.REGION;
+import static org.apache.seatunnel.connectors.seatunnel.amazonsqs.config.AmazonSqsConfig.URL;
+
+@AutoService(Factory.class)
+public class AmazonSqsSinkFactory implements TableSinkFactory {
Review Comment:
@Hisoka-X sounds good and updated. thanks
--
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-amazonsqs [seatunnel]
Posted by "HaoXuAI (via GitHub)" <gi...@apache.org>.
HaoXuAI commented on PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#issuecomment-1754369272
@zhilinli123 updated the doc, let me know if you have other 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-amazonsqs [seatunnel]
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1351518397
##########
docs/en/connector-v2/sink/AmazonSqs.md:
##########
@@ -0,0 +1,46 @@
+# AmazonSqs
+
+> Amazon SQS sink connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Description
+
+Write data to Amazon SQS
+
+## Key features
Review Comment:
## Key Features
--
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-amazonsqs [seatunnel]
Posted by "HaoXuAI (via GitHub)" <gi...@apache.org>.
HaoXuAI commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1357850686
##########
seatunnel-connectors-v2/connector-amazonsqs/src/main/java/org/apache/seatunnel/connectors/seatunnel/amazonsqs/config/AmazonSqsConfig.java:
##########
@@ -0,0 +1,84 @@
+/*
+ * 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.connectors.seatunnel.amazonsqs.config;
+
+import org.apache.seatunnel.api.configuration.Option;
+import org.apache.seatunnel.api.configuration.Options;
+
+import java.io.Serializable;
+
+public class AmazonSqsConfig implements Serializable {
+
+ public static final String DEFAULT_FIELD_DELIMITER = ",";
+
+ public static final Option<String> URL =
+ Options.key("url")
+ .stringType()
+ .noDefaultValue()
+ .withDescription("url to read to Amazon SQS Service");
+ public static final Option<String> REGION =
+ Options.key("region")
+ .stringType()
+ .noDefaultValue()
+ .withDescription("The region of Amazon SQS Service");
+ public static final Option<String> ACCESS_KEY_ID =
+ Options.key("access_key_id")
+ .stringType()
+ .noDefaultValue()
+ .withDescription("The access id of Amazon SQS Service");
+ public static final Option<String> SECRET_ACCESS_KEY =
+ Options.key("secret_access_key")
+ .stringType()
+ .noDefaultValue()
+ .withDescription("The access secret key of Amazon SQS Service");
+
+ public static final Option<String> MESSAGE_GROUP_ID =
+ Options.key("message_group_id")
+ .stringType()
+ .noDefaultValue()
+ .withDescription("The message group id of Amazon SQS Service");
+ public static final Option<String> SCHEMA =
Review Comment:
updated. thanks!
--
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-amazonsqs [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#issuecomment-1765815580
The test case seem like not passed. Could you fix it? Thanks.
--
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-amazonsqs [seatunnel]
Posted by "HaoXuAI (via GitHub)" <gi...@apache.org>.
HaoXuAI commented on PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#issuecomment-1754485427
> I add a few small suggestions, others look good @HaoXuAI
Thanks! Updated.
--
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-amazonsqs [seatunnel]
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1349668108
##########
docs/en/connector-v2/sink/AmazonSqs.md:
##########
@@ -0,0 +1,45 @@
+# AmazonSqs
+
+> Amazon SQS sink connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Description
+
+Write data to Amazon SQS
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [x] [stream](../../concept/connector-v2-features.md)
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+- [ ] [column projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+
+## Options
+
+| Name | Type | Required | Default | Description |
+|-------------------------|--------|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| url | String | Yes | - | The Queue URL to read from Amazon SQS. |
+| region | String | No | - | The AWS region for the SQS service |
+| format | String | No | json | Data format. The default format is json. Optional text format, canal-json and debezium-json.If you use json or text format. The default field separator is ", ". If you customize the delimiter, add the "field_delimiter" option.If you use canal format, please refer to [canal-json](../formats/canal-json.md) for details.If you use debezium format, please refer to [debezium-json](../formats/debezium-json.md) for details. |
+| format_error_handle_way | String | No | fail | The processing method of data format error. The default value is fail, and the optional value is (fail, skip). When fail is selected, data format error will block and an exception will be thrown. When skip is selected, data format error will skip this line data. |
+| field_delimiter | String | No | , | Customize the field delimiter for data format. |
+| common-options | | No | - | Source plugin common parameters, please refer to [Source Common Options](common-options.md) for details |
+
+## Example
Review Comment:
Example-> Task Example
--
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-amazonsqs [seatunnel]
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1351519798
##########
docs/en/connector-v2/sink/AmazonSqs.md:
##########
@@ -0,0 +1,46 @@
+# AmazonSqs
+
+> Amazon SQS sink connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Description
+
+Write data to Amazon SQS
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [x] [stream](../../concept/connector-v2-features.md)
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+- [ ] [column projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+
+## Options
+
+| Name | Type | Required | Default | Description |
+|-------------------------|--------|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| url | String | Yes | - | The Queue URL to read from Amazon SQS. |
+| region | String | No | - | The AWS region for the SQS service |
+| format | String | No | json | Data format. The default format is json. Optional text format, canal-json and debezium-json.If you use json or text format. The default field separator is ", ". If you customize the delimiter, add the "field_delimiter" option.If you use canal format, please refer to [canal-json](../formats/canal-json.md) for details.If you use debezium format, please refer to [debezium-json](../formats/debezium-json.md) for details. |
+| format_error_handle_way | String | No | fail | The processing method of data format error. The default value is fail, and the optional value is (fail, skip). When fail is selected, data format error will block and an exception will be thrown. When skip is selected, data format error will skip this line data. |
+| field_delimiter | String | No | , | Customize the field delimiter for data format. |
+
+## Task Example
+
+```bash
+amazonsqs {
+ url = "http://127.0.0.1:8000"
+ region = "us-east-1"
+ queue = "queueName"
+ format = text
+ field_delimiter = "|"
+
Review Comment:
1.Delete line feed
2.add Source case
```
source {
FakeSource {
schema = {
fields {
c_map = "map<string, string>"
c_array = "array<int>"
c_string = string
c_boolean = boolean
c_tinyint = tinyint
c_smallint = smallint
c_int = int
c_bigint = bigint
c_float = float
c_double = double
c_bytes = bytes
c_date = date
c_decimal = "decimal(38, 18)"
c_timestamp = timestamp
c_row = {
c_map = "map<string, string>"
c_array = "array<int>"
c_string = string
c_boolean = boolean
c_tinyint = tinyint
c_smallint = smallint
c_int = int
c_bigint = bigint
c_float = float
c_double = double
c_bytes = bytes
c_date = date
c_decimal = "decimal(38, 18)"
c_timestamp = timestamp
}
}
}
result_table_name = "fake"
}
}
```
--
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] zhilinli123 commented on pull request #5367: [Feature] connector-amazonsqs
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#issuecomment-1698688530
HI @HaoXuAI At present, we use the V2.0 template design of Connector Doc for your reference,You may need to make some improvements to the documentation. Thank you
https://github.com/apache/seatunnel/blob/dev/docs/en/connector-v2/source/Mysql.md
issues:https://github.com/apache/seatunnel/issues/4572
--
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-amazonsqs [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1361429988
##########
seatunnel-connectors-v2/connector-amazonsqs/src/main/java/org/apache/seatunnel/connectors/seatunnel/amazonsqs/sink/AmazonSqsSinkFactory.java:
##########
@@ -0,0 +1,40 @@
+/*
+ * 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.connectors.seatunnel.amazonsqs.sink;
+
+import org.apache.seatunnel.api.configuration.util.OptionRule;
+import org.apache.seatunnel.api.table.factory.Factory;
+import org.apache.seatunnel.api.table.factory.TableSinkFactory;
+
+import com.google.auto.service.AutoService;
+
+import static org.apache.seatunnel.connectors.seatunnel.amazonsqs.config.AmazonSqsConfig.REGION;
+import static org.apache.seatunnel.connectors.seatunnel.amazonsqs.config.AmazonSqsConfig.URL;
+
+@AutoService(Factory.class)
+public class AmazonSqsSinkFactory implements TableSinkFactory {
Review Comment:
Could you implement `TabkeSinkFactory::createSink` to create sink instance? We will remove `SeaTunnelSink::prepare` method in the future. You can refer `JdbcSinkFactory`. Please.
--
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-amazonsqs [seatunnel]
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1349668071
##########
docs/en/connector-v2/sink/AmazonSqs.md:
##########
@@ -0,0 +1,45 @@
+# AmazonSqs
+
+> Amazon SQS sink connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Description
+
+Write data to Amazon SQS
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [x] [stream](../../concept/connector-v2-features.md)
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+- [ ] [column projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+
+## Options
+
+| Name | Type | Required | Default | Description |
+|-------------------------|--------|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| url | String | Yes | - | The Queue URL to read from Amazon SQS. |
+| region | String | No | - | The AWS region for the SQS service |
+| format | String | No | json | Data format. The default format is json. Optional text format, canal-json and debezium-json.If you use json or text format. The default field separator is ", ". If you customize the delimiter, add the "field_delimiter" option.If you use canal format, please refer to [canal-json](../formats/canal-json.md) for details.If you use debezium format, please refer to [debezium-json](../formats/debezium-json.md) for details. |
+| format_error_handle_way | String | No | fail | The processing method of data format error. The default value is fail, and the optional value is (fail, skip). When fail is selected, data format error will block and an exception will be thrown. When skip is selected, data format error will skip this line data. |
+| field_delimiter | String | No | , | Customize the field delimiter for data format. |
+| common-options | | No | - | Source plugin common parameters, please refer to [Source Common Options](common-options.md) for details |
+
+## Example
+
+```bash
+amazonsqs {
+ url = "http://127.0.0.1:8000"
+ region = "us-east-1"
+ queue = "queueName"
+ format = json
+ }
+```
+
Review Comment:
Full case conf
##########
docs/en/connector-v2/sink/AmazonSqs.md:
##########
@@ -0,0 +1,45 @@
+# AmazonSqs
+
+> Amazon SQS sink connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Description
+
+Write data to Amazon SQS
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [x] [stream](../../concept/connector-v2-features.md)
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+- [ ] [column projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+
+## Options
+
+| Name | Type | Required | Default | Description |
+|-------------------------|--------|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| url | String | Yes | - | The Queue URL to read from Amazon SQS. |
+| region | String | No | - | The AWS region for the SQS service |
+| format | String | No | json | Data format. The default format is json. Optional text format, canal-json and debezium-json.If you use json or text format. The default field separator is ", ". If you customize the delimiter, add the "field_delimiter" option.If you use canal format, please refer to [canal-json](../formats/canal-json.md) for details.If you use debezium format, please refer to [debezium-json](../formats/debezium-json.md) for details. |
+| format_error_handle_way | String | No | fail | The processing method of data format error. The default value is fail, and the optional value is (fail, skip). When fail is selected, data format error will block and an exception will be thrown. When skip is selected, data format error will skip this line data. |
+| field_delimiter | String | No | , | Customize the field delimiter for data format. |
+| common-options | | No | - | Source plugin common parameters, please refer to [Source Common Options](common-options.md) for details |
+
+## Example
Review Comment:
## Task Example
--
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-amazonsqs [seatunnel]
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1349667555
##########
docs/en/connector-v2/source/AmazonSqs.md:
##########
@@ -0,0 +1,79 @@
+# AmazonSqs
+
+> AmazonSqs source connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [x] [stream](../../concept/connector-v2-features.md)
+- [ ] [exactly-once](../../concept/connector-v2-features.md)
+- [ ] [column projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+
+## Description
+
+Read data from Amazon SQS.
+
+## Source Options
+
+| Name | Type | Required | Default | Description |
+|-------------------------|--------|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| url | String | Yes | - | The Queue URL to read from Amazon SQS. |
+| region | String | No | - | The AWS region for the SQS service |
+| schema | Config | No | - | The structure of the data, including field names and field types. |
+| format | String | No | json | Data format. The default format is json. Optional text format, canal-json and debezium-json.If you use json or text format. The default field separator is ", ". If you customize the delimiter, add the "field_delimiter" option.If you use canal format, please refer to [canal-json](../formats/canal-json.md) for details.If you use debezium format, please refer to [debezium-json](../formats/debezium-json.md) for details. |
+| format_error_handle_way | String | No | fail | The processing method of data format error. The default value is fail, and the optional value is (fail, skip). When fail is selected, data format error will block and an exception will be thrown. When skip is selected, data format error will skip this line data. |
+| field_delimiter | String | No | , | Customize the field delimiter for data format. |
+| common-options | | No | - | Source plugin common parameters, please refer to [Source Common Options](common-options.md) for details |
+
+## Task Example
+
+```bash
+source {
+ amazonsqs {
+ url = "http://127.0.0.1:4566"
+ region = "us-east-1"
+ schema = {
+ fields {
+ artist = string
+ c_map = "map<string, array<int>>"
+ c_array = "array<int>"
+ c_string = string
+ c_boolean = boolean
+ c_tinyint = tinyint
+ c_smallint = smallint
+ c_int = int
+ c_bigint = bigint
+ c_float = float
+ c_double = double
+ c_decimal = "decimal(30, 8)"
+ c_null = "null"
+ c_bytes = bytes
+ c_date = date
+ c_timestamp = timestamp
+ }
+ }
+ }
+}
+
+transform {
+ # If you would like to get more information about how to configure seatunnel and see full list of transform plugins,
+ # please go to https://seatunnel.apache.org/docs/transform-v2/sql
+}
+
+sink {
+ Console {}
+}
Review Comment:
I think this demo should be written to amazonsqs as an example
--
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] Add connector amazonsqs [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#issuecomment-1770160456
I believe the error came from init method
```
Caused by: org.apache.seatunnel.common.utils.SeaTunnelException: java.lang.NullPointerException
at org.apache.seatunnel.connectors.seatunnel.amazonsqs.sink.AmazonSqsSinkWriter.<init>(AmazonSqsSinkWriter.java:61)
at org.apache.seatunnel.connectors.seatunnel.amazonsqs.sink.AmazonSqsSink.createWriter(AmazonSqsSink.java:90)
at org.apache.seatunnel.connectors.seatunnel.amazonsqs.sink.AmazonSqsSink.createWriter(AmazonSqsSink.java:46)
at org.apache.seatunnel.engine.server.task.flow.SinkFlowLifeCycle.restoreState(SinkFlowLifeCycle.java:286)
at org.apache.seatunnel.engine.server.task.SeaTunnelTask.lambda$restoreState$15(SeaTunnelTask.java:419)
```
--
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-amazonsqs [seatunnel]
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#issuecomment-1754489755
wait CI good
> > I add a few small suggestions, others look good @HaoXuAI
>
> Thanks! Updated.
wait ci looks good
--
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-amazonsqs [seatunnel]
Posted by "HaoXuAI (via GitHub)" <gi...@apache.org>.
HaoXuAI commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1351443851
##########
docs/en/connector-v2/sink/AmazonSqs.md:
##########
@@ -0,0 +1,45 @@
+# AmazonSqs
+
+> Amazon SQS sink connector
+
+## Support Those Engines
Review Comment:
localstack is not a engine but only used for testing purpose.
--
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-amazonsqs [seatunnel]
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1349668522
##########
docs/en/connector-v2/source/AmazonSqs.md:
##########
@@ -0,0 +1,79 @@
+# AmazonSqs
+
+> AmazonSqs source connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [x] [stream](../../concept/connector-v2-features.md)
+- [ ] [exactly-once](../../concept/connector-v2-features.md)
+- [ ] [column projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+
+## Description
+
+Read data from Amazon SQS.
+
Review Comment:
Add type mapping as above
##########
docs/en/connector-v2/source/AmazonSqs.md:
##########
@@ -0,0 +1,79 @@
+# AmazonSqs
+
+> AmazonSqs source connector
+
Review Comment:
Add a supported version as 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-amazonsqs [seatunnel]
Posted by "HaoXuAI (via GitHub)" <gi...@apache.org>.
HaoXuAI commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1361554944
##########
seatunnel-connectors-v2/connector-amazonsqs/src/main/java/org/apache/seatunnel/connectors/seatunnel/amazonsqs/sink/AmazonSqsSinkFactory.java:
##########
@@ -0,0 +1,40 @@
+/*
+ * 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.connectors.seatunnel.amazonsqs.sink;
+
+import org.apache.seatunnel.api.configuration.util.OptionRule;
+import org.apache.seatunnel.api.table.factory.Factory;
+import org.apache.seatunnel.api.table.factory.TableSinkFactory;
+
+import com.google.auto.service.AutoService;
+
+import static org.apache.seatunnel.connectors.seatunnel.amazonsqs.config.AmazonSqsConfig.REGION;
+import static org.apache.seatunnel.connectors.seatunnel.amazonsqs.config.AmazonSqsConfig.URL;
+
+@AutoService(Factory.class)
+public class AmazonSqsSinkFactory implements TableSinkFactory {
Review Comment:
sounds good and updated. thanks
--
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] zhilinli123 commented on a diff in pull request #5367: [Feature] connector-amazonsqs
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1306331568
##########
.gitignore:
##########
@@ -48,4 +48,7 @@ test.conf
spark-warehouse
*.flattened-pom.xml
-seatunnel-examples
\ No newline at end of file
+seatunnel-examples
+
+# vscode
+.vscode
Review Comment:
Why add it?
##########
.gitignore:
##########
@@ -48,4 +48,7 @@ test.conf
spark-warehouse
*.flattened-pom.xml
-seatunnel-examples
\ No newline at end of file
+seatunnel-examples
+
+# vscode
+.vscode
Review Comment:
Why 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
[GitHub] [seatunnel] HaoXuAI commented on pull request #5367: [Feature] connector-amazonsqs
Posted by "HaoXuAI (via GitHub)" <gi...@apache.org>.
HaoXuAI commented on PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#issuecomment-1691119878
> Please add e2e test.
I'm working on it. Unfortunately, SQS doesn't have a local service to test. My team use https://localstack.cloud/ to mock the service. Is it ok with you to leverage it in ST too? @liugddx
--
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 #5367: [Feature] connector-amazonsqs
Posted by "liugddx (via GitHub)" <gi...@apache.org>.
liugddx commented on PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#issuecomment-1691046203
Please add e2e test.
--
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-amazonsqs [seatunnel]
Posted by "HaoXuAI (via GitHub)" <gi...@apache.org>.
HaoXuAI commented on PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#issuecomment-1743911836
> > > Please add e2e test.
> >
> >
> > I'm working on it. Unfortunately, SQS doesn't have a local service to test. My team use https://localstack.cloud/ to mock the service. Is it ok with you to leverage it in ST too? @liugddx
>
> You can write e2e and Add @disabled annotation.
I have added the e2e test and it passed.
--
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-amazonsqs [seatunnel]
Posted by "HaoXuAI (via GitHub)" <gi...@apache.org>.
HaoXuAI commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1351443699
##########
docs/en/connector-v2/sink/AmazonSqs.md:
##########
@@ -0,0 +1,45 @@
+# AmazonSqs
+
+> Amazon SQS sink connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Description
+
+Write data to Amazon SQS
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [x] [stream](../../concept/connector-v2-features.md)
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+- [ ] [column projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+
+## Options
Review Comment:
the sqs is using message ( json/text) doesn't have a type, so we don't need type mapping i believe
--
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-amazonsqs [seatunnel]
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1349668336
##########
docs/en/connector-v2/sink/AmazonSqs.md:
##########
@@ -0,0 +1,45 @@
+# AmazonSqs
+
+> Amazon SQS sink connector
+
+## Support Those Engines
Review Comment:
Add titles for supported versions : `localstack/localstack:0.11.2`
--
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-amazonsqs [seatunnel]
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1349667555
##########
docs/en/connector-v2/source/AmazonSqs.md:
##########
@@ -0,0 +1,79 @@
+# AmazonSqs
+
+> AmazonSqs source connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [x] [stream](../../concept/connector-v2-features.md)
+- [ ] [exactly-once](../../concept/connector-v2-features.md)
+- [ ] [column projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+
+## Description
+
+Read data from Amazon SQS.
+
+## Source Options
+
+| Name | Type | Required | Default | Description |
+|-------------------------|--------|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| url | String | Yes | - | The Queue URL to read from Amazon SQS. |
+| region | String | No | - | The AWS region for the SQS service |
+| schema | Config | No | - | The structure of the data, including field names and field types. |
+| format | String | No | json | Data format. The default format is json. Optional text format, canal-json and debezium-json.If you use json or text format. The default field separator is ", ". If you customize the delimiter, add the "field_delimiter" option.If you use canal format, please refer to [canal-json](../formats/canal-json.md) for details.If you use debezium format, please refer to [debezium-json](../formats/debezium-json.md) for details. |
+| format_error_handle_way | String | No | fail | The processing method of data format error. The default value is fail, and the optional value is (fail, skip). When fail is selected, data format error will block and an exception will be thrown. When skip is selected, data format error will skip this line data. |
+| field_delimiter | String | No | , | Customize the field delimiter for data format. |
+| common-options | | No | - | Source plugin common parameters, please refer to [Source Common Options](common-options.md) for details |
+
+## Task Example
+
+```bash
+source {
+ amazonsqs {
+ url = "http://127.0.0.1:4566"
+ region = "us-east-1"
+ schema = {
+ fields {
+ artist = string
+ c_map = "map<string, array<int>>"
+ c_array = "array<int>"
+ c_string = string
+ c_boolean = boolean
+ c_tinyint = tinyint
+ c_smallint = smallint
+ c_int = int
+ c_bigint = bigint
+ c_float = float
+ c_double = double
+ c_decimal = "decimal(30, 8)"
+ c_null = "null"
+ c_bytes = bytes
+ c_date = date
+ c_timestamp = timestamp
+ }
+ }
+ }
+}
+
+transform {
+ # If you would like to get more information about how to configure seatunnel and see full list of transform plugins,
+ # please go to https://seatunnel.apache.org/docs/transform-v2/sql
+}
+
+sink {
+ Console {}
+}
Review Comment:
I think this demo should be written to amazonsqs as an example
--
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-amazonsqs [seatunnel]
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1349667966
##########
docs/en/connector-v2/source/AmazonSqs.md:
##########
@@ -0,0 +1,79 @@
+# AmazonSqs
+
+> AmazonSqs source connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [x] [stream](../../concept/connector-v2-features.md)
+- [ ] [exactly-once](../../concept/connector-v2-features.md)
+- [ ] [column projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+
+## Description
+
+Read data from Amazon SQS.
+
+## Source Options
+
+| Name | Type | Required | Default | Description |
+|-------------------------|--------|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| url | String | Yes | - | The Queue URL to read from Amazon SQS. |
+| region | String | No | - | The AWS region for the SQS service |
+| schema | Config | No | - | The structure of the data, including field names and field types. |
+| format | String | No | json | Data format. The default format is json. Optional text format, canal-json and debezium-json.If you use json or text format. The default field separator is ", ". If you customize the delimiter, add the "field_delimiter" option.If you use canal format, please refer to [canal-json](../formats/canal-json.md) for details.If you use debezium format, please refer to [debezium-json](../formats/debezium-json.md) for details. |
+| format_error_handle_way | String | No | fail | The processing method of data format error. The default value is fail, and the optional value is (fail, skip). When fail is selected, data format error will block and an exception will be thrown. When skip is selected, data format error will skip this line data. |
+| field_delimiter | String | No | , | Customize the field delimiter for data format. |
+| common-options | | No | - | Source plugin common parameters, please refer to [Source Common Options](common-options.md) for details |
+
+## Task Example
+
+```bash
+source {
Review Comment:
Add a format source demo?
--
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-amazonsqs [seatunnel]
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1349668435
##########
docs/en/connector-v2/sink/AmazonSqs.md:
##########
@@ -0,0 +1,45 @@
+# AmazonSqs
+
+> Amazon SQS sink connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Description
+
+Write data to Amazon SQS
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [x] [stream](../../concept/connector-v2-features.md)
+- [x] [exactly-once](../../concept/connector-v2-features.md)
+- [ ] [column projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+
+## Options
Review Comment:
amazonsqs and SeaTunnel type mapping We also want to tell users that it is best to reflect this in the documentation source&sink doc
##########
docs/en/connector-v2/sink/AmazonSqs.md:
##########
@@ -0,0 +1,45 @@
+# AmazonSqs
+
+> Amazon SQS sink connector
+
+## Support Those Engines
Review Comment:
Add titles for supported versions : `localstack/localstack:0.11.2` For user reference source&sink doc
--
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-amazonsqs [seatunnel]
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1349668493
##########
docs/en/connector-v2/source/AmazonSqs.md:
##########
@@ -0,0 +1,79 @@
+# AmazonSqs
+
+> AmazonSqs source connector
+
Review Comment:
Add a supported version as 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
[GitHub] [seatunnel] liugddx commented on pull request #5367: [Feature] connector-amazonsqs
Posted by "liugddx (via GitHub)" <gi...@apache.org>.
liugddx commented on PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#issuecomment-1691134465
> > Please add e2e test.
>
> I'm working on it. Unfortunately, SQS doesn't have a local service to test. My team use https://localstack.cloud/ to mock the service. Is it ok with you to leverage it in ST too? @liugddx
You can write e2e and Add @disabled annotation.
--
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] zhilinli123 commented on a diff in pull request #5367: [Feature] connector-amazonsqs
Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1306331568
##########
.gitignore:
##########
@@ -48,4 +48,7 @@ test.conf
spark-warehouse
*.flattened-pom.xml
-seatunnel-examples
\ No newline at end of file
+seatunnel-examples
+
+# vscode
+.vscode
Review Comment:
Why 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
[GitHub] [seatunnel] HaoXuAI commented on a diff in pull request #5367: [Feature] connector-amazonsqs
Posted by "HaoXuAI (via GitHub)" <gi...@apache.org>.
HaoXuAI commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1306744311
##########
.gitignore:
##########
@@ -48,4 +48,7 @@ test.conf
spark-warehouse
*.flattened-pom.xml
-seatunnel-examples
\ No newline at end of file
+seatunnel-examples
+
+# vscode
+.vscode
Review Comment:
to avoid uploading my own vscode settings.
--
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] HaoXuAI commented on a diff in pull request #5367: [Feature] connector-amazonsqs
Posted by "HaoXuAI (via GitHub)" <gi...@apache.org>.
HaoXuAI commented on code in PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#discussion_r1306744311
##########
.gitignore:
##########
@@ -48,4 +48,7 @@ test.conf
spark-warehouse
*.flattened-pom.xml
-seatunnel-examples
\ No newline at end of file
+seatunnel-examples
+
+# vscode
+.vscode
Review Comment:
to avoid uploading the my own vscode settings.
--
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-amazonsqs [seatunnel]
Posted by "HaoXuAI (via GitHub)" <gi...@apache.org>.
HaoXuAI commented on PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#issuecomment-1743906552
> HI @HaoXuAI At present, we use the V2.0 template design of Connector Doc for your reference,You may need to make some improvements to the documentation. Thank you https://github.com/apache/seatunnel/blob/dev/docs/en/connector-v2/source/Mysql.md issues:#4572 CC @liugddx
thanks. I have updated the docs.
--
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] Add connector amazonsqs [seatunnel]
Posted by "HaoXuAI (via GitHub)" <gi...@apache.org>.
HaoXuAI commented on PR #5367:
URL: https://github.com/apache/seatunnel/pull/5367#issuecomment-1778193700
> I believe the error came from constructor
>
> ```
> Caused by: org.apache.seatunnel.common.utils.SeaTunnelException: java.lang.NullPointerException
> at org.apache.seatunnel.connectors.seatunnel.amazonsqs.sink.AmazonSqsSinkWriter.<init>(AmazonSqsSinkWriter.java:61)
> at org.apache.seatunnel.connectors.seatunnel.amazonsqs.sink.AmazonSqsSink.createWriter(AmazonSqsSink.java:90)
> at org.apache.seatunnel.connectors.seatunnel.amazonsqs.sink.AmazonSqsSink.createWriter(AmazonSqsSink.java:46)
> at org.apache.seatunnel.engine.server.task.flow.SinkFlowLifeCycle.restoreState(SinkFlowLifeCycle.java:286)
> at org.apache.seatunnel.engine.server.task.SeaTunnelTask.lambda$restoreState$15(SeaTunnelTask.java:419)
> ```
@Hisoka-X thanks, I've fixed the issue.
btw looks like the `seatunnel-example` won't use the `sinkfactory` to create sink, so that's not able to test via just the java example 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