Bug Report: Column Nullability Not Honored in FlightSqlProducer Schema
- Lingua principale
- Java
- Stelle
- 94
- Fork
- 152
- Merge medio
- 3g 16h
- PR unite (30g)
- 11
Descrizione
### 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.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia da org.apache.arrow.driver.jdbc.utils.ConvertUtils.convertArrowFieldsToColumnMetaDataList(), che converte gli oggetti Arrow Field in istanze di ColumnMetaData per il driver Flight SQL. Verifica come viene popolato ColumnMetaData.Builder e assicurati che i metadati risultanti preservino la nullability di ogni campo. Il lavoro è completato quando i campi Arrow nullable e non-nullable espongono valori ResultSetMetaData corrispondenti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- databases
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 55/100