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

Cannot select DECIMAL lists via JDBC #9482

Closed
1 task done
michaeljohnalbers opened this issue Oct 26, 2023 · 0 comments · Fixed by #9489
Closed
1 task done

Cannot select DECIMAL lists via JDBC #9482

michaeljohnalbers opened this issue Oct 26, 2023 · 0 comments · Fixed by #9489

Comments

@michaeljohnalbers
Copy link
Contributor

michaeljohnalbers commented Oct 26, 2023

What happens?

When trying to run SELECT statements via JDBC where one of the selected columns is of DECIMAL[] type, the query fails throwing an exception.

To Reproduce

    public static void main(String[] args) throws SQLException{
        Connection c = DriverManager.getConnection("jdbc:duckdb:");
        try (Statement s = c.createStatement()) {
            s.execute("CREATE TABLE T1(a0 DECIMAL[])");
            s.executeQuery("SELECT * from T1");
        }
    }

Exception

Exception in thread "main" java.lang.NumberFormatException: For input string: "(18,3)[]"
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
	at java.base/java.lang.Integer.parseInt(Integer.java:654)
	at java.base/java.lang.Short.parseShort(Short.java:137)
	at java.base/java.lang.Short.parseShort(Short.java:163)
	at org.duckdb.DuckDBColumnTypeMetaData.parseColumnTypeMetadata(DuckDBColumnTypeMetaData.java:16)
	at org.duckdb.DuckDBResultSetMetaData.<init>(DuckDBResultSetMetaData.java:38)
	at org.duckdb.DuckDBNative.duckdb_jdbc_prepared_statement_meta(Native Method)
	at org.duckdb.DuckDBPreparedStatement.prepare(DuckDBPreparedStatement.java:107)
	at org.duckdb.DuckDBPreparedStatement.executeQuery(DuckDBPreparedStatement.java:189)
	at com.modeanalytics.nugget.arrow.FlightSqlServerTest.main(FlightSqlServerTest.java:184)

OS:

MacOS Ventura 13.6

DuckDB Version:

0.9.1

DuckDB Client:

JDBC

Full Name:

Michael Albers

Affiliation:

ThoughtSpot

Have you tried this on the latest main branch?

I have tested with a main build

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • Yes, I have
@michaeljohnalbers michaeljohnalbers changed the title Cannot access DECIMAL lists via JDBC Cannot select DECIMAL lists via JDBC Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant