kyuubi icon indicating copy to clipboard operation
kyuubi copied to clipboard

[Bug] Parameter replacement issue due to incorrect sql split

Open ruanwenjun opened this issue 5 months ago • 2 comments

Code of Conduct

Search before asking

  • [x] I have searched in the issues and found no similar issues.

Describe the bug

https://github.com/apache/kyuubi/issues/6221 has fixed some case, but there still exist bug.

String sql = "SELECT\n" +
                "    regexp_replace(col2, '\\n|\\r|\\t', '') as col2,\n" +
                "    `(col2|col2)?+.+`\n" +
                "FROM\n" +
                "    test_table";
Utils.updateSql(sql, new HashMap<>());

got exception

Exception in thread "main" org.apache.kyuubi.jdbc.hive.KyuubiSQLException: Parameter #1 is unset
	at org.apache.kyuubi.jdbc.hive.Utils.updateSql(Utils.java:170)
	at org.apache.kyuubi.jdbc.hive.Test.main(Test.java:14)

Affects Version(s)

1.10

Kyuubi Server Log Output


Kyuubi Engine Log Output


Kyuubi Server Configurations


Kyuubi Engine Configurations


Additional context

No response

Are you willing to submit PR?

  • [ ] Yes. I would be willing to submit a PR with guidance from the Kyuubi community to fix.
  • [x] No. I cannot submit a PR at this time.

ruanwenjun avatar Jun 19 '25 07:06 ruanwenjun

Hello @ruanwenjun, Thanks for finding the time to report the issue! We really appreciate the community's efforts to improve Apache Kyuubi.

github-actions[bot] avatar Jun 19 '25 07:06 github-actions[bot]

Can we add a new judge inBackticks to handle this case?

ruanwenjun avatar Jun 19 '25 08:06 ruanwenjun