Skip to content
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

[Feature][SQL Config] Add SQL config adapter #6757

Merged
merged 32 commits into from May 11, 2024

Conversation

rewerma
Copy link
Contributor

@rewerma rewerma commented Apr 25, 2024

Purpose of this pull request

[Feature][SQL Config] Add SQL config adapter

Does this PR introduce any user-facing change?

How was this patch tested?

Check list

@hailin0 hailin0 added the core SeaTunnel core module label Apr 25, 2024
useSSL = false,
rewriteBatchedStatements = true
}',
'type'='source'
Copy link
Contributor

@hailin0 hailin0 Apr 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move type to connector after

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@hailin0 hailin0 added this to the 2.4.0 milestone Apr 26, 2024
@rewerma rewerma requested a review from hailin0 April 26, 2024 16:33
@hailin0
Copy link
Contributor

hailin0 commented May 6, 2024

cc @EricJoy2048 @Hisoka-X

mcy and others added 10 commits May 6, 2024 13:07
# Conflicts:
#	seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/utils/ConfigBuilder.java
#	seatunnel-core/seatunnel-spark-starter/seatunnel-spark-2-starter/src/main/java/org/apache/seatunnel/core/starter/spark/SparkStarter.java
#	seatunnel-core/seatunnel-spark-starter/seatunnel-spark-starter-common/src/main/java/org/apache/seatunnel/core/starter/spark/SparkStarter.java
```

* The `SELECT` part directly uses the name of the source-mapped table, indicating that all data from the source table will be inserted into the target table.
* sing this syntax does not generate related `transform` configurations. This syntax is generally used in multi-table synchronization scenarios. For example:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first letter needs to be capitalized.

@dailai
Copy link
Contributor

dailai commented May 8, 2024

Could you add some unit test for the new module named seatunnel-config-sql to vertify the logical? I think you can add some case like that the password in options is auto generate like this: ^%QjiXCG&GR'ob-T8Lr6UNaqQC#;7).

image

sinkConfig.setConnector(connector);
// original sink table without source_table_name
options.remove(OPTION_SOURCE_TABLE_NAME_KEY);
// String sourceTableName = options.get(OPTION_SOURCE_TABLE_NAME_KEY);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove useless code.

@@ -177,12 +177,26 @@ public SeaTunnelDataType<?> getExpressionType(Expression expression) {
SeaTunnelDataType<?> leftType = getExpressionType(binaryExpression.getLeftExpression());
SeaTunnelDataType<?> rightType =
getExpressionType(binaryExpression.getRightExpression());
if (leftType.getSqlType() == SqlType.INT && rightType.getSqlType() == SqlType.INT) {
if ((leftType.getSqlType() == SqlType.TINYINT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some test case for this to cover all the logical?

if ((leftType.getSqlType() == SqlType.INT || leftType.getSqlType() == SqlType.BIGINT)
&& (rightType.getSqlType() == SqlType.INT
|| rightType.getSqlType() == SqlType.BIGINT)) {
if ((leftType.getSqlType() == SqlType.TINYINT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above?

@hailin0 hailin0 modified the milestones: 2.4.0, 2.3.6 May 9, 2024
Copy link
Contributor

@dailai dailai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@hailin0 hailin0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@EricJoy2048 EricJoy2048 merged commit 329b849 into apache:dev May 11, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants