-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Java][FlightSQL] Column Duplication When Selecting from no result record in Arrow Flight SQL JDBC Driver #44467
Comments
I've been building each Flight SQL-related branch following the Arrow 15.0.0 release and identified an issue occurring after commit [GH-33475: Add parameter binding for Prepared Statements in JDBC driver (#38404)]. After debugging last week, I observed the following: When querying from DBeaver, the
The addition is needed for parameter binding, yet it introduces an issue where columns are appended repeatedly. During execution, the @Override
public FlightInfo executeFlightInfoQuery() throws SQLException {
final PreparedStatement preparedStatement = getConnection().getMeta().getPreparedStatement(handle);
final Meta.Signature signature = getSignature();
if (signature == null) {
return null;
}
final Schema resultSetSchema = preparedStatement.getDataSetSchema();
signature.columns.addAll(ConvertUtils.convertArrowFieldsToColumnMetaDataList(resultSetSchema.getFields()));
setSignature(signature);
return preparedStatement.executeQuery();
} With every query, the signature column set is duplicated and propagated. In cases where the result has endpoints (e.g., a typical To address this, I temporarily fixed the issue by simply calling clear on the column list before adding new columns. @Override
public FlightInfo executeFlightInfoQuery() throws SQLException {
final PreparedStatement preparedStatement = getConnection().getMeta().getPreparedStatement(handle);
final Meta.Signature signature = getSignature();
if (signature == null) {
return null;
}
final Schema resultSetSchema = preparedStatement.getDataSetSchema();
signature.columns.clear();
signature.columns.addAll(ConvertUtils.convertArrowFieldsToColumnMetaDataList(resultSetSchema.getFields()));
setSignature(signature);
return preparedStatement.executeQuery();
} However, I believe a more fundamental solution could be beneficial here. Could anyone provide insights or assistance? |
Describe the bug, including details regarding any error messages, version, and platform.
I encountered an issue when working with Arrow Flight SQL, and I would appreciate your help.
I created a test_table with the following columns:
When I run a
SELECT *
query without inserting any data into the table, the columns appear duplicated.I get the following output:
I am developing the database myself, using Rust and connecting through FlightSQL.
When executing SELECT clause and the table is empty, I handle this by returning an endpoint with empty endpoint in the
get_flight_info
method.This did not occur in Arrow Flight SQL JDBC Driver versions prior to 15.0.0, but it started happening with version 15.0.0.
Component(s)
Java
The text was updated successfully, but these errors were encountered: