deniskuzZ commented on PR #6185: URL: https://github.com/apache/hive/pull/6185#issuecomment-3542006322
> in our case: `try_variant_get` should return `null`, in case someone wants `null` he should use `try_variant_get` > > ``` > name = "try_variant_get", > value = "_FUNC_(variant, path[, type]) - Extracts a sub-variant from variant according to path, and casts it to type. Returns null on error.", > extended = """ > ``` ✅ variant_get Throws an error if the extraction fails Errors happen when: - JSONPath is invalid (syntax error) - The value cannot be converted to the requested type - The variant structure is malformed If the path is valid but does not match anything, Iceberg returns NULL (same as normal JSONPath behavior) ✔️ Safe for normal use ✖️ Not safe if the data may be malformed ✅ try_variant_get Never throws an error If anything goes wrong, it returns NULL It swallows: - Invalid JSONPath syntax - Type conversion failures - Unexpected data types - Corrupted or partial JSON/VARIANT values ✔️ Safe for messy/unknown data ✔️ Useful for schema evolution ✔️ Good in SELECT queries where one bad row would otherwise fail the job -- 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]
