当我运行代码时,我在使用表格的打印功能时遇到了问题
我的csv文件内容是:</p>
0 syslog-tcp:0:0: key=None value=b'test kafka sink....'
1 syslog-tcp:0:1: key=None value=b'test kafka sink1....'
2 syslog-tcp:0:2: key=None value=b'test kafka sink2....'
3 syslog-tcp:0:3: key=None value=b'systemd: Stopping System Logging Service...'
源表:</p>
t_env.execute_sql(f"""
CREATE TABLE source(
line STRING
)WITH(
'connector' = 'filesystem',
'path' = '{dir_log}',
'format' = 'csv')
""")
选择:</p>
t_env.execute_sql("SELECT * FROM source ").print()
错误:</p>
Py4JJavaError: An error occurred while calling o111.print.
: java.lang.RuntimeException: Failed to fetch next result
Caused by: java.io.IOException: Failed to deserialize CSV row.
Caused by: org.apache.flink.shaded.jackson2.com.fasterxml.jackson.dataformat.csv.CsvMappingException: Too many entries: expected at most 1 (value #1 (59 chars) "object path /org/freedesktop/PolicyKit1/AuthenticationAgent")
at [Source: (org.apache.flink.shaded.jackson2.com.fasterxml.jackson.dataformat.csv.impl.UTF8Reader); line: 1, column: 188]