Tyler Wood
02/20/2023, 12:27 AM%flink.ssql in a zeppelin notebook on AWS. Have a field created_at that is a double and is getting read into zeppelin as eg 1.293848576E9
When I try to apply FROM_UNIXTIME to cast it to a timestamp I get the following error:
SQL validation failed. From line 1, column 8 to line 1, column 49: Cannot apply 'FROM_UNIXTIME' to arguments of type 'FROM_UNIXTIME()'. Supported form(s): 'FROM_UNIXTIME()'
'FROM_UNIXTIME(, )'
the query is
%flink.ssql(type=update)
SELECT FROM_UNIXTIME(created_at) FROM table;
What does that error message mean? it looks like i’m following exactly the function signature…Tyler Wood
02/20/2023, 2:23 AMFail to run sql command: WITH tmp as (
SELECT ticker, polarity_scores.compound as compound, CAST(created_at as timestamp) ts
FROM wtff
CROSS JOIN UNNEST(ticker_list) AS t (ticker)
WHERE ticker NOT IN ('A', 'DD', 'LMFAO'))
SELECT tumble_start(ts, interval '15' minutes), ticker, count(1) FROM tmp
GROUP BY tumble(ts, interval '15' minutes), ticker
TableException: Window aggregate can only be defined over a time attribute column, but TIMESTAMP(6) encountered.
A timestamp isn’t a time attribute?Tyler Wood
02/20/2023, 2:24 AMHong Teoh
02/20/2023, 12:17 PMWATERMARK FOR ts AS ts - INTERVAL '5' SECOND
OR
CAST(created_at as timestamp) ts as PROCTIME()
https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/concepts/time_attributes/Tyler Wood
02/20/2023, 7:02 PM