apache / apache/arrow-java

[Java][FlightRPC] Handle binding parameters when server can't provide the expected type

オープン
#153 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
94
フォーク
152
平均マージ
3日 16時間
マージ済み PR(30日)
11

説明

### Describe the enhancement requested

Based on apache/arrow-java#156, we need to support the case where the server can't specify the expected type of a given parameter.

> Not all servers can always provide an accurate type for bind parameters. What should we do there? Note that ADBC uses NA/NullType as a wildcard/placeholder type here. This isn't specified in Flight SQL itself, but perhaps we could adopt that convention as well.

Proposal:
- When the server doesn't know the type of any of the parameters, it can just set the parameter schema to `null` (or alternatively, an empty schema).
- When the server doesn't know the type of only some of the parameters, it can just set the respective Field to `NullType`.
- Before we start binding values, we transform the `preparedStatement.getParameterSchema()` based on the types of the given `TypedValues`. If the Schema is empty/null, we create every Field for the schema based on the TypedValue type. Otherwise, we replace all NullType fields with a Field based on the TypedValue.

The only potential drawback I see with this approach is that NullTypes can't be used for parameters. That being said, I can't really think of a case why one would want to do that.

### Component(s)

Java

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

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

調査の方向性

まず、preparedStatement.getParameterSchema() から、バインディング前に使用される TypedValues まで、FlightRPC の prepared statement のバインディングを追跡します。null または空のスキーマ、および個々の NullType フィールドの処理を確認し、各パラメータスキーマフィールドが対応する TypedValue 型から導出されるときに補完が表示されることを確認します。

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

評価

技術スタック
java
領域
api
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

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

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