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

[Bug] [SQL] after sql replaced, comment remained part, cause error, only doris driver? #17023

Open
2 of 3 tasks
jalousiex opened this issue Feb 19, 2025 · 1 comment
Open
2 of 3 tasks
Labels
bug Something isn't working Waiting for reply Waiting for reply

Comments

@jalousiex
Copy link

jalousiex commented Feb 19, 2025

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

this is doris data source, doris driver sql comment replaced wrong

[INFO] 2025-02-19 12:16:39.612 +0800 - *********************************  Execute task instance  *************************************
[INFO] 2025-02-19 12:16:39.613 +0800 - ***********************************************************************************************
[INFO] 2025-02-19 12:16:39.613 +0800 - Full sql parameters: SqlParameters{type='DORIS', datasource=36, sql='--注释测试
/*注释测试*/
select 'a' as s,--注释测试
/*注释测试*/
 1 as n
 --注释测试
/*注释测试*/', sqlType=0, sendEmail=null, displayRows=10, limit=0, udfs='null', showType='null', connParams='null', groupId='0', title='null', preStatements=[], postStatements=[]}
[INFO] 2025-02-19 12:16:39.613 +0800 - sql type : DORIS, datasource : 36, sql : --注释测试
/*注释测试*/
select 'a' as s,--注释测试
/*注释测试*/
 1 as n
 --注释测试
/*注释测试*/ , localParams : [],udfs : null,showType : null,connParams : null,varPool : [] ,query max result limit  0
[INFO] 2025-02-19 12:16:39.615 +0800 - after replace sql , preparing : 测试*/
select 'a' as s,
测试*/
 1 as n
 
测试*/
[INFO] 2025-02-19 12:16:39.616 +0800 - Sql Params are replaced sql , parameters:
[INFO] 2025-02-19 12:16:39.616 +0800 - can't find udf function resource
[WARN] 2025-02-19 12:16:39.617 +0800 - Connect strings must start with jdbc:snowflake://
[INFO] 2025-02-19 12:16:39.662 +0800 - prepare statement replace sql : 测试*/
select 'a' as s,
测试*/
 1 as n
 
测试*/, sql parameters : {}
[INFO] 2025-02-19 12:16:39.662 +0800 - main statement execute query, for sql: 测试*/
select 'a' as s,
测试*/
 1 as n
 
测试*/
[ERROR] 2025-02-19 12:16:39.669 +0800 - execute sql error: errCode = 2, detailMessage = 
mismatched input '测试' expecting {<EOF>, ';', '(', 'ADMIN', 'ALTER', 'ANALYZE', 'BACKUP', 'BEGIN', 'BUILD', 'CALL', 'CANCEL', 'CLEAN', 'COLUMNS', 'COMMIT', 'COPY', 'CREATE', 'DELETE', 'DESC', 'DESCRIBE', 'DROP', 'EXPLAIN', 'EXPORT', 'GRANT', 'HELP', 'INSERT', 'INSTALL', 'KILL', 'LOAD', 'LOCK', 'ORDER', 'PAUSE', 'PLAN', 'PRECEDING', 'RECOVER', 'REFRESH', 'REPLACE', 'RESTORE', 'RESUME', 'REVOKE', 'ROLLBACK', 'SELECT', 'SET', 'SHOW', 'START', 'STOP', 'SWITCH', 'SYNC', 'TRUNCATE', 'UNINSTALL', 'UNLOCK', 'UNSET', 'UPDATE', 'USE', 'VALUES', 'WARM', 'WHERE', 'WITH'}(line 1, pos 0)

[ERROR] 2025-02-19 12:16:39.670 +0800 - sql task error

this is doris data source, mysql driver

[INFO] 2025-02-19 12:23:52.946 +0800 - *********************************  Execute task instance  *************************************
[INFO] 2025-02-19 12:23:52.947 +0800 - ***********************************************************************************************
[INFO] 2025-02-19 12:23:52.947 +0800 - Full sql parameters: SqlParameters{type='MYSQL', datasource=7, sql='--注释测试
/*注释测试*/
select 'a' as s,--注释测试
/*注释测试*/
 1 as n
 --注释测试
/*注释测试*/', sqlType=0, sendEmail=null, displayRows=10, limit=0, udfs='null', showType='null', connParams='null', groupId='0', title='null', preStatements=[], postStatements=[]}
[INFO] 2025-02-19 12:23:52.950 +0800 - sql type : MYSQL, datasource : 7, sql : --注释测试
/*注释测试*/
select 'a' as s,--注释测试
/*注释测试*/
 1 as n
 --注释测试
/*注释测试*/ , localParams : [],udfs : null,showType : null,connParams : null,varPool : null ,query max result limit  0
[INFO] 2025-02-19 12:23:52.951 +0800 - after replace sql , preparing : --注释测试

select 'a' as s,--注释测试

 1 as n
 --注释测试
[INFO] 2025-02-19 12:23:52.951 +0800 - Sql Params are replaced sql , parameters:
[INFO] 2025-02-19 12:23:52.951 +0800 - can't find udf function resource
[WARN] 2025-02-19 12:23:52.952 +0800 - Connect strings must start with jdbc:snowflake://
[INFO] 2025-02-19 12:23:52.990 +0800 - prepare statement replace sql : --注释测试

select 'a' as s,--注释测试

 1 as n
 --注释测试, sql parameters : {}
[INFO] 2025-02-19 12:23:52.990 +0800 - main statement execute query, for sql: --注释测试

select 'a' as s,--注释测试

 1 as n
 --注释测试
[INFO] 2025-02-19 12:23:53.054 +0800 - display sql result 1 rows as follows:
[INFO] 2025-02-19 12:23:53.055 +0800 - row 1 : {"s":"a","n":1}

What you expected to happen

comment replaced correct
dolphin scheduler 3.2.2

How to reproduce

sql type job, doris driver data source

--注释测试
/*注释测试*/
select 'a' as s,--注释测试
/*注释测试*/
 1 as n
 --注释测试
/*注释测试*/

Anything else

No response

Version

3.2.x

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@jalousiex jalousiex added bug Something isn't working Waiting for reply Waiting for reply labels Feb 19, 2025
Copy link

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

this is doris data source, doris driver

[INFO] 2025-02-19 12:16:39.612 +0800 - ********************************************* Execute task instance ******************************************
[INFO] 2025-02-19 12:16:39.613 +0800 - ****************************************** ********************************************************* ************
[INFO] 2025-02-19 12:16:39.613 +0800 - Full sql parameters: SqlParameters{type='DORIS', datasource=36, sql='--Annotation test
/*Annotation test*/
select 'a' as s,--Annotation test
/*Annotation test*/
 1 as n
 --Comment Test
/*Annotation test*/', sqlType=0, sendEmail=null, displayRows=10, limit=0, udfs='null', showType='null', connParams='null', groupId='0', title= 'null', preStatements=[], postStatements=[]}
[INFO] 2025-02-19 12:16:39.613 +0800 - sql type: DORIS, datasource: 36, sql: --Annotation test
/*Annotation test*/
select 'a' as s,--Annotation test
/*Annotation test*/
 1 as n
 --Comment Test
/*Annotation test*/ , localParams : [],udfs : null,showType : null,connParams : null,varPool : [] ,query max result limit 0
[INFO] 2025-02-19 12:16:39.615 +0800 - after replace sql , preparing : Test*/
select 'a' as s,
test*/
 1 as n
 
test*/
[INFO] 2025-02-19 12:16:39.616 +0800 - Sql Params are replaced sql , parameters:
[INFO] 2025-02-19 12:16:39.616 +0800 - can't find udf function resource
[WARN] 2025-02-19 12:16:39.617 +0800 - Connect strings must start with jdbc:snowflake://
[INFO] 2025-02-19 12:16:39.662 +0800 - prepare statement replace sql : Test*/
select 'a' as s,
test*/
 1 as n
 
Test*/, sql parameters: {}
[INFO] 2025-02-19 12:16:39.662 +0800 - main statement execute query, for sql: test*/
select 'a' as s,
test*/
 1 as n
 
test*/
[ERROR] 2025-02-19 12:16:39.669 +0800 - execute sql error: errCode = 2, detailMessage =
mismatched input 'test' expecting {<EOF>, ';', '(', 'ADMIN', 'ALTER', 'ANALYZE', 'BACKUP', 'BEGIN', 'BUILD', 'CALL', 'CANCEL' , 'CLEAN', 'COLUMNS', 'COMMIT', 'COPY', 'CREATE', 'DELETE', 'DESC', 'DESCRIBE', 'DROP', 'EXPLAIN', 'EXPORT', 'GRANT', ' HELP', 'INSERT', 'INSTALL', 'KILL', 'LOAD', 'LOCK', 'ORDER', 'PAUSE', 'PLAN', 'PRECEDING', 'RECOVER', 'REFRESH', 'REPLACE', 'RESTORE ', 'RESUME', 'REVOKE', 'ROLLBACK', 'SELECT', 'SET', 'SHOW', 'START', 'STOP', 'SWITCH', 'SYNC', 'TRUNCATE', 'UNINSTALL', 'UNLOCK', 'UNSET', 'UPDATE', 'USE', 'VALUES', 'WARM', 'WHERE', 'WITH'}(line 1, pos 0)

[ERROR] 2025-02-19 12:16:39.670 +0800 - sql task error

this is doris data source, doris driver

[INFO] 2025-02-19 12:23:52.946 +0800 - ********************************************* Execute task instance ******************************************
[INFO] 2025-02-19 12:23:52.947 +0800 - ****************************************** ********************************************************* ************
[INFO] 2025-02-19 12:23:52.947 +0800 - Full sql parameters: SqlParameters{type='MYSQL', datasource=7, sql='--Annotation test
/*Annotation test*/
select 'a' as s,--Annotation test
/*Annotation test*/
 1 as n
 --Comment Test
/*Annotation test*/', sqlType=0, sendEmail=null, displayRows=10, limit=0, udfs='null', showType='null', connParams='null', groupId='0', title= 'null', preStatements=[], postStatements=[]}
[INFO] 2025-02-19 12:23:52.950 +0800 - sql type: MYSQL, datasource: 7, sql: --Annotation test
/*Annotation test*/
select 'a' as s,--Annotation test
/*Annotation test*/
 1 as n
 --Comment Test
/*Annotation test*/ , localParams : [],udfs : null,showType : null,connParams : null,varPool : null ,query max result limit 0
[INFO] 2025-02-19 12:23:52.951 +0800 - after replace sql , preparing : --Comment Test

select 'a' as s,--Annotation test

 1 as n
 --Comment Test
[INFO] 2025-02-19 12:23:52.951 +0800 - Sql Params are replaced sql , parameters:
[INFO] 2025-02-19 12:23:52.951 +0800 - can't find udf function resource
[WARN] 2025-02-19 12:23:52.952 +0800 - Connect strings must start with jdbc:snowflake://
[INFO] 2025-02-19 12:23:52.990 +0800 - prepare statement replace sql : --Comment test

select 'a' as s,--Annotation test

 1 as n
 --Annotation test, sql parameters: {}
[INFO] 2025-02-19 12:23:52.990 +0800 - main statement execute query, for sql: --Comment test

select 'a' as s,--Annotation test

 1 as n
 --Comment Test
[INFO] 2025-02-19 12:23:53.054 +0800 - display sql result 1 rows as follows:
[INFO] 2025-02-19 12:23:53.055 +0800 - row 1 : {"s":"a","n":1}

What you expected to happen

comment replaced correct
dolphin scheduler 3.2.2

How to reproduce

sql type job, doris driver data source

--Comment Test
/*Annotation test*/
select 'a' as s,--Annotation test
/*Annotation test*/
 1 as n
 --Comment Test
/*Annotation test*/

Anything else

No response

Version

3.2.x

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@jalousiex jalousiex changed the title [Bug] [SQL] after sql replaced wrone, caused script comment keep part, only doris driver? [Bug] [SQL] after sql replaced, comment remained part, cause error, only doris driver? Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Waiting for reply Waiting for reply
Projects
None yet
Development

No branches or pull requests

1 participant