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
Hi @JNSimba, I'm planning take this on, because this requires casting in spark and is inconvenient to use. For example, cannot directly use size > 0 in SQL as an example.
However, there's no easy way to allow backward compatibility since Array is currently converted to a String for querying. Not to mention, the real fix should ideally come from up-stream to include the element-type instead of inferring it.
Do you already have any ideas or suggestions on how to go about solving this issue? No worries, if not, I'll get back with a few suggestions before I even begin to implement.
On a side note, maybe worth opening up github discussions for such conversations?
Hi @JNSimba, I'm planning take this on, because this requires casting in spark and is inconvenient to use. For example, cannot directly use size > 0 in SQL as an example.
However, there's no easy way to allow backward compatibility since Array is currently converted to a String for querying. Not to mention, the real fix should ideally come from up-stream to include the element-type instead of inferring it.
Do you already have any ideas or suggestions on how to go about solving this issue? No worries, if not, I'll get back with a few suggestions before I even begin to implement.
On a side note, maybe worth opening up github discussions for such conversations?
How to obtain the array element type. I'm not sure whether the Arrow result returned from Doris carries the child type directly — if it does, we can use it as-is; if not, we'd have to fall back to inferring the element type from the data. (A best approach would be to rely on the /schema API from FE to get the precise type, but that ties this fix to a Doris-side change/upgrade, which probably isn't great for iteration speed on the connector side.)
Backward compatibility via a config option. Since arrays are currently exposed as String, switching to a real ArrayType is a behavior change for existing users (their downstream SQL/casting logic could break). I think we should gate the new behavior behind a config (e.g. something like doris.read.array.native-type, defaulting to the old behavior for now, or with a clear deprecation path) so users can opt in.
Happy to discuss further — either by opening GitHub Discussions on the Doris repo, or by creating a dedicated design issue, whichever you prefer
Hi @JNSimba, apologies for getting back late, agreed on both fronts, while the long term fix would need the support upstream first or could potentially hack our way through using DESCRIBE via JDBC. For V1, good to keep that out of scope. As you suggested, I introduced a flag for backward compatibility and raised a PR.
Activity
kaori-seasons commentedon Nov 3, 2025
The following is my proposed solution for this issue; I will begin implementing the interim plan.
I. Current Status Assessment
1.1 Current Support
Write Path supports three formats:
Arrow Format (Recommended, fully supported)
DorisArrayWriterclass implements Arrow serialization for arrayscreateFieldWriterimplementationCSV/JSON Format (Limited support)
[1,2,3]Test Verification
1.2 Main Issues
Read Path Limitations:
StringTypetoString()II. Detailed Development Plan
2.1 Mid-term Solution (Enhanced Read Support)
Goal: Implement native ArrayType support in read path
Development Task List:
Modify Schema Mapping Logic
SchemaConvertors.scalaArrayType(elementType)instead ofStringTypeEnhance RowBatch Conversion Logic
RowBatch.javaImplement New Array Converter
Effort Estimation:
2.2 Long-term Solution (Complete Complex Type Support)
Goal: Unified complex type handling for read/write paths
III. Implementation Recommendations
3.1 Priority Ranking
3.2 Risk Assessment
Technical Risks:
Mitigation Measures:
3.3 Testing Strategy
Unit Tests
Integration Tests
IV. Code Examples
4.1 Currently Available Solution
4.2 Doris Table Creation SQL
addu390 commentedon May 25, 2026
Hi @JNSimba, I'm planning take this on, because this requires casting in spark and is inconvenient to use. For example, cannot directly use
size > 0in SQL as an example.However, there's no easy way to allow backward compatibility since
Arrayis currently converted to aStringfor querying. Not to mention, the real fix should ideally come from up-stream to include the element-type instead of inferring it.Do you already have any ideas or suggestions on how to go about solving this issue? No worries, if not, I'll get back with a few suggestions before I even begin to implement.
On a side note, maybe worth opening up github discussions for such conversations?
JNSimba commentedon May 27, 2026
@addu390 Great, thanks for picking this up!
A couple of things I think are worth considering:
How to obtain the array element type. I'm not sure whether the Arrow result returned from Doris carries the child type directly — if it does, we can use it as-is; if not, we'd have to fall back to inferring the element type from the data. (A best approach would be to rely on the
/schemaAPI from FE to get the precise type, but that ties this fix to a Doris-side change/upgrade, which probably isn't great for iteration speed on the connector side.)Backward compatibility via a config option. Since arrays are currently exposed as
String, switching to a realArrayTypeis a behavior change for existing users (their downstream SQL/casting logic could break). I think we should gate the new behavior behind a config (e.g. something likedoris.read.array.native-type, defaulting to the old behavior for now, or with a clear deprecation path) so users can opt in.Happy to discuss further — either by opening GitHub Discussions on the Doris repo, or by creating a dedicated design issue, whichever you prefer
addu390 commentedon May 30, 2026
Hi @JNSimba, apologies for getting back late, agreed on both fronts, while the long term fix would need the support upstream first or could potentially hack our way through using
DESCRIBEvia JDBC. For V1, good to keep that out of scope. As you suggested, I introduced a flag for backward compatibility and raised a PR.addu390 commentedon Jun 6, 2026
Hi @JNSimba, when would the next release cut-off be?