hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <>
Subject [jira] [Work logged] (HIVE-24157) Strict mode to fail on CAST timestamp <-> numeric
Date Thu, 01 Oct 2020 10:44:00 GMT


ASF GitHub Bot logged work on HIVE-24157:

                Author: ASF GitHub Bot
            Created on: 01/Oct/20 10:43
            Start Date: 01/Oct/20 10:43
    Worklog Time Spent: 10m 
      Work Description: kgyrtkirk commented on a change in pull request #1497:

File path: ql/src/test/queries/clientnegative/strict_numeric_to_timestamp.q
@@ -0,0 +1,2 @@
+set hive.strict.timestamp.conversion=true;
+select cast(123 as timestamp);

Review comment:
       good catch! I didn't expected that `=` will work without casting - but since its using
the converters it could avoid these checks.
   I considered moving the check into the converters - however that would involved getting
a `SessionState` in serde I instead added 1 more check to cover all the comparisions.
Generic binary operator seem to don't auto-convert things ; `+` was complaining about adding
a timestamp and an integer - so I think we are good.

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.

For queries about this service, please contact Infrastructure at:

Issue Time Tracking

    Worklog Id:     (was: 493399)
    Time Spent: 1h  (was: 50m)

> Strict mode to fail on CAST timestamp <-> numeric
> -------------------------------------------------
>                 Key: HIVE-24157
>                 URL:
>             Project: Hive
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Zoltan Haindrich
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h
>  Remaining Estimate: 0h
> There is some interest in enforcing that CAST numeric <\-> timestamp is disallowed
to avoid confusion among users, e.g., SQL standard does not allow numeric <\-> timestamp
casting, timestamp type is timezone agnostic, etc.
> We should introduce a strict config for timestamp (similar to others before): If the
config is true, we shall fail while compiling the query with a meaningful message.
> To provide similar behavior, Hive has multiple functions that provide clearer semantics
for numeric to timestamp conversion (and vice versa):

This message was sent by Atlassian Jira

View raw message