Bug Report: Column Nullability Not Honored in FlightSqlProducer Schema
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
Research direction
Start with org.apache.arrow.driver.jdbc.utils.ConvertUtils.convertArrowFieldsToColumnMetaDataList(), which converts Arrow Field objects into ColumnMetaData instances for the Flight SQL driver. Check how the ColumnMetaData.Builder is populated and verify that the resulting metadata preserves each field's nullability. Done means nullable and non-nullable Arrow fields expose matching ResultSetMetaData values.
Written by the indexing model from the issue text.
Description
Describe the bug, including details regarding any error messages, version, and platform.
In the FlightSqlProducer class, the getFlightInfoPreparedStatement method is responsible for returning the Arrow Schema of the ResultSet for a given query. However, the returned schema does not accurately reflect the nullability of columns. Regardless of whether a column is defined as nullable or non-nullable, the schema always returns a fixed nullability value.
This leads to incorrect ResultSetMetaData when the schema is consumed via the Flight SQL driver.
Root Cause:
The issue originates in the method:
org.apache.arrow.driver.jdbc.utils.ConvertUtils.convertArrowFieldsToColumnMetaDataList()
Here, a list of org.apache.arrow.vector.types.pojo.Field objects is converted into org.apache.calcite.avatica.ColumnMetaData instances. However, the setNullable property of the ColumnMetaData.Builder is not being set based on the actual nullability of the Arrow field.
Expected Behavior:
The setNullable method of ColumnMetaData.Builder should be updated to reflect the value of field.isNullable() from the Arrow schema.
Impact:
This bug results in incorrect metadata being exposed to clients using the Flight SQL driver, potentially leading to misinterpretation of the data schema.
- Dominant language
- Java
- Stars
- 95
- Forks
- 154
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 11
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/arrow-java
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
apache/arrow-java#1261 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/arrow-java#1236 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/arrow-java#1230 ·
-
Type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
apache/arrow-java#1205 ·
-
Type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
apache/arrow-java#1196 · 1 comment ·
All issues in apache/arrow-java
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Openbug frontend maui-pilot
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
objectionary/eo-graphs#74 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100