The three string-to-collection cast rules share a mini-language where quotes group a token across separators. StringToArrayCastRule and StringToRowCastRule now remember whether a token was quoted, so "" yields the empty string and "null" yields the four-character string rather than SQL NULL.
StringToMapCastRule still cannot do either. Its splitter works at the entry level (k -> v, k2 -> v2) and hands each entry to ENTRY_PATTERN to separate key from value, so by the time parseValue runs, the quote state of the individual key or value is gone. "" -> a loses the empty key and k -> "null" becomes a null value.
Fixing it needs quote-aware key/value splitting inside an entry rather than a regex over the already-stripped text, which is why it was left out of the array and row change.
The three string-to-collection cast rules share a mini-language where quotes group a token across separators.
StringToArrayCastRuleandStringToRowCastRulenow remember whether a token was quoted, so""yields the empty string and"null"yields the four-character string rather than SQL NULL.StringToMapCastRulestill cannot do either. Its splitter works at the entry level (k -> v, k2 -> v2) and hands each entry toENTRY_PATTERNto separate key from value, so by the timeparseValueruns, the quote state of the individual key or value is gone."" -> aloses the empty key andk -> "null"becomes a null value.Fixing it needs quote-aware key/value splitting inside an entry rather than a regex over the already-stripped text, which is why it was left out of the array and row change.