Apache spark 2.2是否支持用户定义类型(UDT)? [英] Does Apache spark 2.2 supports user-defined type (UDT)?

查看:65
本文介绍了Apache spark 2.2是否支持用户定义类型(UDT)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从此JIRA票证中在Spark 2.0中隐藏UserDefinedType,似乎火花掩盖了2.0版的UDT API.

From this JIRA ticket Hide UserDefinedType in Spark 2.0 , seems that spark hide the UDT API from version 2.0.

是否存在可以在2.2版中使用的替代函数或API,以便我们可以定义UserDefinedType?我希望在数据框或结构化流媒体中使用自定义类型.

Is there exists an alternative function or API we can use in version 2.2, so that we could define UserDefinedType? I wish to use a custom type in dataframe or structured streaming.

推荐答案

没有其他API,并且UDT保持私有状态( https://issues.apache.org/jira/browse/SPARK-7768 ).

There is no alternative API and UDT remains private (https://issues.apache.org/jira/browse/SPARK-7768).

通用 Encoders ( org.apache.spark.sql.Encoders.kryo org.apache.spark.sql.Encoders.javaSerialization )在数据集中起类似的作用,但没有直接替代方法:

Generic Encoders (org.apache.spark.sql.Encoders.kryo and org.apache.spark.sql.Encoders.javaSerialization) serve similar purpose in Dataset, but there are not direct replacement:

这篇关于Apache spark 2.2是否支持用户定义类型(UDT)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