Ali Zia
07/15/2023, 9:56 PMtable_agg = table.window(
Tumble.over(lit(1).hour).on(col("ts")).alias("w")
).group_by(col("w"), col("name")).select(
col("w").end.alias("time_close"),
col("name"),
col("weight").avg.alias("weight_avg"))
)
t_env.create_temporary_view("TABLE_WEIGHT_AVG", table_agg)
t_env.execute_sql(f"""
CREATE TEMPORARY VIEW TABLE_INTERVAL_JOIN AS
SELECT
w.time_close,
w.name,
w.weight_avg,
c.avg_cals
FROM TABLE_WEIGHT_AVG w, TABLE_CALS c
WHERE w.time_close = c.time_close
""")
This leads to the following exception:
java.lang.AssertionError: Conversion to relational algebra failed to preserve datatypes:
validated type:
RecordType(TIMESTAMP(3) time_close, VARCHAR(2147483647) CHARACTER SET "UTF-16LE" name, FLOAT weight_avg, FLOAT avg_cals) NOT NULL
converted type:
RecordType(TIMESTAMP(3) NOT NULL time_close, VARCHAR(2147483647) CHARACTER SET "UTF-16LE" anem, FLOAT weight_avg, FLOAT avg_cals) NOT NULL
How can I reconcile the problem of NULL vs NOT NULL on time_close.
Thanks a lot for the help!Martijn Visser
07/17/2023, 7:56 AMname and anem in the error message. Are you sure it's the NULL vs NOT NULL?