[
https://issues.apache.org/jira/browse/HIVE-30172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Denys Kuzmenko updated HIVE-30172:
----------------------------------
Description:
The opposite direction of HIVE-29773: HIVE-29773 builds a variant from a typed
value; this extracts a typed value
from a variant.
- CAST(v AS INT/BIGINT/DOUBLE/DECIMAL/BOOLEAN/DATE/TIMESTAMP/STRING ...),
following Spark's semantics: a variant
holding JSON null → NULL; a string → the raw string, not quoted JSON; an
incompatible value → error, or NULL for a
try_ form.
- Today only CAST(v AS STRING) works (it returns the JSON text, since
HIVE-30170). variant_get(v, path, type) covers
only some targets:
- its 'int' conversion wraps out-of-range values (HIVE-30186);
- typed conversions of the time types 17–19 return NULL.
- Define one conversion table and use it for both CAST and variant_get.
was:Basic expectation (Spark semantics). Today only CAST(v AS STRING) works,
and only after HIVE-30170.
> Support CAST from VARIANT to primitive types
> --------------------------------------------
>
> Key: HIVE-30172
> URL: https://issues.apache.org/jira/browse/HIVE-30172
> Project: Hive
> Issue Type: Sub-task
> Reporter: Denys Kuzmenko
> Priority: Major
>
> The opposite direction of HIVE-29773: HIVE-29773 builds a variant from a
> typed value; this extracts a typed value
> from a variant.
> - CAST(v AS INT/BIGINT/DOUBLE/DECIMAL/BOOLEAN/DATE/TIMESTAMP/STRING ...),
> following Spark's semantics: a variant
> holding JSON null → NULL; a string → the raw string, not quoted JSON; an
> incompatible value → error, or NULL for a
> try_ form.
> - Today only CAST(v AS STRING) works (it returns the JSON text, since
> HIVE-30170). variant_get(v, path, type) covers
> only some targets:
> - its 'int' conversion wraps out-of-range values (HIVE-30186);
> - typed conversions of the time types 17–19 return NULL.
> - Define one conversion table and use it for both CAST and variant_get.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)