apache / apache/arrow-java

flight-sql-jdbc-driver: add option to rely on Arrow Flight SQL Bulk Ingestion for batched inserts

Đang mở
#931 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Type: enhancement
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

Arrow Flight SQL has a feature for ingesting massive datasets, Bulk Ingestion: https://github.com/apache/arrow/issues/38255
It would be beneficial to use those special RPC methods for batched prepared statement calls when the prepared statement is strictly for inserting data.
E.g. when Spark is used for writing data, it generates a simple SQL query like `"INSERT INTO table(field1, field2, ...) VALUES (?, ?, ...)"`, creates a prepared statement, and then uses the prepared statement update RPC method to insert the rows of the dataset. If this feature is implemented, it would be possible for the driver to instead use the `DoPut(CommandStatementIngest)` command associated with the Bulk Ingestion feature instead.

There are Arrow Flight SQL server implementations that work like this: when a `DoAction(ActionCreatePreparedStatementRequest)` is executed, the server creates up to two versions of the data structure underlying the instance of the PreparedStatement. One is a handle to a full-scale query engine execution procedure (e.g. DataFusion's logical plan), and another is a handle to a very simple procedure that just stores the received record batches in the storage - of course, the second procedure is only possible to be generated when the query is of a certain form; like the one used by Spark. The point is that this simple procedure also works without overheads associated with the more general interface of prepared statement API - for example, it does not need to do a transposition of PreparedStatement parameters into record batches.
I think that it should be possible to move this logic for deciding to use Bulk Ingestion into the jdbc driver.

Usecase for this integration is this: developers of Arrow Flight SQL servers could implement bulk ingestion command handlers and avoid implementing special logic for handling batched inserts in a special manner. Then the client would use this newly introduced driver option to allow the driver to decide to use the bulk ingestion RPC methods for inserting data.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng việc xem xét đường dẫn cập nhật prepared statement của JDBC driver và các RPC Flight SQL Bulk Ingestion, đặc biệt là DoPut(CommandStatementIngest) và ActionCreatePreparedStatementRequest. Xác định cách một tùy chọn nhận diện các batch statement đủ điều kiện chỉ thực hiện thao tác insert và định tuyến chúng qua bulk ingestion, đồng thời duy trì khả năng tương thích với các prepared statement khác.

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
database
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.