Bug Report: Column Nullability Not Honored in FlightSqlProducer Schema
- Vorherrschende Sprache
- Java
- Sterne
- 94
- Forks
- 152
- Ø Merge
- 3 T. 16 Std.
- Gemergte PRs (30 T.)
- 11
Beschreibung
### 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.
Beitragsleitfaden
Rechercherichtung
Beginnen Sie mit org.apache.arrow.driver.jdbc.utils.ConvertUtils.convertArrowFieldsToColumnMetaDataList(), das Arrow Field-Objekte für den Flight SQL-Treiber in ColumnMetaData-Instanzen umwandelt. Prüfen Sie, wie ColumnMetaData.Builder befüllt wird, und stellen Sie sicher, dass die resultierenden Metadaten die Nullbarkeit jedes Feldes beibehalten. Als erledigt gilt die Aufgabe, wenn nullable und non-nullable Arrow-Felder übereinstimmende ResultSetMetaData-Werte liefern.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- databases
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 55/100