Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
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.
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)
Reported by dileep529