TakawaAkirayo opened a new issue, #6221:
URL: https://github.com/apache/kyuubi/issues/6221

   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   
   
   ### Search before asking
   
   - [X] I have searched in the 
[issues](https://github.com/apache/kyuubi/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Describe the bug
   
   SQLs contains '?' within double quote or comment will meet below issue:
   
   Caused by: org.apache.kyuubi.jdbc.hive.KyuubiSQLException: Parameter #1 is 
unset
           at org.apache.kyuubi.jdbc.hive.Utils.updateSql(Utils.java:148) 
~[kyuubi-hive-jdbc-shaded-1.8.0.0.4.0.jar!/:1.8.0.0.4.0]
           at 
org.apache.kyuubi.jdbc.hive.KyuubiPreparedStatement.updateSql(KyuubiPreparedStatement.java:82)
 ~[kyuubi-hive-jdbc-shaded-1.8.0.0.4.0.jar!/:1.8.0.0.4.0]
           at 
org.apache.kyuubi.jdbc.hive.KyuubiPreparedStatement.execute(KyuubiPreparedStatement.java:64)
 ~[kyuubi-hive-jdbc-shaded-1.8.0.0.4.0.jar!/:1.8.0.0.4.0]
           at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
~[?:1.8.0_222]
           ... 1 more
   
   SQL Examples:
   
   Below sql contains regex expression within double quote, the ? below should 
be an invalid parameter placeholder similar to the case that within single quote
   ```
   select 
   regexp_extract(field_a, "[a-zA-Z]+?", 0) as extracted_a
   from table_any
   ```
   
   2. The sql might contain comments and the ? should be an invalid placeholder 
if it's within the comment block
   ```
   select 
   -- ? some comment
   field_a,
   field_b
   from table_any
   ```
   
   ### Affects Version(s)
   
   1.8.0
   
   ### Kyuubi Server Log Output
   
   _No response_
   
   ### Kyuubi Engine Log Output
   
   _No response_
   
   ### Kyuubi Server Configurations
   
   _No response_
   
   ### Kyuubi Engine Configurations
   
   _No response_
   
   ### Additional context
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes. I would be willing to submit a PR with guidance from the Kyuubi 
community to fix.
   - [ ] No. I cannot submit a PR at this time.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to