看报错你是调用了order_by操作吧。对于unbounded
table来说,order_by只能作用在时间字段上,要不然就得后面接上fetch操作。具体可以参考文档[1]
[1]
https://ci.apache.org/projects/flink/flink-docs-master/dev/table/tableApi.html#orderby-offset--fetch
Best,
Xingbo
肖越 <18242988...@163.com> 于2021年1月27日周三 下午5:44写道:
> 通过sql_query执行返回table对象,执行table.to_pandas()报错:
> Traceback (most recent call last):
> File
> "C:/projects/dataService-pyflink_explore/dataService-calculate-code-python/src/test/test_mysql_connector.py",
> line 161, in
> print(table.to_pandas().head(6))
> File
> "C:\Users\18242\AppData\Local\Programs\Python\Python37\lib\site-packages\pyflink\table\table.py",
> line 723, in to_pandas
> .collectAsPandasDataFrame(self._j_table, max_arrow_batch_size)
> File
> "C:\Users\18242\AppData\Local\Programs\Python\Python37\lib\site-packages\py4j\java_gateway.py",
> line 1286, in __call__
> answer, self.gateway_client, self.target_id, self.name)
> File
> "C:\Users\18242\AppData\Local\Programs\Python\Python37\lib\site-packages\pyflink\util\exceptions.py",
> line 154, in deco
> raise exception_mapping[exception](s.split(': ', 1)[1], stack_trace)
> pyflink.util.exceptions.TableException: 'Sort on a non-time-attribute
> field is not supported.'
> 请教各位大佬,为什么会转换失败?但表格本身print_schema是没问题的。