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- 9837][plugin/ui] support FlinkSQL Task #9840

Merged
merged 39 commits into from
May 9, 2022
Merged

[Feature- 9837][plugin/ui] support FlinkSQL Task #9840

merged 39 commits into from
May 9, 2022

Conversation

Dannila
Copy link
Contributor

@Dannila Dannila commented Apr 28, 2022

Purpose of the pull request

We want FlinkTask to have an editor to fill out flink sql.

Users can implement flink sql tasks or flink sql cdc tasks through the sql editor, which is convenient for users to perform data processing and ETL.

This change added tests and can be verified as follows:
lQLPDhtd5zy8ms7NBDDNBCywPUO0Y5G8idkCaoY5R8AFAA_1068_1072

Brief change log

ProgramType.class add sql type
FlinkTask.class and FlinkTask.class add main logical for support Spark sql command
FlinkConstants.class 和 FlinkParameters.class Common parameters for connecting Flink sql commands and methods for obtaining parameters
use-flink.ts adds some logic to support front-end pages supporting spark sql editing SQL

close #9837

Verify this pull request

This change added tests and can be verified as follows:

org.apache.dolphinscheduler.plugin.task.flink.FlinkTaskTest

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:

@zhuangchong zhuangchong added the first time contributor First-time contributor label Apr 29, 2022
@labbomb
Copy link
Member

labbomb commented Apr 29, 2022

@Amy0104 @devosend Take a look at this PR

@SbloodyS SbloodyS added UI ui and front end related backend miss:docs missing documents in PR labels Apr 29, 2022
@SbloodyS
Copy link
Member

Hi @Dannila , can you please add this to the docs? Thanks.

@codecov-commenter
Copy link

codecov-commenter commented Apr 29, 2022

Codecov Report

Merging #9840 (bbd92dd) into dev (8562f6a) will increase coverage by 0.36%.
The diff coverage is 66.88%.

@@             Coverage Diff              @@
##                dev    #9840      +/-   ##
============================================
+ Coverage     40.31%   40.67%   +0.36%     
- Complexity     4532     4576      +44     
============================================
  Files           835      834       -1     
  Lines         33750    33829      +79     
  Branches       3727     3745      +18     
============================================
+ Hits          13606    13761     +155     
+ Misses        18857    18749     -108     
- Partials       1287     1319      +32     
Impacted Files Coverage Δ
...hinscheduler/plugin/task/flink/FlinkConstants.java 0.00% <ø> (ø)
.../dolphinscheduler/plugin/task/flink/FlinkTask.java 65.45% <65.51%> (+65.45%) ⬆️
...inscheduler/plugin/task/flink/FlinkParameters.java 98.24% <85.71%> (+80.59%) ⬆️
...olphinscheduler/plugin/task/flink/ProgramType.java 100.00% <100.00%> (+100.00%) ⬆️
...org/apache/dolphinscheduler/remote/utils/Host.java 37.77% <0.00%> (-2.23%) ⬇️
...dolphinscheduler/remote/future/ResponseFuture.java 81.96% <0.00%> (-1.64%) ⬇️
...e/dolphinscheduler/remote/NettyRemotingClient.java 52.11% <0.00%> (-1.41%) ⬇️
...r/plugin/task/sqoop/parameter/SqoopParameters.java 53.33% <0.00%> (-1.34%) ⬇️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8562f6a...bbd92dd. Read the comment docs.

@Dannila
Copy link
Contributor Author

Dannila commented Apr 29, 2022

你好@Dannila,你能把这个添加到文档中吗?谢谢。

ok, another pr will be mentioned later to add documents

@@ -14,15 +14,27 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { computed, ref } from 'vue'
import { computed, ref , watchEffect} from 'vue'
Copy link
Contributor

Choose a reason for hiding this comment

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

Prettier format code should be used here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

WatchEffect is added here to monitor the value of programType and let flinkVersion change dynamically

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't have a better way to modify it

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have a better way to modify it

this is a matter of code style. import { computed, ref, watchEffect} from 'vue'

Copy link
Contributor

Choose a reason for hiding this comment

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

You can install prettier plugin for editor or run pnpm run prettier

model.programType === 'SQL' ? 24 : 0
)

const flinkVersionOptions = computed(() =>
Copy link
Contributor

Choose a reason for hiding this comment

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

above

validator(validate: any, value: string) {
if (model.programType !== 'PYTHON' && !value) {
if (model.programType !== 'PYTHON' && !value && model.programType !== 'SQL') {
return new Error(t('project.node.main_class_tips'))
}
}
}
},
useMainJar(model),
Copy link
Contributor

Choose a reason for hiding this comment

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

You should judge programType in useMainJar . It should not request queryResourceByProgramType when programType is SQL

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When the user clicks the programType as sql on the front end, the mainClass will be removed, and the edit box will be displayed for the user to fill in the sql

