-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Document the base arrow module #23212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
bec42e9
57e5e62
983f028
d6e4767
198130a
7bb6aab
9b5fff2
282c57c
57609d2
2d16e80
83506cb
660e9b2
5bee331
ca2e60e
f3a24a6
80d4e30
330eb8a
d423096
b3e26c8
b19cf94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,106 @@ | ||||||
|
|
||||||
| ====================== | ||||||
| Arrow-flight Connector | ||||||
| ====================== | ||||||
| This connector allows querying multiple data sources that are supported by an Arrow Flight server. | ||||||
| Apache Arrow enhances performance and efficiency in data-intensive applications through its columnar memory layout, zero-copy reads, vectorized execution, cross-language interoperability, rich data type support, and optimization for modern hardware. These features collectively reduce overhead, improve data processing speeds, and facilitate seamless data exchange between different systems and languages. | ||||||
|
|
||||||
| Getting Started with base-arrow-module: Essential Abstract Methods for Developers | ||||||
| -------------- | ||||||
| To utilize the base-arrow-module, you need to implement certain abstract methods that are specific to your use case. Below are the required classes and their purposes: | ||||||
|
|
||||||
| * ``ArrowFlightClientHandler.java`` | ||||||
| This class is responsible for initializing the Flight client and retrieving Flight information from the Flight server. To authenticate the Flight server, you must implement the abstract method ``getCallOptions`` in ArrowFlightClientHandler, which returns the ``CredentialCallOption`` specific to your Flight server. | ||||||
|
|
||||||
| * ``ArrowAbstractFlightRequest.java`` | ||||||
| Implement this class to define the request data, including the data source type, connection properties, the number of partitions and other data required to interact with database. | ||||||
|
|
||||||
| * ``ArrowAbstractMetadata.java`` | ||||||
| To retrieve metadata (schema and table information), implement the abstract methods in the ArrowAbstractMetadata class. | ||||||
|
|
||||||
| * ``ArrowAbstractSplitManager.java`` | ||||||
| Extend the ArrowAbstractSplitManager class to implement the Arrow flight request, defining the Arrow split. | ||||||
|
|
||||||
| * ``ArrowPlugin.java`` | ||||||
| Register your connector name by extending the ArrowPlugin class. | ||||||
|
|
||||||
| Configuration | ||||||
| ------------- | ||||||
| To configure the Arrow connector, create a catalog file | ||||||
| in ``etc/catalog`` named, for example, ``arrowmariadb.properties``, to | ||||||
| mount the Arrow-flight connector as the ``arrowmariadb`` catalog. | ||||||
| Create the file with the following contents, replacing the | ||||||
| connection properties as appropriate for your setup: | ||||||
|
|
||||||
|
|
||||||
| .. code-block:: none | ||||||
|
|
||||||
|
|
||||||
| connector.name=<CONNECTOR_NAME> | ||||||
|
|
||||||
| arrow-flight.server=<SERVER_ENDPOINT> | ||||||
| arrow-flight.server.port=<SERVER_PORT> | ||||||
|
|
||||||
| data-source.name=<DATASOURCE_NAME> | ||||||
| data-source.host=<HOST> | ||||||
| data-source.database=<DATABASE_NAME> | ||||||
| data-source.username=<USERNAME> | ||||||
| data-source.password=<PASSWORD> | ||||||
| data-source.port=<PORT> | ||||||
| data-source.ssl=<TRUE/FALSE> | ||||||
|
|
||||||
| Add other properties that are required for your Flight server to connect. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Formatting suggestion, because this sentence does not appear to be part of the code block. |
||||||
|
|
||||||
| ========================================== ============================================================== | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest adding a third column to this table for Default values. |
||||||
| Property Name Description | ||||||
| ========================================== ============================================================== | ||||||
| ``arrow-flight.server`` Endpoint of arrow-flight server | ||||||
| ``arrow-flight.server.port`` Flight server port | ||||||
| ``data-source.name`` Datasource name | ||||||
| ``data-source.host`` Hostname of the database | ||||||
| ``data-source.database`` Database name | ||||||
| ``data-source.username`` Username of database | ||||||
| ``data-source.password`` Password of database | ||||||
| ``data-source.port`` Database port | ||||||
| ``data-source.ssl`` Enable SSL for datasource True/False | ||||||
| ``arrow-flight.server-ssl-certificate`` Pass ssl certificate | ||||||
| ``arrow-flight.server.verify`` To verify server | ||||||
| ``arrow-flight.server-ssl-enabled`` Port is ssl enabled | ||||||
| ========================================== ============================================================== | ||||||
|
|
||||||
| Querying Arrow-Flight | ||||||
| --------------------- | ||||||
|
|
||||||
| The Arrow-Flight connector provides schema for each supported *databases*. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| Example for MariaDB is shown below. | ||||||
| To see the available schemas, run ``SHOW SCHEMAS``:: | ||||||
|
|
||||||
| SHOW SCHEMAS FROM arrowmariadb; | ||||||
|
|
||||||
| To view the tables in the MariaDB database named ``user``, | ||||||
| run ``SHOW TABLES``:: | ||||||
|
|
||||||
| SHOW TABLES FROM arrowmariadb.user; | ||||||
|
|
||||||
| To see a list of the columns in the ``admin`` table in the ``user`` database, | ||||||
| use either of the following commands:: | ||||||
|
|
||||||
| DESCRIBE arrowmariadb.user.admin; | ||||||
| SHOW COLUMNS FROM arrowmariadb.user.admin; | ||||||
|
|
||||||
| Finally, you can access the ``admin`` table in the ``user`` database:: | ||||||
|
|
||||||
| SELECT * FROM arrowmariadb.user.admin; | ||||||
|
|
||||||
| If you used a different name for your catalog properties file, use | ||||||
| that catalog name instead of ``arrowmariadb`` in the above examples. | ||||||
|
|
||||||
|
|
||||||
| Arrow-Flight Connector Limitations | ||||||
| --------------------------------- | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Warning in local doc build: |
||||||
|
|
||||||
| * SELECT and DESCRIBE queries are supported by this connector template. Implementing modules can add support for additional features. | ||||||
|
steveburnett marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| * Arrow-connector can query against only those datasources which are supported by Flight server. | ||||||
|
|
||||||
| * The customer should have the flight server running for the arrow-connector to work. | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The formatting
--------must be as long as the text in the preceding line. Currently, a warning is generated in the local doc build as follows:/Users/steveburnett/Documents/GitHub/presto/presto-docs/src/main/sphinx/connector/base-arrow-flight.rst:9: WARNING: Title underline too short.