Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
203 views
in Technique[技术] by (71.8m points)

How to infer XML schema when reading event in Spark Structurated Streaming

I recently published a post talking about how to parse the XML that comes as plain text inside the "body" field of an EventHub Reading schema of streaming Dataframe in Spark Structured Streaming

What I would really like to know is if there is a possibility to infer the XML schema as the data arrives and not have it declared first.

As described in that entry, in batch mode I have used the https://github.com/databricks/spark-xml library. More specifically: https://github.com/databricks/spark-xml#parsing-nested-xml.

What I would like to know is if there is the possibility of automatically inferring the XML schema.

I tried to first upload some sample data and then extract that schema and use it. But is there a more efficient way?

Many thanks!

question from:https://stackoverflow.com/questions/65900790/how-to-infer-xml-schema-when-reading-event-in-spark-structurated-streaming

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...