Mika Naylor
09/23/2025, 12:26 PMTIMESTAMP_LTZ values does not work with PyFlink? I have the following where I create a table with a single TIMESTAMP_LTZ column, insert a value into it and try to select it back out:
from pyflink.table import TableEnvironment, EnvironmentSettings, DataTypes, Row
from pyflink.table.expressions import col
from datetime import datetime
settings = EnvironmentSettings.in_streaming_mode()
env = TableEnvironment.create(settings)
env.execute_sql(
"""
CREATE TABLE MyTable (
a TIMESTAMP_LTZ(3)
) WITH (
'connector' = 'filesystem',
'path' = 'file:////path/to/file',
'format' = 'json'
)
"""
)
env.from_elements(
[Row(datetime.now())],
DataTypes.ROW([DataTypes.FIELD("a", DataTypes.TIMESTAMP_LTZ(3))]),
).execute_insert("MyTable")
result = env.from_path("MyTable").select(col("a")).limit(1).execute().collect()
result_list = list(result)
This raises an exception
py4j.protocol.Py4JJavaError: An error occurred while calling z:org.apache.flink.api.common.python.PythonBridgeUtils.getPickledBytesFromRow.
: org.apache.flink.api.python.shaded.net.razorvine.pickle.PickleException: couldn't introspect javabean: java.lang.IllegalArgumentException: wrong number of arguments
at org.apache.flink.api.python.shaded.net.razorvine.pickle.Pickler.put_javabean(Pickler.java:727)
at org.apache.flink.api.python.shaded.net.razorvine.pickle.Pickler.dispatch(Pickler.java:328)
at org.apache.flink.api.python.shaded.net.razorvine.pickle.Pickler.save(Pickler.java:141)
at org.apache.flink.api.python.shaded.net.razorvine.pickle.Pickler.dump(Pickler.java:111)
at org.apache.flink.api.python.shaded.net.razorvine.pickle.Pickler.dumps(Pickler.java:96)
at org.apache.flink.api.common.python.PythonBridgeUtils.getPickledBytesFromJavaObject(PythonBridgeUtils.java:236)
The record is fine in the underlying filesystem table. This doesnt happen if the column type is just a TIMESTAMP. I couldnt see anything in the docs that suggests this isnt a supported collection typeMika Naylor
09/23/2025, 12:26 PMMika Naylor
09/23/2025, 1:11 PMPythonBridgeUtils.getPickledBytesFromJavaObject, `LocalZonedTimestampType`s arent supported so it just attempts to dump the Instant object, rather than converting it into a java.sql.Timestamp like it does for `TimestampType`s.Dian Fu
09/25/2025, 5:20 AMGeorge Leonard
09/25/2025, 5:44 AMMika Naylor
09/25/2025, 8:05 AM{
"a": "2025-09-23 15:22:45.808Z"
}Mika Naylor
09/25/2025, 8:05 AMdatagen connector too