You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Bohdan Kazydub (JIRA)" <ji...@apache.org> on 2018/10/03 13:36:00 UTC
[jira] [Updated] (DRILL-6768) Improve to_date, to_time and
to_timestamp and corresponding cast functions to handle empty string when
`drill.exec.functions.cast_empty_string_to_null` option is enabled
[ https://issues.apache.org/jira/browse/DRILL-6768?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bohdan Kazydub updated DRILL-6768:
----------------------------------
Description:
When `drill.exec.functions.cast_empty_string_to_null` option is enabled
`to_date`, `to_time` and `to_timestamp` functions while converting string to according type in case if null or empty string values are passed will return NULL (to avoid CASE clauses which are littering a query and will work in accordance with their respective CAST counterparts) for both cases.
CASTs will be handled in a similar way (uniformly with numeric types):
||Value to cast||Now||Will be||
|NULL|NULL|NULL|
|'' (empty string)|Error in many cases (except numerical types)|NULL|
was:
When `drill.exec.functions.cast_empty_string_to_null` option is enabled
`to_date`, `to_time` and `to_timestamp` functions while converting string to according type in case if null or empty string values are passed will return NULL (to avoid CASE clauses which are littering a query and will work uniformly with numeric types) for both cases.
CASTs will be handled in a similar way:
||Value to cast||Now||Will be||
|NULL|NULL|NULL|
|'' (empty string)|Error in many cases (except numerical types)|NULL|
> Improve to_date, to_time and to_timestamp and corresponding cast functions to handle empty string when `drill.exec.functions.cast_empty_string_to_null` option is enabled
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: DRILL-6768
> URL: https://issues.apache.org/jira/browse/DRILL-6768
> Project: Apache Drill
> Issue Type: Improvement
> Reporter: Bohdan Kazydub
> Assignee: Bohdan Kazydub
> Priority: Minor
>
> When `drill.exec.functions.cast_empty_string_to_null` option is enabled
> `to_date`, `to_time` and `to_timestamp` functions while converting string to according type in case if null or empty string values are passed will return NULL (to avoid CASE clauses which are littering a query and will work in accordance with their respective CAST counterparts) for both cases.
>
>
>
> CASTs will be handled in a similar way (uniformly with numeric types):
>
> ||Value to cast||Now||Will be||
> |NULL|NULL|NULL|
> |'' (empty string)|Error in many cases (except numerical types)|NULL|
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)