[ https://issues.apache.org/jira/browse/HIVE-20013?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zoltan Haindrich reassigned HIVE-20013: --------------------------------------- Assignee: Nishant Bangarwa (was: Zoltan Haindrich) [~nishantbangarwa]: rebased patch; probably the only relevant change is an 1969 turning into 1970 https://github.com/apache/hive/commit/eac050e3ceb603e20b7a83665a7a21909d968329 this is because for null the date is not really specified; I think 1970 is better.... https://github.com/apache/hive/compare/master...kgyrtkirk:HIVE-20013#diff-7af591fea6a5dfefb39d4dfdfc9ece7eR159 I don't believe that's should be a showstopper > 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.02.patch, 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)