[Java][FlightRPC] Handle binding parameters when server can't provide the expected type
- Ngôn ngữ chính
- Java
- Star
- 94
- Fork
- 152
- Merge trung bình
- 3 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 11
Mô tả
### 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
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách lần theo quá trình binding prepared statement của FlightRPC từ preparedStatement.getParameterSchema() qua các TypedValues được sử dụng trước khi binding. Xác minh việc xử lý schema null hoặc rỗng và các trường NullType riêng lẻ, với completion được hiển thị khi mỗi trường trong parameter schema được suy ra từ kiểu TypedValue tương ứng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- api
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100