问题描述
从此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)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!