dinky icon indicating copy to clipboard operation
dinky copied to clipboard

Fix v0.6.7 bug695 直接使用/openapi/executeSql提交的任务运维中心无法管理

Open QuintinTao opened this issue 3 years ago • 7 comments

Purpose of the pull request

I want to fix the bug #695 by add a param in com.dlink.dto.APIExecuteSqlDTO

Brief change log

com.dlink.dto.APIExecuteSqlDTO add a param clusterId modify the constructed method in com.dlink.job.JobConfig

Verify this pull request

post http://ip:port/openapi/executeSql { "type":"yarn-session", "address":"ip:port", "clusterId": 50, // I add "statement":"CREATE TABLE Orders (\r\n order_number INT,\r\n price DECIMAL(32,2),\r\n order_time TIMESTAMP(3)\r\n) WITH (\r\n 'connector' = 'datagen',\r\n 'rows-per-second' = '1',\r\n 'fields.order_number.kind' = 'sequence',\r\n 'fields.order_number.start' = '1',\r\n 'fields.order_number.end' = '1000'\r\n);\r\nCREATE TABLE pt (\r\nordertotal INT,\r\nnumtotal INT\r\n) WITH (\r\n 'connector' = 'print'\r\n);\r\ninsert into pt select 1 as ordertotal ,sum(order_number)*2 as numtotal from Orders", "useResult":false, "useStatementSet":false, "useChangeLog":false, "useAutoCancel":false, "fragment":false, "maxRowNum":100, "checkPoint":0, "parallelism":1, "jobName":"openapitest-1206", "configuration":{ "table.exec.resource.default-parallelism":2 } } image I got a running job

QuintinTao avatar Dec 06 '22 09:12 QuintinTao

Hi. Why specify this parameter?

aiwenmo avatar Dec 06 '22 12:12 aiwenmo

Hi. Why specify this parameter?

because this bug.https://github.com/DataLinkDC/dlink/issues/695 I found it caused by this. if we request openapi like this. { "type":"yarn-session", "address":"ip:port", "statement":"CREATE TABLE Orders (\r\n order_number INT,\r\n price DECIMAL(32,2),\r\n order_time TIMESTAMP(3)\r\n) WITH (\r\n 'connector' = 'datagen',\r\n 'rows-per-second' = '1',\r\n 'fields.order_number.kind' = 'sequence',\r\n 'fields.order_number.start' = '1',\r\n 'fields.order_number.end' = '1000'\r\n);\r\nCREATE TABLE pt (\r\nordertotal INT,\r\nnumtotal INT\r\n) WITH (\r\n 'connector' = 'print'\r\n);\r\ninsert into pt select 1 as ordertotal ,sum(order_number)*2 as numtotal from Orders", "useResult":false, "useStatementSet":false, "useChangeLog":false, "useAutoCancel":false, "fragment":false, "maxRowNum":100, "checkPoint":0, "parallelism":1, "jobName":"openapitest-1206", "configuration":{ "table.exec.resource.default-parallelism":2 } } we can not get clusterId from request. So image

because the clusterId is missing. The instance can not be updated to running.

QuintinTao avatar Dec 07 '22 01:12 QuintinTao

I think this interface should not involve internal ID, but external parameters. We can automatically register cluster instances before submitting tasks to fix it.

aiwenmo avatar Dec 07 '22 10:12 aiwenmo

I think this interface should not involve internal ID, but external parameters. We can automatically register cluster instances before submitting tasks to fix it.

but this interface received "address":"ip:port", How can we know adress? We need look up it in the dlink system.

QuintinTao avatar Dec 08 '22 01:12 QuintinTao

I think this interface should not involve internal ID, but external parameters. We can automatically register cluster instances before submitting tasks to fix it.

but this interface received "address":"ip:port", How can we know adress? We need look up it in the dlink system.

This parameter is only required to create a cluster instance.

aiwenmo avatar Dec 08 '22 13:12 aiwenmo

I think this interface should not involve internal ID, but external parameters. We can automatically register cluster instances before submitting tasks to fix it.

but this interface received "address":"ip:port", How can we know adress? We need look up it in the dlink system.

This parameter is only required to create a cluster instance.

OK I see. Your suggustion is use address to get cluster instance to fix it instead of add an parameter?

QuintinTao avatar Dec 09 '22 00:12 QuintinTao

I think this interface should not involve internal ID, but external parameters. We can automatically register cluster instances before submitting tasks to fix it.

but this interface received "address":"ip:port", How can we know adress? We need look up it in the dlink system.

This parameter is only required to create a cluster instance.

OK I see. Your suggustion is use address to get cluster instance to fix it instead of add an parameter?

Yes.

aiwenmo avatar Dec 09 '22 11:12 aiwenmo