[
https://issues.apache.org/jira/browse/HIVE-24778?focusedWorklogId=554265&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-554265
]
ASF GitHub Bot logged work on HIVE-24778:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 18/Feb/21 14:24
Start Date: 18/Feb/21 14:24
Worklog Time Spent: 10m
Work Description: zabetak commented on a change in pull request #1982:
URL: https://github.com/apache/hive/pull/1982#discussion_r578457991
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/udf/TimestampCastRestrictorResolver.java
##########
@@ -45,7 +45,7 @@
public TimestampCastRestrictorResolver(UDFMethodResolver parentResolver) {
this.parentResolver = parentResolver;
SessionState ss = SessionState.get();
- if (ss != null &&
ss.getConf().getBoolVar(ConfVars.HIVE_STRICT_TIMESTAMP_CONVERSION)) {
+ if (ss != null &&
ss.getConf().getBoolVar(ConfVars.HIVE_STRICT_CHECKS_TYPE_SAFETY)) {
Review comment:
Small observation: the first example does not reflect the situation in
current master. In HIVE-23100, the checks were moved from
`ExprNodeGenericFuncDesc` to `TypeCheckProcFactory`.
It is true that at the moment `UDFToBoolean`, `UDFToByte`, `UDFToDouble`,
etc., are not checked by `TypeCheckProcFactory`; I am not sure if this needs to
change or not. In that sense if we want to enforce type checks we need to do it
in another way as it is done here with the resolver.
The timestamp resolver only checks the case for timestamp/dates but there
are other lossy conversions (e.g., BigInt to double) for which we are doing
nothing. I assume that if somebody does `CAST( bigint as double)` the query
will run without raising an error even if strict checks are enabled.
Taking it on the other way around currently if somebody does `CAST (date as
double)` the query will run or fail depending on the value of the strict checks
property.
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 554265)
Time Spent: 1h (was: 50m)
> Unify hive.strict.timestamp.conversion and hive.strict.checks.type.safety
> properties
> ------------------------------------------------------------------------------------
>
> Key: HIVE-24778
> URL: https://issues.apache.org/jira/browse/HIVE-24778
> Project: Hive
> Issue Type: Sub-task
> Affects Versions: 4.0.0
> Reporter: Stamatis Zampetakis
> Priority: Major
> Labels: pull-request-available
> Fix For: 4.0.0
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> The majority of strict type checks can be controlled by
> {{hive.strict.checks.type.safety}} property. HIVE-24157 introduced another
> property, namely {{hive.strict.timestamp.conversion}}, to control the
> implicit comparisons between numerics and timestamps.
> The name and description of {{hive.strict.checks.type.safety}} imply that the
> property covers all strict checks so having others for specific cases appears
> confusing and can easily lead to unexpected behavior.
> The goal of this issue is to unify those properties to facilitate
> configuration and improve code reuse.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)