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

UHUGEINT columns cause errors when trying to export results to ArrowReader #11833

Open
2 tasks done
kirankpandi opened this issue Apr 25, 2024 · 0 comments
Open
2 tasks done

Comments

@kirankpandi
Copy link

What happens?

UHUGEINT columns doesn't seem to be getting mapped to Arrow types when exporting results to ArrowReader. This results in the error - Unsupported Arrow type UHUGEINT, when trying to get vector schema.

To Reproduce

Run the java code below with DuckDB 0.10.2. For the SQL with HUGEINT, the column in result gets properly mapped to DECIMAL. But the SQL with UHUGEINT results in an exception.

public class UHugeIntTest {

    public static void main(String[] args) throws SQLException, IOException {
        String[] sql = new String[] {"select val from (VALUES (1::HUGEINT)) TestVals(val)",
                "select val from (VALUES (1::UHUGEINT)) TestVals(val)"};

        ArrowReader arrowReader = null;
        try(BufferAllocator allocator = new RootAllocator();
            Connection connection = DriverManager.getConnection("jdbc:duckdb:");
            Statement statement = connection.createStatement()) {
            for(int i = 0; i < sql.length; i++) {
                System.out.println("SQL =====> " + sql[i]);
                try(ResultSet rs = statement.executeQuery(sql[i])) {
                    arrowReader = (ArrowReader)((DuckDBResultSet) rs).arrowExportStream(allocator, 256);
                    try {
                        VectorSchemaRoot schemaRoot = arrowReader.getVectorSchemaRoot();
                        for(FieldVector vector: schemaRoot.getFieldVectors()) {
                            System.out.println(vector.getField().getName() + "->" + vector.getField().getFieldType().getType());
                        }
                    } catch (IOException e) {
                        e.printStackTrace();
                    } finally {
                        if(arrowReader != null) {
                            arrowReader.close();
                        }
                    }
                }
            }
        }
    }
}

OS:

Mac

DuckDB Version:

0.10.2

DuckDB Client:

Java

Full Name:

Kiran Pandi

Affiliation:

Thoughtspot

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a stable release

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

  • Yes, I have
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants