hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nishant Bangarwa (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-20013) Add an Implicit cast to date type for to_date function
Date Wed, 04 Jul 2018 10:41:00 GMT

     [ https://issues.apache.org/jira/browse/HIVE-20013?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Nishant Bangarwa updated HIVE-20013:
------------------------------------
    Description: 
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}

Reported by [~dileep529]

  was:
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}


> 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, 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}
> Reported by [~dileep529]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message