You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "zhangqs0205 (via GitHub)" <gi...@apache.org> on 2025/06/12 08:01:15 UTC

[PR] [Feature][connector-v2] Add Sensorsdata Connector Support #9323 [seatunnel]

zhangqs0205 opened a new pull request, #9432:
URL: https://github.com/apache/seatunnel/pull/9432

   <!--
   
   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 [plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it
     2. Update the pom file of [seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml)
     3. Add ci label in [label-scope-conf](https://github.com/apache/seatunnel/blob/dev/.github/workflows/labeler/label-scope-conf.yml)
     4. Add e2e testcase in [seatunnel-e2e](https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/)
     5. Update connector [plugin_config](https://github.com/apache/seatunnel/blob/dev/config/plugin_config)


-- 
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 Sensorsdata Connector Support #9323 [seatunnel]

Posted by "zhangqs0205 (via GitHub)" <gi...@apache.org>.
zhangqs0205 commented on PR #9432:
URL: https://github.com/apache/seatunnel/pull/9432#issuecomment-2969346445

   I have a question and would appreciate your advice:
   As seen in this PR, two modules are submitted:
   
   seatunnel-connector-v2/connector-sensorsdata
   seatunnel-format/seatunnel-format-sensorsdata
   Here, connector-sensorsdata depends on seatunnel-format-sensorsdata.
   
   Our scenario is:
   On our private branch, besides connector-sensorsdata, we have several transform modules. We extracted common dependencies for these modules into seatunnel-format-sensorsdata.
   
   For the code submitted to the community, since seatunnel-format-sensorsdata is only used by connector-sensorsdata, it seems more reasonable to consolidate them into a single module. However, if we do this, each transform module in our private branch would need to duplicate these base classes, which isn’t practical.
   
   My questions are:
   
   Should we submit seatunnel-format-sensorsdata as an independent module to the community?
   If it shouldn’t be a separate module, do you have any suggestions?
   One idea I have:
   Release seatunnel-format-sensorsdata as a separate Maven Central artifact.
   But this artifact would be specifically for Seatunnel since it depends on seatunnel-api.
   
   @zhilinli123 


-- 
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 Sensorsdata Connector Support #9323 [seatunnel]

Posted by "zhangqs0205 (via GitHub)" <gi...@apache.org>.
zhangqs0205 commented on PR #9432:
URL: https://github.com/apache/seatunnel/pull/9432#issuecomment-2998547554

   > Please move the code of `seatunnel-format-sensorsdata` to `connector-sensorsdata`
   
   Indeed, based on the currently submitted code, moving `seatunnel-format-sensorsdata` into `connector-sensorsdata` appears to be correct.
   
   However, in our internal branch, several other transforms also depend on `seatunnel-format-sensorsdata`. As a common dependency, keeping it as a separate module would be easier to maintain.
   
   If we move it, merging new community code into our internal branch in the future might become more difficult. Do you have any good suggestions?


-- 
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 Sensorsdata Connector Support #9323 [seatunnel]

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #9432:
URL: https://github.com/apache/seatunnel/pull/9432#issuecomment-3032003336

   wating test case 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-v2] Add Sensorsdata Connector Support #9323 [seatunnel]

Posted by "zhangqs0205 (via GitHub)" <gi...@apache.org>.
zhangqs0205 commented on PR #9432:
URL: https://github.com/apache/seatunnel/pull/9432#issuecomment-3026905486

   > > > Please move the code of `seatunnel-format-sensorsdata` to `connector-sensorsdata`
   > > 
   > > 
   > > Indeed, based on the currently submitted code, moving `seatunnel-format-sensorsdata` into `connector-sensorsdata` appears to be correct.
   > > However, in our internal branch, several other transforms also depend on `seatunnel-format-sensorsdata`. As a common dependency, keeping it as a separate module would be easier to maintain.
   > > If we move it, merging new community code into our internal branch in the future might become more difficult. Do you have any good suggestions?
   > > @Hisoka-X
   > 
   > You can add the dependency `connector-sensorsdata` to your own transform module pom.
   
   Moved


-- 
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 Sensorsdata Connector Support #9323 [seatunnel]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #9432:
URL: https://github.com/apache/seatunnel/pull/9432#discussion_r2144048680


##########
seatunnel-connectors-v2/connector-sensorsdata/src/main/java/org/apache/seatunnel/connectors/seatunnel/sensorsdata/sdk/sink/SensorsDataSDKWriter.java:
##########
@@ -0,0 +1,200 @@
+/*
+ * 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.sensorsdata.sdk.sink;
+
+import org.apache.seatunnel.api.sink.SinkWriter;
+import org.apache.seatunnel.api.sink.SupportMultiTableSinkWriter;
+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.utils.JsonUtils;
+import org.apache.seatunnel.connectors.seatunnel.sensorsdata.sdk.config.SensorsDataSDKSinkConfig;
+import org.apache.seatunnel.connectors.seatunnel.sensorsdata.sdk.exception.SensorsDataConnectorErrorCode;
+import org.apache.seatunnel.connectors.seatunnel.sensorsdata.sdk.exception.SensorsDataConnectorException;
+import org.apache.seatunnel.connectors.seatunnel.sensorsdata.sdk.state.SensorsDataCommitInfo;
+import org.apache.seatunnel.connectors.seatunnel.sensorsdata.sdk.state.SensorsDataSinkState;
+import org.apache.seatunnel.format.sensorsdata.config.TargetColumnConfig;
+import org.apache.seatunnel.format.sensorsdata.record.RowAccessor;
+import org.apache.seatunnel.format.sensorsdata.record.SensorsDataRecordBuilder;
+import org.apache.seatunnel.format.sensorsdata.record.SpecialItemRecord;
+import org.apache.seatunnel.format.sensorsdata.record.UserDetailRecord;
+import org.apache.seatunnel.format.sensorsdata.record.UserEventRecord;
+import org.apache.seatunnel.format.sensorsdata.record.UserRecord;
+import org.apache.seatunnel.format.sensorsdata.utils.UserSchemaUtil;
+
+import org.apache.commons.lang3.StringUtils;
+
+import com.sensorsdata.analytics.javasdk.SensorsAnalytics;
+import com.sensorsdata.analytics.javasdk.bean.schema.UserSchema;
+import com.sensorsdata.analytics.javasdk.consumer.BatchConsumer;
+import com.sensorsdata.analytics.javasdk.consumer.ConsoleConsumer;
+import lombok.NonNull;
+import lombok.extern.slf4j.Slf4j;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+@Slf4j
+public class SensorsDataSDKWriter
+        implements SinkWriter<SeaTunnelRow, SensorsDataCommitInfo, SensorsDataSinkState>,
+                SupportMultiTableSinkWriter<Void> {
+
+    private final SensorsAnalytics sa;
+    private final RowAccessor rowAccessor;
+    private final SeaTunnelRowType seaTunnelRowType;
+    private final boolean isSkipErrorRecord;
+    private final boolean nullAsProfileUnset;
+    private final Set<String> allProperties;
+
+    /** for convenient testing */
+    private static final String CONSUMER_TYPE_CONSOLE = "console";
+
+    private final SensorsDataRecordBuilder.Builder recordBuilder;
+
+    public SensorsDataSDKWriter(
+            @NonNull SeaTunnelRowType seaTunnelRowType,
+            @NonNull SensorsDataSDKSinkConfig sinkConfig) {
+        if (CONSUMER_TYPE_CONSOLE.equalsIgnoreCase(sinkConfig.getConsumer())) {
+            sa = new SensorsAnalytics(new ConsoleConsumer(new PrintWriter(System.out)));
+        } else {
+            sa =
+                    new SensorsAnalytics(
+                            new BatchConsumer(
+                                    sinkConfig.getServerUrl(),
+                                    sinkConfig.getBulkSize(),
+                                    sinkConfig.getMaxCacheRowSize(),
+                                    false,
+                                    3,
+                                    sinkConfig.getInstantEvents()));
+        }
+        sa.setEnableTimeFree(sinkConfig.isTimeFree());
+        rowAccessor = new RowAccessor(sinkConfig, seaTunnelRowType);
+        this.seaTunnelRowType = seaTunnelRowType;
+        isSkipErrorRecord = sinkConfig.isSkipErrorRecord();
+        nullAsProfileUnset = sinkConfig.isNullAsProfileUnset();
+        recordBuilder = SensorsDataRecordBuilder.newBuilder(sinkConfig, rowAccessor);
+        this.allProperties =
+                sinkConfig.getPropertyFields().stream()
+                        .map(TargetColumnConfig::getTarget)
+                        .collect(Collectors.toSet());
+    }
+
+    @Override
+    public void write(SeaTunnelRow row) throws IOException {
+        try {
+            switch (recordBuilder.getRecordType()) {
+                case USER:
+                    UserSchema userSchema = ((UserRecord) recordBuilder.build(row)).getUserSchema();
+                    sa.profileSet(userSchema);
+                    if (nullAsProfileUnset) {
+                        UserSchema unsetUserSchema =
+                                UserSchemaUtil.buildUnsetUserSchema(userSchema, allProperties);
+                        if (unsetUserSchema != null) {
+                            // do not send profile_unset if all fields are not null
+                            sa.profileUnset(unsetUserSchema);
+                        }
+                    }
+                    break;
+                case USER_EVENT:
+                    sa.track(((UserEventRecord) recordBuilder.build(row)).getUserEventSchema());
+                    break;
+                case USER_DETAIL:
+                    sa.detailSet(
+                            ((UserDetailRecord) recordBuilder.build(row)).getUserDetailSchema());
+                    break;
+                case SPECIAL_ITEM:
+                    sa.itemSet(((SpecialItemRecord) recordBuilder.build(row)).getItemRecord());
+                    break;
+                default:
+                    throw new SensorsDataConnectorException(
+                            SensorsDataConnectorErrorCode.SEND_RECORD_FAILED,

Review Comment:
   In the default case you throw a SEND_RECORD_FAILED error code for an unsupported record type; use SensorsDataConnectorErrorCode.UNSUPPORTED_RECORD_TYPE instead.
   ```suggestion
                               SensorsDataConnectorErrorCode.UNSUPPORTED_RECORD_TYPE,
   ```



##########
seatunnel-connectors-v2/connector-sensorsdata/src/main/java/org/apache/seatunnel/connectors/seatunnel/sensorsdata/sdk/sink/SensorsDataSDKWriter.java:
##########
@@ -0,0 +1,200 @@
+/*
+ * 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.sensorsdata.sdk.sink;
+
+import org.apache.seatunnel.api.sink.SinkWriter;
+import org.apache.seatunnel.api.sink.SupportMultiTableSinkWriter;
+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.utils.JsonUtils;
+import org.apache.seatunnel.connectors.seatunnel.sensorsdata.sdk.config.SensorsDataSDKSinkConfig;
+import org.apache.seatunnel.connectors.seatunnel.sensorsdata.sdk.exception.SensorsDataConnectorErrorCode;
+import org.apache.seatunnel.connectors.seatunnel.sensorsdata.sdk.exception.SensorsDataConnectorException;
+import org.apache.seatunnel.connectors.seatunnel.sensorsdata.sdk.state.SensorsDataCommitInfo;
+import org.apache.seatunnel.connectors.seatunnel.sensorsdata.sdk.state.SensorsDataSinkState;
+import org.apache.seatunnel.format.sensorsdata.config.TargetColumnConfig;
+import org.apache.seatunnel.format.sensorsdata.record.RowAccessor;
+import org.apache.seatunnel.format.sensorsdata.record.SensorsDataRecordBuilder;
+import org.apache.seatunnel.format.sensorsdata.record.SpecialItemRecord;
+import org.apache.seatunnel.format.sensorsdata.record.UserDetailRecord;
+import org.apache.seatunnel.format.sensorsdata.record.UserEventRecord;
+import org.apache.seatunnel.format.sensorsdata.record.UserRecord;
+import org.apache.seatunnel.format.sensorsdata.utils.UserSchemaUtil;
+
+import org.apache.commons.lang3.StringUtils;
+
+import com.sensorsdata.analytics.javasdk.SensorsAnalytics;
+import com.sensorsdata.analytics.javasdk.bean.schema.UserSchema;
+import com.sensorsdata.analytics.javasdk.consumer.BatchConsumer;
+import com.sensorsdata.analytics.javasdk.consumer.ConsoleConsumer;
+import lombok.NonNull;
+import lombok.extern.slf4j.Slf4j;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+@Slf4j
+public class SensorsDataSDKWriter
+        implements SinkWriter<SeaTunnelRow, SensorsDataCommitInfo, SensorsDataSinkState>,
+                SupportMultiTableSinkWriter<Void> {
+
+    private final SensorsAnalytics sa;
+    private final RowAccessor rowAccessor;
+    private final SeaTunnelRowType seaTunnelRowType;
+    private final boolean isSkipErrorRecord;
+    private final boolean nullAsProfileUnset;
+    private final Set<String> allProperties;
+
+    /** for convenient testing */
+    private static final String CONSUMER_TYPE_CONSOLE = "console";
+
+    private final SensorsDataRecordBuilder.Builder recordBuilder;
+
+    public SensorsDataSDKWriter(
+            @NonNull SeaTunnelRowType seaTunnelRowType,
+            @NonNull SensorsDataSDKSinkConfig sinkConfig) {
+        if (CONSUMER_TYPE_CONSOLE.equalsIgnoreCase(sinkConfig.getConsumer())) {
+            sa = new SensorsAnalytics(new ConsoleConsumer(new PrintWriter(System.out)));
+        } else {
+            sa =
+                    new SensorsAnalytics(
+                            new BatchConsumer(
+                                    sinkConfig.getServerUrl(),
+                                    sinkConfig.getBulkSize(),
+                                    sinkConfig.getMaxCacheRowSize(),
+                                    false,
+                                    3,
+                                    sinkConfig.getInstantEvents()));
+        }
+        sa.setEnableTimeFree(sinkConfig.isTimeFree());
+        rowAccessor = new RowAccessor(sinkConfig, seaTunnelRowType);
+        this.seaTunnelRowType = seaTunnelRowType;
+        isSkipErrorRecord = sinkConfig.isSkipErrorRecord();
+        nullAsProfileUnset = sinkConfig.isNullAsProfileUnset();
+        recordBuilder = SensorsDataRecordBuilder.newBuilder(sinkConfig, rowAccessor);
+        this.allProperties =
+                sinkConfig.getPropertyFields().stream()
+                        .map(TargetColumnConfig::getTarget)
+                        .collect(Collectors.toSet());
+    }
+
+    @Override
+    public void write(SeaTunnelRow row) throws IOException {
+        try {
+            switch (recordBuilder.getRecordType()) {
+                case USER:
+                    UserSchema userSchema = ((UserRecord) recordBuilder.build(row)).getUserSchema();
+                    sa.profileSet(userSchema);
+                    if (nullAsProfileUnset) {
+                        UserSchema unsetUserSchema =
+                                UserSchemaUtil.buildUnsetUserSchema(userSchema, allProperties);
+                        if (unsetUserSchema != null) {
+                            // do not send profile_unset if all fields are not null
+                            sa.profileUnset(unsetUserSchema);
+                        }
+                    }
+                    break;
+                case USER_EVENT:
+                    sa.track(((UserEventRecord) recordBuilder.build(row)).getUserEventSchema());
+                    break;
+                case USER_DETAIL:
+                    sa.detailSet(
+                            ((UserDetailRecord) recordBuilder.build(row)).getUserDetailSchema());
+                    break;
+                case SPECIAL_ITEM:
+                    sa.itemSet(((SpecialItemRecord) recordBuilder.build(row)).getItemRecord());
+                    break;
+                default:
+                    throw new SensorsDataConnectorException(
+                            SensorsDataConnectorErrorCode.SEND_RECORD_FAILED,
+                            "Unsupported record type");
+            }
+        } catch (Exception e) {
+            log.error("Write error", e);
+            log.error(
+                    "Write error, SeaTunnelRow#tableId={} SeaTunnelRow#kind={} : [{}]",
+                    row.getTableId(),
+                    row.getRowKind(),
+                    fieldsToString(row));
+            if (!isSkipErrorRecord) {
+                throw new SensorsDataConnectorException(
+                        SensorsDataConnectorErrorCode.SEND_RECORD_FAILED, e.getMessage());

Review Comment:
   When rethrowing the exception here, include the original exception as the cause (e.g., use the constructor that accepts a Throwable) to preserve the stack trace.
   ```suggestion
                           SensorsDataConnectorErrorCode.SEND_RECORD_FAILED, e.getMessage(), e);
   ```



##########
docs/en/connector-v2/sink/SensorsData.md:
##########
@@ -0,0 +1,178 @@
+import ChangeLog from '../changelog/connector-sensorsdata.md';
+
+# SensorsData
+
+> SensorsData sink connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Key features
+
+- [ ] [exactly-once](../../concept/connector-v2-features.md)
+
+## Description
+
+A sink plugin which use SensorsData SDK send data records.
+
+## Options
+
+| name                      | type    | required | default value |
+|---------------------------|---------|----------|---------------|
+| server_url                | string  | yes      | -             |
+| bulk_size                 | int     | no       | 50            |
+| max_cache_row_size        | int     | no       | 0             |
+| consumer                  | string  | no       | -             |
+| entity_name               | string  | yes      | users         |
+| record_type               | string  | yes      | users         |
+| schema                    | string  | yes      | users         |
+| distinct_id_column        | string  | yes      | -             |
+| identity_fields           | array   | yes      | -             |
+| property_fields           | array   | yes      | -             |
+| event_name                | string  | yes      | -             |
+| time_column               | string  | yes      | -             |
+| time_free                 | boolean | no       | false         |
+| detail_id_column          | string  | no       | -             |
+| item_id_column            | string  | no       | -             |
+| item_type_column          | string  | no       | -             |
+| skip_error_record         | boolean | no       | false         |
+| instant_events            | array   | no       | -             |
+| distinct_id_by_identities | boolean | no       | false         |
+| null_as_profile_unset     | boolean | no       | false         |
+| common-options            |         | no       | -             |
+
+### server_url [string]
+
+SensorsData data sink address, the format is https://${host}:8106/sa?project=${project}
+
+### bulk_size [int]
+
+Threshold for the triggering flush operation in SensorsData SDK. When the memory cache queue reaches this value, the
+data in the cache will be sended. The default value is 50.

Review Comment:
   Correct the verb tense here: use 'sent' instead of 'sended'.
   ```suggestion
   data in the cache will be sent. The default value is 50.
   ```



-- 
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 Sensorsdata Connector Support #9323 [seatunnel]

Posted by "zhangqs0205 (via GitHub)" <gi...@apache.org>.
zhangqs0205 commented on code in PR #9432:
URL: https://github.com/apache/seatunnel/pull/9432#discussion_r2255747018


##########
docs/en/connector-v2/sink/SensorsData.md:
##########
@@ -0,0 +1,178 @@
+import ChangeLog from '../changelog/connector-sensorsdata.md';
+
+# SensorsData
+
+> SensorsData sink connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Key features
+
+- [ ] [exactly-once](../../concept/connector-v2-features.md)
+
+## Description
+
+A sink plugin which use SensorsData SDK send data records.
+
+## Options
+
+| name                      | type    | required | default value |
+|---------------------------|---------|----------|---------------|
+| server_url                | string  | yes      | -             |
+| bulk_size                 | int     | no       | 50            |
+| max_cache_row_size        | int     | no       | 0             |
+| consumer                  | string  | no       | -             |
+| entity_name               | string  | yes      | users         |
+| record_type               | string  | yes      | users         |
+| schema                    | string  | yes      | users         |
+| distinct_id_column        | string  | yes      | -             |
+| identity_fields           | array   | yes      | -             |
+| property_fields           | array   | yes      | -             |

Review Comment:
    The content in the "Description" column is relatively complex, it is explained separately below the table. The format of Jdbc.md was referenced.



-- 
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 Sensorsdata Connector Support #9323 [seatunnel]

Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on PR #9432:
URL: https://github.com/apache/seatunnel/pull/9432#issuecomment-2986419619

   > Author
   
   
   
   > I have a question and would appreciate your advice: As seen in this PR, two modules are submitted:
   > 
   > ```
   > seatunnel-connector-v2/connector-sensorsdata
   > seatunnel-format/seatunnel-format-sensorsdata
   > ```
   > 
   > Here, connector-sensorsdata depends on seatunnel-format-sensorsdata.
   > 
   > #### Our scenario is:
   > On our private branch, besides connector-sensorsdata, we have several transform modules. We extracted common dependencies for these modules into seatunnel-format-sensorsdata.
   > 
   > For the code submitted to the community, since seatunnel-format-sensorsdata is only used by connector-sensorsdata, it seems more reasonable to consolidate them into a single module. However, if we do this, each transform module in our private branch would need to duplicate these base classes, which isn’t practical.
   > 
   > #### My questions are:
   > 1. Should we submit seatunnel-format-sensorsdata as an independent module to the community?
   > 2. If it shouldn’t be a separate module, do you have any suggestions?
   >    One idea I have:
   >    Release seatunnel-format-sensorsdata as a separate Maven Central artifact.
   >    But this artifact would be specifically for Seatunnel since it depends on seatunnel-api.
   > 
   > @zhilinli123
   
   PTAL : @hailin0 @Hisoka-X  


-- 
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 Sensorsdata Connector Support #9323 [seatunnel]

Posted by "corgy-w (via GitHub)" <gi...@apache.org>.
corgy-w merged PR #9432:
URL: https://github.com/apache/seatunnel/pull/9432


-- 
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 Sensorsdata Connector Support #9323 [seatunnel]

Posted by "zhangqs0205 (via GitHub)" <gi...@apache.org>.
zhangqs0205 commented on PR #9432:
URL: https://github.com/apache/seatunnel/pull/9432#issuecomment-3182809735

   > wating test case passed.
   
   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-v2] Add Sensorsdata Connector Support #9323 [seatunnel]

Posted by "zhangqs0205 (via GitHub)" <gi...@apache.org>.
zhangqs0205 commented on code in PR #9432:
URL: https://github.com/apache/seatunnel/pull/9432#discussion_r2144501056


##########
seatunnel-connectors-v2/connector-sensorsdata/src/main/java/org/apache/seatunnel/connectors/seatunnel/sensorsdata/sdk/config/SensorsDataSDKSinkOptions.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * 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.sensorsdata.sdk.config;
+
+import org.apache.seatunnel.api.configuration.Option;
+import org.apache.seatunnel.api.configuration.Options;
+import org.apache.seatunnel.format.sensorsdata.config.SensorsDataOptions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@SuppressWarnings("checkstyle:MagicNumber")
+public interface SensorsDataSDKSinkOptions extends SensorsDataOptions {
+
+    Option<String> SERVER_URL =
+            Options.key("server_url")
+                    .stringType()
+                    .noDefaultValue()
+                    .withDescription("格式:https://{ip}:8106/sa?project={project}");
+
+    Option<Integer> BULK_SIZE =
+            Options.key("bulk_size")
+                    .intType()
+                    .defaultValue(50)
+                    .withDescription("触发 flush 操作阈值,当内存缓存队列达到该值时,将缓存中的数据批量上报,默认 50");

Review Comment:
   fixed



##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-sensorsdata-e2e/src/test/resources/fake_to_sensorsdata_details.conf:
##########
@@ -0,0 +1,67 @@
+#
+# 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.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+  # You can set engine configuration here
+  parallelism = 1
+  job.mode = "BATCH"
+}
+
+source {
+  # This is a example source plugin **only for test and demonstrate the feature source plugin**
+  FakeSource {
+    parallelism = 1
+    row.num = 10
+    schema = {
+      fields {
+        c_id = string
+        c_boolean = boolean
+        c_int = int
+        c_bigint = bigint
+      }
+    }
+  }
+}
+
+transform {
+}
+
+sink {
+  SensorsData {
+    # 将发送的数据输出到控制台,便于测试、检查

Review Comment:
   fixed



-- 
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 Sensorsdata Connector Support #9323 [seatunnel]

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #9432:
URL: https://github.com/apache/seatunnel/pull/9432#issuecomment-2986465413

   Please move the code of `seatunnel-format-sensorsdata` to `connector-sensorsdata`


-- 
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 Sensorsdata Connector Support #9323 [seatunnel]

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on code in PR #9432:
URL: https://github.com/apache/seatunnel/pull/9432#discussion_r2180018527


##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-sensorsdata-e2e/README.md:
##########
@@ -0,0 +1,2 @@
+# SDH connector E2E test

Review Comment:
   Please remove this.



##########
.github/workflows/backend.yml:
##########
@@ -1435,3 +1435,28 @@ jobs:
           ./mvnw -B -T 1 verify -DskipUT=true -DskipIT=false -D"license.skipAddThirdParty"=true -D"skip.ui"=true --no-snapshot-updates -pl :connector-redis-e2e -am -Pci
         env:
           MAVEN_OPTS: -Xmx4096m
+

Review Comment:
   Please update https://github.com/apache/seatunnel/blob/86c5ae4c41a55397ea73b8fd101456ba58958bf6/tools/update_modules_check/update_modules_check.py#L146



-- 
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 Sensorsdata Connector Support #9323 [seatunnel]

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #9432:
URL: https://github.com/apache/seatunnel/pull/9432#issuecomment-2998670345

   > > Please move the code of `seatunnel-format-sensorsdata` to `connector-sensorsdata`
   > 
   > Indeed, based on the currently submitted code, moving `seatunnel-format-sensorsdata` into `connector-sensorsdata` appears to be correct.
   > 
   > However, in our internal branch, several other transforms also depend on `seatunnel-format-sensorsdata`. As a common dependency, keeping it as a separate module would be easier to maintain.
   > 
   > If we move it, merging new community code into our internal branch in the future might become more difficult. Do you have any good suggestions?
   > 
   > @Hisoka-X
   
   You can add the dependency `connector-sensorsdata` to your own transform module pom.


-- 
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 Sensorsdata Connector Support #9323 [seatunnel]

Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #9432:
URL: https://github.com/apache/seatunnel/pull/9432#discussion_r2142355459


##########
seatunnel-connectors-v2/connector-sensorsdata/src/main/java/org/apache/seatunnel/connectors/seatunnel/sensorsdata/sdk/config/SensorsDataSDKSinkOptions.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * 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.sensorsdata.sdk.config;
+
+import org.apache.seatunnel.api.configuration.Option;
+import org.apache.seatunnel.api.configuration.Options;
+import org.apache.seatunnel.format.sensorsdata.config.SensorsDataOptions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@SuppressWarnings("checkstyle:MagicNumber")
+public interface SensorsDataSDKSinkOptions extends SensorsDataOptions {
+
+    Option<String> SERVER_URL =
+            Options.key("server_url")
+                    .stringType()
+                    .noDefaultValue()
+                    .withDescription("格式:https://{ip}:8106/sa?project={project}");
+
+    Option<Integer> BULK_SIZE =
+            Options.key("bulk_size")
+                    .intType()
+                    .defaultValue(50)
+                    .withDescription("触发 flush 操作阈值,当内存缓存队列达到该值时,将缓存中的数据批量上报,默认 50");

Review Comment:
   English description
   



##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-sensorsdata-e2e/src/test/resources/fake_to_sensorsdata_details.conf:
##########
@@ -0,0 +1,67 @@
+#
+# 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.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+  # You can set engine configuration here
+  parallelism = 1
+  job.mode = "BATCH"
+}
+
+source {
+  # This is a example source plugin **only for test and demonstrate the feature source plugin**
+  FakeSource {
+    parallelism = 1
+    row.num = 10
+    schema = {
+      fields {
+        c_id = string
+        c_boolean = boolean
+        c_int = int
+        c_bigint = bigint
+      }
+    }
+  }
+}
+
+transform {
+}
+
+sink {
+  SensorsData {
+    # 将发送的数据输出到控制台,便于测试、检查

Review Comment:
   English description
   



-- 
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 Sensorsdata Connector Support #9323 [seatunnel]

Posted by "zhangqs0205 (via GitHub)" <gi...@apache.org>.
zhangqs0205 commented on code in PR #9432:
URL: https://github.com/apache/seatunnel/pull/9432#discussion_r2275230582


##########
docs/en/connector-v2/sink/SensorsData.md:
##########
@@ -0,0 +1,178 @@
+import ChangeLog from '../changelog/connector-sensorsdata.md';
+
+# SensorsData
+
+> SensorsData sink connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Key features
+
+- [ ] [exactly-once](../../concept/connector-v2-features.md)
+
+## Description
+
+A sink plugin which use SensorsData SDK send data records.
+
+## Options
+
+| name                      | type    | required | default value |
+|---------------------------|---------|----------|---------------|
+| server_url                | string  | yes      | -             |
+| bulk_size                 | int     | no       | 50            |
+| max_cache_row_size        | int     | no       | 0             |
+| consumer                  | string  | no       | -             |
+| entity_name               | string  | yes      | users         |
+| record_type               | string  | yes      | users         |
+| schema                    | string  | yes      | users         |
+| distinct_id_column        | string  | yes      | -             |
+| identity_fields           | array   | yes      | -             |
+| property_fields           | array   | yes      | -             |

Review Comment:
   @zhilinli123 Please review



-- 
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 Sensorsdata Connector Support #9323 [seatunnel]

Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #9432:
URL: https://github.com/apache/seatunnel/pull/9432#discussion_r2142353441


##########
docs/en/connector-v2/sink/SensorsData.md:
##########
@@ -0,0 +1,178 @@
+import ChangeLog from '../changelog/connector-sensorsdata.md';
+
+# SensorsData
+
+> SensorsData sink connector
+
+## Support Those Engines
+
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
+
+## Key features
+
+- [ ] [exactly-once](../../concept/connector-v2-features.md)
+
+## Description
+
+A sink plugin which use SensorsData SDK send data records.
+
+## Options
+
+| name                      | type    | required | default value |
+|---------------------------|---------|----------|---------------|
+| server_url                | string  | yes      | -             |
+| bulk_size                 | int     | no       | 50            |
+| max_cache_row_size        | int     | no       | 0             |
+| consumer                  | string  | no       | -             |
+| entity_name               | string  | yes      | users         |
+| record_type               | string  | yes      | users         |
+| schema                    | string  | yes      | users         |
+| distinct_id_column        | string  | yes      | -             |
+| identity_fields           | array   | yes      | -             |
+| property_fields           | array   | yes      | -             |

Review Comment:
   Reference connector v2 doc format
   https://seatunnel.apache.org/docs/2.3.11/connector-v2/source/Mysql



-- 
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