Python3.9 用Arrow Flight SQL读取doris失败

Viewed 48

1、安装py包 python3.9
pip install adbc_driver_manager
pip install adbc_driver_flightsql
pip install pyarrow

2、测试代码
import adbc_driver_manager
import adbc_driver_flightsql.dbapi as flight_sql
conn = flight_sql.connect(uri="grpc+tcp://192.168.96.1:9081", db_kwargs={
adbc_driver_manager.DatabaseOptions.USERNAME.value: "demo",
adbc_driver_manager.DatabaseOptions.PASSWORD.value: "123456",
})
cursor = conn.cursor()
cursor.execute("DROP DATABASE IF EXISTS arrow_flight_sql FORCE;")
print(cursor.fetchallarrow().to_pandas())
3、执行错误
warnings.warn(
Traceback (most recent call last):
File "/Users/ljm/PycharmProjects/pythonProject/pyarrowdoris.py", line 51, in
demo2()
File "/Users/ljm/PycharmProjects/pythonProject/pyarrowdoris.py", line 46, in demo2
cursor.execute("DROP DATABASE IF EXISTS arrow_flight_sql FORCE;")
File "/opt/anaconda3/envs/pythonProject/lib/python3.9/site-packages/adbc_driver_manager/dbapi.py", line 698, in execute
handle, self._rowcount = _blocking_call(
File "adbc_driver_manager/_lib.pyx", line 1569, in adbc_driver_manager._lib._blocking_call_impl
File "adbc_driver_manager/_lib.pyx", line 1562, in adbc_driver_manager._lib._blocking_call_impl
File "adbc_driver_manager/_lib.pyx", line 1213, in adbc_driver_manager._lib.AdbcStatement.execute_query
File "adbc_driver_manager/_lib.pyx", line 260, in adbc_driver_manager._lib.check_error
adbc_driver_manager.NotSupportedError: NOT_IMPLEMENTED: [FlightSQL] GetFlightInfoStatement not implemented (Unimplemented; ExecuteQuery)

2 Answers

/opt/anaconda3/envs/Py_DaYu/bin/python /Users/l/PycharmProjects/Py_DaYu/demo/arrowsql.py
1.1.0
1.1.0