-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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-9177][Task] The sql task supports configuring segmentation notation to provide execution of multiple statements #9917
[Feature-9177][Task] The sql task supports configuring segmentation notation to provide execution of multiple statements #9917
Conversation
SonarCloud Quality Gate failed. |
@@ -46,6 +46,7 @@ export function useSql({ | |||
timeout: 30, | |||
type: 'MYSQL', | |||
displayRows: 10, | |||
segmentSeparator: '', |
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.
I think we should set a default value of semicolon to reduce repeated operations of users. What do you think?
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.
I don't think so, because this parameter refers to: this data source does not support the execution of multiple sql statements at a time. This parameter needs to be added, so that the program can split the sql segment and perform multiple queries;
for example, Hive supports one execution When there are multiple SQL statements, you do not need to add this parameter; Mysql does not support executing multiple statements at a time, you can use this new function, write multiple statements in the sql script of SqlTask, add ; to the segmentSeparator
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.
Yes. But i think it's too difficult for users to judge whether this parameter needs to be added. Is it better that we help users judge whether this parameter needs to be added instead of letting users to defined? @zhuangchong
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.
@SbloodyS
This suggestion is very good. I think whether this parameter needs to be related to the data source, provide default values for different data sources, but this will change the data source module. I hope to optimize in the next PR, let SQLTask support this function first, and then provide different data sources to change the value of this parameter, what do you think?
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.
Sounds goods to me. Thanks @zhuangchong
@SbloodyS Thanks. |
Purpose of the pull request
this pr close #9177
description:
The segment separator is used when the data source does not support multi-segment SQL execution, and the client needs to split the SQL and execute it multiple times.
such as:
1.Hive itself supports executing multiple sql statements at a time, you can write multiple statements directly in the sql script of sqlTask, the
segmentSeparator
does not need to write anything2.mysql does not support executing multiple statements at a time, you can use this new function, write multiple statements in the sql script of SqlTask, add
;
to thesegmentSeparator
Brief change log
Verify this pull request
This pull request is code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows: