You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a9f0018
Browse filesBrowse the repository at this point in the historyBrowse files
[fix](jdbc) Keep the VARBINARY elements of a remote Doris array as STRING
### What problem does this PR solve?
Issue Number: None
Related PR: #62183, #55651
Problem Summary: Mapping a remote Doris VARBINARY to VARBINARY also
reached the element of an ARRAY column, because the Doris dialect maps
an array element through the same function. A remote view with
array(cast('abc' as varbinary(16))) then became ARRAY<VARBINARY>, and
reading it failed with "Unsupported array child type: VARBINARY": the
remote returns an array as text that spells each VARBINARY element as
0x hex ([0x616263, null, 0x]), and MySQLTypeHandler decodes array
elements from that text with no case for VARBINARY. Before the mapping
change the element was STRING and the column read as that text.
branch-4.x maps such a column to ARRAY<VARBINARY> as well and fails the
same way when it is read.
A VARBINARY element of a remote Doris array, nested or not, maps to
STRING again; only a top-level VARBINARY maps to VARBINARY.
### Release note
None
### Check List (For Author)
- Test: Unit Test / Regression test
- JdbcLogicalTypeMappingTest.remoteDorisVarbinaryArrayElementsStayString:
ARRAY<VARBINARY>, ARRAY<VARBINARY(16)> and ARRAY<ARRAY<VARBINARY(16)>>
keep STRING elements; all fe-connector-jdbc tests (251) pass.
- test_doris_jdbc_catalog_varbinary also reads a remote view with a
VARBINARY array; the .out was generated by the script.
- Behavior changed: No (compared with master)
- Does this need documentation: No
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Copy file name to clipboardExpand all lines: fe/fe-connector/fe-connector-jdbc/src/main/java/org/apache/doris/connector/jdbc/client/JdbcMySQLConnectorClient.java
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -332,6 +332,11 @@ private ConnectorType dorisTypeToConnectorType(String rawType, JdbcFieldInfo fie
332
332
if (upperType.startsWith("ARRAY")) {
333
333
// ARRAY<INNER_TYPE> -> extract inner type and recursively convert
Copy file name to clipboardExpand all lines: fe/fe-connector/fe-connector-jdbc/src/test/java/org/apache/doris/connector/jdbc/client/JdbcLogicalTypeMappingTest.java
0 commit comments