You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original Hive SQL:
select
pt_dt,sum(reg_pid_cnt)
from table1
where pt_dt >= date_sub( from_unixtime(unix_timestamp(),'yyyy-MM-dd'),30)
group by pt_dt
order by pt_dt asc
Transpile to Trino or Presto:
SELECT pt_dt, SUM(reg_pid_cnt) FROM table1 WHERE pt_dt >= DATE_ADD('DAY', 30 * -1, CAST(CAST(DATE_FORMAT(FROM_UNIXTIME(TO_UNIXTIME(DATE_PARSE('%Y-%m-%d %T'))), '%Y-%m-%d') AS TIMESTAMP) AS DATE)) GROUP BY pt_dt ORDER BY pt_dt ASC
Can Not to Run In Trino
The text was updated successfully, but these errors were encountered:
luhea
changed the title
unix_timestamp() is Errio
unix_timestamp() is Error
Mar 26, 2024
I'll take a look, but it would be appreciated if you included more info in future issues, such as what's the reason the output query fails in the target engine.
Original Hive SQL:
select
pt_dt,sum(reg_pid_cnt)
from table1
where pt_dt >= date_sub( from_unixtime(unix_timestamp(),'yyyy-MM-dd'),30)
group by pt_dt
order by pt_dt asc
Transpile to Trino or Presto:
SELECT pt_dt, SUM(reg_pid_cnt) FROM table1 WHERE pt_dt >= DATE_ADD('DAY', 30 * -1, CAST(CAST(DATE_FORMAT(FROM_UNIXTIME(TO_UNIXTIME(DATE_PARSE('%Y-%m-%d %T'))), '%Y-%m-%d') AS TIMESTAMP) AS DATE)) GROUP BY pt_dt ORDER BY pt_dt ASC
Can Not to Run In Trino
The text was updated successfully, but these errors were encountered: