Search before asking
Version
Apache Doris 4.1.3-rc02, commit 31263df4dc1d4d3a27517d264802cd4d6b92c874
Client: Python + ADBC Flight SQL driver (adbc_driver_flightsql), FE arrow_flight_sql_port = 41070.
The MySQL/JDBC protocol is used as the control path for comparison.
What's Wrong?
When an Iceberg catalog is configured with "enable.mapping.varbinary" = "false", Doris Flight SQL declares an arbitrary BINARY column as Arrow string, but the payload actually contains non-UTF-8 bytes.
PyArrow fails before returning any row:
UnicodeDecodeError (byte 0x84)
The Arrow schema for the query is id: int32, col1: string, col2: string. JDBC reads the same Iceberg rows without a problem, and with VARBINARY mapping enabled the ADBC binary read works.
What You Expected?
The Arrow type declared by the server and the encoding of the payload must agree. Arbitrary binary content should be sent as binary/large_binary, or, if it is sent as string, it must be a valid UTF-8 representation.
How to Reproduce?
- Bring up the Iceberg regression fixture.
- Create or use an Iceberg catalog with
"enable.mapping.varbinary" = "false".
SWITCH to that catalog and USE test_varbinary.
- Run the query over Python ADBC, inspect the schema and call
to_pylist().
SWITCH test_iceberg_no_mapping;
USE test_varbinary;
SELECT * FROM test_ice_uuid_orc ORDER BY id;
Client side:
import adbc_driver_flightsql.dbapi as flight_sql
conn = flight_sql.connect(uri="grpc://127.0.0.1:41070",
db_kwargs={"username": "root", "password": ""})
cur = conn.cursor()
cur.execute("SELECT * FROM test_iceberg_no_mapping.test_varbinary.test_ice_uuid_orc ORDER BY id")
table = cur.fetch_arrow_table()
print(table.schema) # id: int32, col1: string, col2: string
print(table.to_pylist()) # UnicodeDecodeError on byte 0x84
Anything Else?
Without VARBINARY mapping, the Iceberg binary/uuid column falls back to the Doris STRING type, and the Arrow conversion follows that declared type rather than the real content. Since Arrow string is defined as UTF-8, any consumer that validates the encoding (PyArrow does) fails on the whole batch.
Workaround: set "enable.mapping.varbinary" = "true" on the Iceberg catalog so the column is returned through the Arrow binary type.
Found with the external_table_p0/iceberg/test_iceberg_varbinary fixture; four no-mapping cases are affected, while the mapping-enabled binary reads keep passing over ADBC.
Tracking issue: #65615
Are you willing to submit PR?
Code of Conduct
Search before asking
Version
Apache Doris 4.1.3-rc02, commit
31263df4dc1d4d3a27517d264802cd4d6b92c874Client: Python + ADBC Flight SQL driver (
adbc_driver_flightsql), FEarrow_flight_sql_port= 41070.The MySQL/JDBC protocol is used as the control path for comparison.
What's Wrong?
When an Iceberg catalog is configured with
"enable.mapping.varbinary" = "false", Doris Flight SQL declares an arbitraryBINARYcolumn as Arrowstring, but the payload actually contains non-UTF-8 bytes.PyArrow fails before returning any row:
The Arrow schema for the query is
id: int32, col1: string, col2: string. JDBC reads the same Iceberg rows without a problem, and with VARBINARY mapping enabled the ADBC binary read works.What You Expected?
The Arrow type declared by the server and the encoding of the payload must agree. Arbitrary binary content should be sent as
binary/large_binary, or, if it is sent asstring, it must be a valid UTF-8 representation.How to Reproduce?
"enable.mapping.varbinary" = "false".SWITCHto that catalog andUSE test_varbinary.to_pylist().Client side:
Anything Else?
Without VARBINARY mapping, the Iceberg
binary/uuidcolumn falls back to the DorisSTRINGtype, and the Arrow conversion follows that declared type rather than the real content. Since Arrowstringis defined as UTF-8, any consumer that validates the encoding (PyArrow does) fails on the whole batch.Workaround: set
"enable.mapping.varbinary" = "true"on the Iceberg catalog so the column is returned through the Arrowbinarytype.Found with the
external_table_p0/iceberg/test_iceberg_varbinaryfixture; four no-mapping cases are affected, while the mapping-enabled binary reads keep passing over ADBC.Tracking issue: #65615
Are you willing to submit PR?
Code of Conduct