using `%flink.ssql` in a zeppelin notebook on AWS....
# troubleshooting
t
using
%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:
Copy code
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
Copy code
%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…
okay now trying this and an equally confusing error
Copy code
Fail 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?
same issue with cast to TIMESTAMP(3)
h
I am not 100% sure, but I think we just need to define the ts field as a time attribute. Try something like
Copy code
WATERMARK FOR ts AS ts - INTERVAL '5' SECOND
OR
Copy code
CAST(created_at as timestamp) ts as PROCTIME()
https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/concepts/time_attributes/
t
thank you i will try that