handle tableau pattern for spark datetime filters on non time columns
hbutani opened this issue · 2 comments
----Date filters----
SELECT SUM(lineitem.l_extendedprice) AS sum_l_extendedprice_ok, CAST(CONCAT(TO_DATE(CAST(CONCAT(TO_DATE(lineitem.l_shipdate),' 00:00:00') AS TIMESTAMP)), ' 00:00:00') AS TIMESTAMP) AS tdy_l_shipdate_ok FROM ( select * from lineitembase ) lineitem JOIN ( select * from orders ) orders ON (lineitem.l_orderkey = orders.o_orderkey) JOIN ( select * from customer ) customer ON (orders.o_custkey = customer.c_custkey) JOIN ( select * from custnation ) custnation ON (customer.c_nationkey = custnation.cn_nationkey) JOIN ( select * from custregion ) custregion ON (custnation.cn_regionkey = custregion.cr_regionkey) WHERE ((CAST(CONCAT(TO_DATE(orders.o_orderdate),' 00:00:00') AS TIMESTAMP) >= CAST('1993-05-19 00:00:00' AS TIMESTAMP)) AND (CAST(CONCAT(TO_DATE(orders.o_orderdate),' 00:00:00') AS TIMESTAMP) <= CAST('1998-08-02 00:00:00' AS TIMESTAMP))) GROUP BY CAST(CONCAT(TO_DATE(CAST(CONCAT(TO_DATE(lineitem.l_shipdate),' 00:00:00') AS TIMESTAMP)), ' 00:00:00') AS TIMESTAMP)
John can you check and close this issue
done