Copy link
Contributor

Choose a reason for hiding this comment

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

When the user clicks the programType as sql on the front end, the mainClass will be removed, and the edit box will be displayed for the user to fill in the sql

But it still call queryResourceByProgramType func and send a request to the backend.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Dannila modify use-main-jar.ts watch function

@SbloodyS
Copy link
Member

ok, another pr will be mentioned later to add documents

Please also add documents in this PR. Thanks.

@Dannila
Copy link
Contributor Author

Dannila commented Apr 29, 2022

还请在此 PR 中添加文档。谢谢。

Quindi aggiungerò il documento ora

@davidzollo
Copy link
Contributor

ok, another pr will be mentioned later to add documents

Please also add documents in this PR. Thanks.

good job, supporting Flink sql is big feature, By the way, the doc is very important, the PR with relevant doc will keep the code and documentation as consistent as possible

@davidzollo davidzollo removed the miss:docs missing documents in PR label May 4, 2022
@caishunfeng
Copy link
Contributor

Well done, I had approved to run CI.

@Dannila
Copy link
Contributor Author

Dannila commented May 5, 2022

@zhuangchong Excuse me, do you think this PR needs to be further optimized?

@SbloodyS
Copy link
Member

SbloodyS commented May 6, 2022

@Dannila Please resolve conflicts.

@Dannila
Copy link
Contributor Author

Dannila commented May 6, 2022

@Dannila Please resolve conflicts.

OK, I'll fix it in the next commit.

@songjianet
Copy link
Member

Please rebase the latest code, we removed the old UI.

@Dannila
Copy link
Contributor Author

Dannila commented May 6, 2022

Please rebase the latest code, we removed the old UI.

Yes, in the latest commit, I have rebase the latest code.

@songjianet
Copy link
Member

Please rebase the latest code, we removed the old UI.

Yes, in the latest commit, I have rebase the latest code.

It may be an operation problem. We removed the old UI and renamed UI-Next to UI, so from the current point of view, the operation on your side has not been successful.

@Dannila
Copy link
Contributor Author

Dannila commented May 7, 2022

rebase最新的代码,我们删除旧的UI

是的,在最新的提交中,我有rebase最新的代码。

可能是操作。我们取消了旧的UI改写,所以从目前UI-Next来看UI,你的这个操作没有成功。

Excuse me, is this operation successful in the latest commit?

@songjianet
Copy link
Member

yes, will review later.

@Dannila
Copy link
Contributor Author

Dannila commented May 7, 2022

yes, will review later.

Gratitude!

Copy link
Member

@SbloodyS SbloodyS left a comment

Choose a reason for hiding this comment

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

The backend part LGTM. PTAL @zhongjiajie

zhuangchong
zhuangchong previously approved these changes May 9, 2022
@devosend
Copy link
Contributor

devosend commented May 9, 2022

To ensure the quality and style of the front-end code, you should run pnpm run prettier to format the front-end code. @Dannila

@zhongjiajie
Copy link
Member

could we add it to CI? when could not formatted will fail our CI @devosend ?

Copy link
Member

@zhongjiajie zhongjiajie left a comment

Choose a reason for hiding this comment

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

Other LGTM

docs/docs/en/guide/task/flink.md Outdated Show resolved Hide resolved
docs/docs/zh/guide/task/flink.md Outdated Show resolved Hide resolved
@zhongjiajie
Copy link
Member

we should have frontend get at least one approval from our frontend developer

@Dannila
Copy link
Contributor Author

Dannila commented May 9, 2022

To ensure the quality and style of the front-end code, you should run pnpm run prettier to format the front-end code. @Dannila

Sorry, I don't know much about front-end, I don't know much about this should run pnpm run prettier to format front-end code

Copy link
Contributor

@devosend devosend left a comment

Choose a reason for hiding this comment

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

The front end part LGTM

@Dannila
Copy link
Contributor Author

Dannila commented May 9, 2022

The front end part LGTM

Greatful

@sonarcloud
Copy link

sonarcloud bot commented May 9, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 2 Security Hotspots
Code Smell A 5 Code Smells

74.9% 74.9% Coverage
2.2% 2.2% Duplication

@SbloodyS SbloodyS merged commit 2d36449 into apache:dev May 9, 2022
@SbloodyS
Copy link
Member

SbloodyS commented May 9, 2022

Thanks for your contribution. This is a good beginning. Considering that it's your first contribution, I think we can get deep communication, you can contact me through mail or add WeChat(SbloodyS), when mail or added, please tell me who you are. I think I can help to familiar with the Dolphinscheduler if you meet with problems.

@songjianet songjianet added this to the 3.1.0 milestone May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend first time contributor First-time contributor UI ui and front end related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature][plugin/ui] support FlinkSql Task