[ 
https://issues.apache.org/jira/browse/HIVE-30197?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated HIVE-30197:
----------------------------------
    Labels: pull-request-available  (was: )

> Variant: read primitive types TIME, TIMESTAMP_NANOS and TIMESTAMP_NTZ_NANOS
> ---------------------------------------------------------------------------
>
>                 Key: HIVE-30197
>                 URL: https://issues.apache.org/jira/browse/HIVE-30197
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: Denys Kuzmenko
>            Priority: Major
>              Labels: pull-request-available
>
> The variant spec defines primitive types 17 (TIME, microseconds since 
> midnight), 18 (TIMESTAMP_NANOS, nanoseconds
> since the epoch, UTC-adjusted) and 19 (TIMESTAMP_NTZ_NANOS). Hive's decoder 
> (serde2.variant.VariantUtil) has no
> cases for them:
> - rendering a value of type 17–19 (SELECT of the column, to_json, 
> variant_get(v, path, 'string')) fails with
>   UNKNOWN_PRIMITIVE_TYPE_IN_VARIANT{id=17};
> - VariantUtil.valueSize throws for them, so an object or array that contains 
> one cannot be read either.
> Iceberg's variant API writes these types (Variants.ofTime, 
> ofTimestamptzNanos, ofTimestampntzNanos).
> Proposal: decode 17–19 (getType, valueSize, getLong) and render them like the 
> existing types:
> - JSON (to_json, query results):
>   - TIME: "13:45:30.123456";
>   - TIMESTAMP_NANOS: "2024-01-15 13:45:30.123456789+00:00", in the session 
> time zone, as TIMESTAMP;
>   - TIMESTAMP_NTZ_NANOS: "2024-01-15 13:45:30.123456789", as TIMESTAMP_NTZ.
> - variant_get(v, path, 'string'): TIME as 13:45:30.123456, the nanosecond 
> timestamps as TIMESTAMP and TIMESTAMP_NTZ
>   are rendered today (2024-01-15T13:45:30.123456789Z).
> Typed conversions (to timestamp, bigint, ...) are HIVE-30172.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to