Fix v0.6.7 bug695 直接使用/openapi/executeSql提交的任务运维中心无法管理
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
}
}
I got a running job
Hi. Why specify this parameter?
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

because the clusterId is missing. The instance can not be updated to running.
I think this interface should not involve internal ID, but external parameters. We can automatically register cluster instances before submitting tasks to fix it.
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.
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.
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?
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.