[
https://issues.apache.org/jira/browse/HIVE-30186?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Denys Kuzmenko updated HIVE-30186:
----------------------------------
Description:
GenericUDFVariantGet.toInteger does (int) value.getLong() and
value.getDecimal().intValue(), so an INT64 value of
4294967311 reads as 15. The result depends on shredding:
- unshredded: WHERE variant_get(payload, '$.event_id', 'int') = 15 returns the
row;
- shredded: row-group pruning (and HIVE-30176's file pruning) compares the real
long value and drops it.
Expected: an out-of-range value gives NULL or an error, never a wrapped value;
match Spark's variant_get. Check
toLong for the same DECIMAL pattern (longValue()).
> variant_get(v, path, 'int') wraps around for values outside the int range
> ---------------------------------------------------------------------------
>
> Key: HIVE-30186
> URL: https://issues.apache.org/jira/browse/HIVE-30186
> Project: Hive
> Issue Type: Sub-task
> Reporter: Denys Kuzmenko
> Priority: Major
>
> GenericUDFVariantGet.toInteger does (int) value.getLong() and
> value.getDecimal().intValue(), so an INT64 value of
> 4294967311 reads as 15. The result depends on shredding:
> - unshredded: WHERE variant_get(payload, '$.event_id', 'int') = 15 returns
> the row;
> - shredded: row-group pruning (and HIVE-30176's file pruning) compares the
> real long value and drops it.
> Expected: an out-of-range value gives NULL or an error, never a wrapped
> value; match Spark's variant_get. Check
> toLong for the same DECIMAL pattern (longValue()).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)