I am not sure how to resolve this error? Hope some...
# troubleshooting
j
I am not sure how to resolve this error? Hope someone can help me here to fix. Just run this code which I found in pyflink documentation. from pyflink.table import EnvironmentSettings, TableEnvironment from pyflink.table import DataTypes from pyflink.table.udf import udf import pandas as pd # using batch table environment to execute the queries env_settings = EnvironmentSettings.in_batch_mode() table_env = TableEnvironment.create(env_settings) orders = table_env.from_elements([('Jack', 'FRANCE', 10), ('Rose', 'ENGLAND', 30), ('Jack', 'FRANCE', 20)], ['name', 'country', 'revenue']) map_function = udf(lambda x: pd.concat([x.name, x.revenue * 10], axis=1), result_type=DataTypes.ROW( [DataTypes.FIELD("name", DataTypes.STRING()), DataTypes.FIELD("revenue", DataTypes.BIGINT())]), func_type="pandas") orders.map(map_function).execute().print()
d
@Jagan Nalla The code itself should be all right. I have run this example successfully on my laptop. Could you run it in a clean Python environment and try it again?
j
@Dian Fu yes I tried in another environment through docker with flink+python. It worked, not sure why it is not working in my local machine python virtual environment.
My local machine is windows
d
I cannot tell why it’s not working in your windows(and also very curious)… The code itself is all right.