LuciferYang commented on PR #56648:
URL: https://github.com/apache/spark/pull/56648#issuecomment-4770010084
Thanks @MaxGekk, good catches. Addressed them in the latest commit:
- **Custom syntax**: added a test using `prefix = "%{"`, `escape = '%'`,
`valueDelimiter = "|"`, including the escaped `%%{x}`.
- **Mixed unresolved/resolved**: with exceptions disabled, pinned that
`"${undefined} ${x}"` -> `"${undefined} X"`, so the scan keeps going past an
unresolved placeholder.
- **Null value**: the only caller, `ErrorClassesJSONReader`, already maps
null params to the string `"null"` before building the substitutor, so I
defined the same behavior here -- `value.toString` -> `String.valueOf(value)`,
which renders null as `"null"` instead of NPEing. I avoided "treat as
undefined" since the key is actually present, and that would throw `Undefined
variable` by default. Added a test for it.
- **Placeholders inside a default value**: pinned that they are not expanded
-- the first `}` closes the placeholder, so `"${undefined:-${x}}"` -> `"${x}"`.
Also covered `${}` (empty name, no default) and strengthened the
cycle-detection check to assert the `Infinite loop in property interpolation
of` prefix. The suite is 18 tests now.
--
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]