来自Spark文档
load(): DataFrame
load(path: String): DataFrame
load(paths: String*): DataFrame
我定义了读取xml记录的函数
def ExtractData(RecID: String,table:String)={
val spark = SparkSession.
builder.master("local[*]")
.appName("Insight Application Big Data")
.getOrCreate()
val df = spark.read
.format("com.databricks.spark.xml")
.option("rowTag", "row")
.load("src/main/resources/in/FBNK_CATEG_ENTRY.xml")//pass the xml record here
}
如果我想将xml格式的记录传递给.load
函数,而不是从文件中加载.load(inputStreamXML)