Gabriel39 commented on code in PR #69969:
URL: https://github.com/apache/doris/pull/69969#discussion_r4441176167
##########
be/src/core/data_type_serde/complex_type_deserialize_util.h:
##########
@@ -91,12 +91,16 @@ struct ComplexTypeDeserializeUtil {
static Status process_column(const DataTypeSerDeSPtr& serde, IColumn&
column, StringRef& str,
const DataTypeSerDe::FormatOptions& options) {
DCHECK(column.is_nullable()) << "Column must be nullable but got " <<
column.get_name();
- if (is_null_string(str)) {
+ // JSON owns its quotes and lowercase null: trimming "123" changes its
type,
+ // and treating null as SQL NULL loses a JSON value. Only uppercase
NULL is
+ // the SQL-null marker for a JSON child, matching
Nullable(JSONB)::to_string.
+ const bool is_jsonb = serde->is_jsonb();
+ if (is_jsonb ? str == StringRef("NULL", 4) : is_null_string(str)) {
auto& column_nullable = assert_cast<ColumnNullable&>(column);
column_nullable.insert_default();
return Status::OK();
}
- auto str_without_quote = str.trim_quote();
+ auto str_without_quote = is_jsonb ? str : str.trim_quote();
Review Comment:
Fixed in 18d4007838d. Nested-text parsing now belongs to the SerDe
implementations rather than a generic JSONB type check. JSONB removes a
matching SQL apostrophe wrapper while preserving JSON double quotes; Nullable
owns SQL-null insertion and strict/non-strict error handling. The new
legacy-input test reproduces the failure before the fix and covers 48
ARRAY/MAP/STRUCT combinations after it. All 33 related BE tests passed,
including deeper nesting, JSON versus SQL nulls and malformed children.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]