UDF地图功能返回带有未命名模式的表
代码:
func = udf(log_parser, result_type=DataTypes.ROW(
[DataTypes.FIELD("ts", DataTypes.TIMESTAMP(precision=3)),
DataTypes.FIELD("clientip", DataTypes.STRING()),
DataTypes.FIELD("recordtime", DataTypes.STRING())]))
table = table.map(func)
table.print_schema()
输出:
(
`_c0` TIMESTAMP(3),
`_c1` STRING,
`_c2` STRING
)
这对我来说看起来很奇怪,它不应该打印带有定义列名称的模式吗?
code:
func = udf(log_parser, result_type=DataTypes.ROW(
[DataTypes.FIELD("ts", DataTypes.TIMESTAMP(precision=3)),
DataTypes.FIELD("clientip", DataTypes.STRING()),
DataTypes.FIELD("recordtime", DataTypes.STRING())]))
table = table.map(func)
table.print_schema()
output:
(
`_c0` TIMESTAMP(3),
`_c1` STRING,
`_c2` STRING
)
This looks strange to me, shouldn't it print a schema with defined column names?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个已知的问题,应在 Flink-27282 中解决。它是最近修复的,因此仍未发布。
This is a known issue and should have be addressed in FLINK-27282. It's fixed recently and so still not released.