[ 
https://issues.apache.org/jira/browse/HIVE-29060?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Wenjun Ruan updated HIVE-29060:
-------------------------------
    Description: 
When I use HivePreparedStatement to execute below sql
{code:java}
SELECT `(ds|hr)?.` FROM ? {code}

got exception
{code:java}
java.sql.SQLException: Parameter #2 is unset
 
at 
org.apache.hive.jdbc.HivePreparedStatement.updateSql(HivePreparedStatement.java:122)
at 
org.apache.hive.jdbc.HivePreparedStatement.execute(HivePreparedStatement.java:89)
at 
org.apache.hive.jdbc.TestHivePreparedStatement.testBackticksWithRegex(TestHivePreparedStatement.java:223)
at java.base/java.lang.reflect.Method.invoke(Method.java:580) {code}

  was:
When I use HivePreparedStatement to execute below sql

```sql
SELECT `(ds|hr)?+.+` FROM ?
```
got exception
```java
 
java.sql.SQLException: Parameter #2 is unset
 
at 
org.apache.hive.jdbc.HivePreparedStatement.updateSql(HivePreparedStatement.java:122)
at 
org.apache.hive.jdbc.HivePreparedStatement.execute(HivePreparedStatement.java:89)
at 
org.apache.hive.jdbc.TestHivePreparedStatement.testBackticksWithRegex(TestHivePreparedStatement.java:223)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
```


> HivePreparedStatement cannot work well with ? in backticks
> ----------------------------------------------------------
>
>                 Key: HIVE-29060
>                 URL: https://issues.apache.org/jira/browse/HIVE-29060
>             Project: Hive
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 4.0.1
>            Reporter: Wenjun Ruan
>            Priority: Major
>
> When I use HivePreparedStatement to execute below sql
> {code:java}
> SELECT `(ds|hr)?.` FROM ? {code}
> got exception
> {code:java}
> java.sql.SQLException: Parameter #2 is unset
>  
> at 
> org.apache.hive.jdbc.HivePreparedStatement.updateSql(HivePreparedStatement.java:122)
> at 
> org.apache.hive.jdbc.HivePreparedStatement.execute(HivePreparedStatement.java:89)
> at 
> org.apache.hive.jdbc.TestHivePreparedStatement.testBackticksWithRegex(TestHivePreparedStatement.java:223)
> at java.base/java.lang.reflect.Method.invoke(Method.java:580) {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to