我有 avsc
架构如下:
{
"name": "address",
"type": [
"null",
{
"type":"record",
"name":"Address",
"namespace":"com.data",
"fields":[
{
"name":"address",
"type":[ "null","com.data.Address"],
"default":null
}
]
}
],
"default": null
}
在pyspark中加载此数据时:
jsonFormatSchema = open("Address.avsc", "r").read()
spark = SparkSession.builder.appName('abc').getOrCreate()
df = spark.read.format("avro")\
.option("avroSchema", jsonFormatSchema)\
.load("xxx.avro")
我有个例外:
"Found recursive reference in Avro schema, which can not be processed by Spark"
我尝试了许多其他配置,但都没有成功。要执行,我使用spark submit:
--packages org.apache.spark:spark-avro_2.12:3.0.1
1条答案
按热度按时间jtw3ybtb1#
这是一个预期的功能,您可以看看“问题”:
https://issues.apache.org/jira/browse/spark-25718