Skip to content

[Bug] Quoting in the string-to-MAP cast rule cannot express an empty or literal-null key or value #9782

Description

@LuciferYang

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions