-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[Feature][connector-v2] Add Sensorsdata Connector Support #9323 #9432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| 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 | - | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference connector v2 doc format
https://seatunnel.apache.org/docs/2.3.11/connector-v2/source/Mysql
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The content in the "Description" column is relatively complex, it is explained separately below the table. The format of Jdbc.md was referenced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhilinli123 Please review
.../apache/seatunnel/connectors/seatunnel/sensorsdata/sdk/config/SensorsDataSDKSinkOptions.java
Outdated
Show resolved
Hide resolved
...nnector-v2-e2e/connector-sensorsdata-e2e/src/test/resources/fake_to_sensorsdata_details.conf
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces initial support for the SensorsData connector (v2), including module setup, SDK-based writer implementation, distribution registration, end-to-end test scaffold, and documentation.
- Added a new
connector-sensorsdata
module with config, sink, writer, and error handling classes - Registered the connector in
seatunnel-dist
, plugin mappings, and labeler config - Provided E2E test scaffold and comprehensive user documentation
Reviewed Changes
Copilot reviewed 53 out of 53 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-sensorsdata-e2e/README.md | Added E2E test stub README |
seatunnel-dist/pom.xml | Added connector-sensorsdata as provided dependency |
seatunnel-connectors-v2/pom.xml | Included connector-sensorsdata module |
seatunnel-connectors-v2/connector-sensorsdata/src/test/.../SensorsDataSDKFactoryTest.java | Added basic factory optionRule unit test |
seatunnel-connectors-v2/connector-sensorsdata/src/main/java/.../state/*.java | Added state and commit-info classes |
seatunnel-connectors-v2/connector-sensorsdata/src/main/java/.../sdk/sink/SensorsDataSDKWriter.java | Implemented SDK-based SinkWriter |
seatunnel-connectors-v2/connector-sensorsdata/src/main/java/.../sdk/sink/SensorsDataSDKSinkFactory.java | Hooked into SeaTunnel TableSinkFactory |
seatunnel-connectors-v2/connector-sensorsdata/src/main/java/.../sdk/sink/SensorsDataSDKSink.java | Implemented SeaTunnelSink wrapper |
seatunnel-connectors-v2/connector-sensorsdata/src/main/java/.../sdk/exception/*.java | Defined connector-specific exceptions and error codes |
seatunnel-connectors-v2/connector-sensorsdata/src/main/java/.../sdk/config/*.java | Added sink options and config classes |
seatunnel-connectors-v2/connector-sensorsdata/pom.xml | New Maven POM for connector-sensorsdata module |
plugin-mapping.properties | Registered seatunnel.sink.SensorsData mapping |
config/plugin_config | Listed connector-sensorsdata |
.github/workflows/labeler/label-scope-conf.yml | Added labeler rules for connector-sensorsdata |
docs/en/connector-v2/sink/SensorsData.md | Written connector user guide |
docs/en/connector-v2/changelog/connector-sensorsdata.md | Stubbed changelog for connector-sensorsdata |
Comments suppressed due to low confidence (4)
seatunnel-connectors-v2/connector-sensorsdata/src/test/java/org/apache/seatunnel/connectors/seatunnel/sensorsdata/sdk/SensorsDataSDKFactoryTest.java:29
- [nitpick] This test only verifies optionRule is non-null; consider adding tests for write logic, record-type dispatching, and error handling to ensure full coverage.
Assertions.assertNotNull((new SensorsDataSDKSinkFactory()).optionRule());
docs/en/connector-v2/sink/SensorsData.md:28
- The default for 'consumer' in code is 'batch'; update the default value in the docs table to 'batch' for consistency.
| consumer | string | no | - |
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-sensorsdata-e2e/README.md:1
- [nitpick] Rename the header to '# SensorsData connector E2E test' to match the module name and avoid confusion.
# SDH connector E2E test
docs/en/connector-v2/sink/SensorsData.md:127
- The type for 'skip_error_record' should be [boolean], not [string], to align with the code.
### skip_error_record[string]
...ava/org/apache/seatunnel/connectors/seatunnel/sensorsdata/sdk/sink/SensorsDataSDKWriter.java
Outdated
Show resolved
Hide resolved
...ava/org/apache/seatunnel/connectors/seatunnel/sensorsdata/sdk/sink/SensorsDataSDKWriter.java
Outdated
Show resolved
Hide resolved
I have a question and would appreciate your advice:
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:
|
385af94
to
4ffbdc5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces the new SensorsData connector (v2) for SeaTunnel, implementing end-to-end support in code, configuration, documentation, and CI.
- Adds
connector-sensorsdata
as a Maven module and registers it in distribution and plugin mappings - Implements core connector classes: config, factory, sink, writer, state, and exceptions
- Provides unit test skeleton, detailed documentation, changelog, and updates CI workflows and plugin configs
Reviewed Changes
Copilot reviewed 54 out of 54 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
seatunnel-dist/pom.xml | Added connector-sensorsdata dependency |
seatunnel-connectors-v2/pom.xml | Registered connector-sensorsdata module |
connector-sensorsdata/src/main/java/... | Implemented config, factory, sink, writer, state, exception classes |
connector-sensorsdata/src/test/java/... | Added basic SensorsDataSDKFactoryTest |
plugin-mapping.properties | Mapped SensorsData to connector-sensorsdata |
docs/en/connector-v2/sink/SensorsData.md | Created connector documentation and examples |
docs/en/connector-v2/changelog/connector-sensorsdata.md | Added changelog scaffold |
config/plugin_config | Added connector-sensorsdata entry |
.github/workflows/labeler/label-scope-conf.yml | Added labeling rules for connector-sensorsdata |
.github/workflows/backend.yml | Introduced CI job for sensorsdata integration tests |
Comments suppressed due to low confidence (4)
docs/en/connector-v2/sink/SensorsData.md:28
- The default value for
consumer
in code is"batch"
, but the docs show-
. Please update the default in the table tobatch
to match the implementation.
| consumer | string | no | - |
seatunnel-connectors-v2/connector-sensorsdata/src/test/java/org/apache/seatunnel/connectors/seatunnel/sensorsdata/sdk/SensorsDataSDKFactoryTest.java:29
- [nitpick] The test only asserts that
optionRule()
is non-null. To improve coverage, add assertions that required options (e.g.,SERVER_URL
) are present in the returned rule.
Assertions.assertNotNull((new SensorsDataSDKSinkFactory()).optionRule());
.github/workflows/backend.yml:1460
- The CI step refers to
:connector-sensorsdata-e2e
, but no such module was added. Either add the corresponding e2e test module or remove/update this CI job reference.
./mvnw -B -T 1 verify -DskipUT=true -DskipIT=false -D"license.skipAddThirdParty"=true -D"skip.ui"=true --no-snapshot-updates -pl :connector-sensorsdata-e2e -am -Pci
seatunnel-connectors-v2/connector-sensorsdata/src/main/java/org/apache/seatunnel/connectors/seatunnel/sensorsdata/sdk/exception/SensorsDataConnectorErrorCode.java:24
- This enum constant
UNKNOWN_RECORD_TYPE
is never referenced in the code; consider removing it or aligning with used error codes to avoid dead entries.
UNKNOWN_RECORD_TYPE("SENSORS_DATA-02", "Unknown record type"),
|
Please move the code of |
Indeed, based on the currently submitted code, moving However, in our internal branch, several other transforms also depend on 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? |
You can add the dependency |
1eb5095
to
f8a5205
Compare
Moved |
@@ -0,0 +1,2 @@ | |||
# SDH connector E2E test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this.
@@ -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 | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update
modules_arr.remove("connector-jdbc-e2e") |
wating test case passed. |
passed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @zhangqs0205
1 1 1 1 1 update doc [Improve][Csv] support configurable CSV delimiter in file connector (apache#9660) [Fix][Doc] Fix rest api finished-jobs doc miss `SAVEPOINT_DONE` (apache#9676) [Fix] [connector-jdbc] prevent precision loss in Float to BigDecimal conversion (apache#9670) [Feature][Connector-File-Hadoop]Support multi table sink feature for HdfsFile (apache#9651) [HotFix][CI] The Some CI subtasks are not executed (apache#9684) [Docs][Connector-Iceberg] Update Iceberg doc with support S3 Tables rest catalogs (apache#9686) [Docs] update jdbc related document (apache#9679) [Fix][Connector-V2] Fix misleading parameter name in DorisStreamLoad (apache#9685) [Feature] [connector-file] Add configurable sheet_max_rows support for Excel sink connector (apache#9668) [fix][connectors-v2] repeated commit cause task exceptions (apache#9665) [Feature][connector-v2] Add Sensorsdata Connector Support apache#9323 (apache#9432) [Improve][API] Optimize the enumerator API semantics and reduce lock calls at the connector level (apache#9671) [Hotfix][Zeta] Fix custom https port configuration not working (apache#9705) [Improve][Doc] Add SeaTunnel tools into Readme (apache#9707) [Improve][Core] Unify the aws-sdk-v2 version to 2.31.30 (apache#9698) [Feature][Transform-V2] Add `TRIM_SCALE` function for sql transform (apache#9700) [Improve][Core] Update apache common to apache common lang3 (apache#9694) Co-authored-by: litiliu <[email protected]>
Purpose of this pull request
Does this PR introduce any user-facing change?
How was this patch tested?
Check list
New License Guide