apache / apache/arrow-java

Bug Report: Column Nullability Not Honored in FlightSqlProducer Schema

未關閉
#782 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
Type: bug
主要語言
Java
星號
94
分支
152
平均合併
3 天 16 小時
30 天內合併 PR
11

描述

### 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.

貢獻指南

開啟貢獻指南

研究方向

從 org.apache.arrow.driver.jdbc.utils.ConvertUtils.convertArrowFieldsToColumnMetaDataList() 開始,該方法會將 Arrow Field 物件轉換為 Flight SQL 驅動程式的 ColumnMetaData 執行個體。檢查 ColumnMetaData.Builder 的填入方式,並驗證產生的中繼資料是否保留每個欄位的 nullability。nullable 和 non-nullable 的 Arrow 欄位能夠公開相符的 ResultSetMetaData 值即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
java
領域
databases
Issue 類型
缺陷
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
描述清楚
新手友好度
55/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。