apache / apache/arrow-java

Bug Report: Column Nullability Not Honored in FlightSqlProducer Schema

オープン
#782 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
Type: bug
主要言語
Java
スター
94
フォーク
152
平均マージ
3日 16時間
マージ済み PR(30日)
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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Flight SQL ドライバー向けに Arrow Field オブジェクトを ColumnMetaData インスタンスへ変換する org.apache.arrow.driver.jdbc.utils.ConvertUtils.convertArrowFieldsToColumnMetaDataList() から始めます。ColumnMetaData.Builder がどのように設定されるかを確認し、生成されるメタデータが各フィールドの nullability を保持していることを検証します。nullable および non-nullable の Arrow フィールドが一致する ResultSetMetaData 値を公開すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
databases
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。