You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Nishant Bangarwa (JIRA)" <ji...@apache.org> on 2018/06/30 02:25:00 UTC
[jira] [Comment Edited] (HIVE-20013) Add an Implicit cast to date
type for to_date function
[ https://issues.apache.org/jira/browse/HIVE-20013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16528502#comment-16528502 ]
Nishant Bangarwa edited comment on HIVE-20013 at 6/30/18 2:24 AM:
------------------------------------------------------------------
[~ashutoshc] failures are unrelated to this patch, please merge.
was (Author: nishantbangarwa):
[~ashutoshc] please merge.
> Add an Implicit cast to date type for to_date function
> ------------------------------------------------------
>
> Key: HIVE-20013
> URL: https://issues.apache.org/jira/browse/HIVE-20013
> Project: Hive
> Issue Type: Bug
> Reporter: Nishant Bangarwa
> Assignee: Nishant Bangarwa
> Priority: Major
> Attachments: HIVE-20013.patch
>
>
> Issue -
> SELECT TO_DATE(date1), TO_DATE(datetime1) FROM druid_table_n1;
> Running this query on Druid returns null values when date1 and datetime1 are of type String.
> {code}
> INFO : Executing command(queryId=hive_20180627144822_d4395567-e3cb-4b20-b53b-4e5eba2d7dac): EXPLAIN SELECT TO_DATE(datetime0) ,TO_DATE(date0) FROM calcs
> INFO : Starting task [Stage-1:EXPLAIN] in serial mode
> INFO : Completed executing command(queryId=hive_20180627144822_d4395567-e3cb-4b20-b53b-4e5eba2d7dac); Time taken: 0.003 seconds
> INFO : OK
> +----------------------------------------------------+
> | Explain |
> +----------------------------------------------------+
> | Plan optimized by CBO. |
> | |
> | Stage-0 |
> | Fetch Operator |
> | limit:-1 |
> | Select Operator [SEL_1] |
> | Output:["_col0","_col1"] |
> | TableScan [TS_0] |
> | Output:["vc","vc0"],properties:{"druid.fieldNames":"vc,vc0","druid.fieldTypes":"date,date","druid.query.json":"{\"queryType\":\"scan\",\"dataSource\":\"druid_tableau.calcs\",\"intervals\":[\"1900-01-01T00:00:00.000Z/3000-01-01T00:00:00.000Z\"],\"virtualColumns\":[{\"type\":\"expression\",\"name\":\"vc\",\"expression\":\"timestamp_floor(\\\"datetime0\\\",'P1D','','UTC')\",\"outputType\":\"LONG\"},{\"type\":\"expression\",\"name\":\"vc0\",\"expression\":\"timestamp_floor(\\\"date0\\\",'P1D','','UTC')\",\"outputType\":\"LONG\"}],\"columns\":[\"vc\",\"vc0\"],\"resultFormat\":\"compactedList\"}","druid.query.type":"scan"} |
> | |
> +----------------------------------------------------+
> 10 rows selected (0.606 seconds)
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)