Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.1.0, 2.2.0
-
None
-
Win7,spark 2.1.0
Description
The schema set for DataStreamReader can not work. The code is shown as below:
val line = ss.readStream.format("socket")
.option("ip",xxx)
.option("port",xxx)
.schema( StructField("name",StringType)::StructField("area",StringType)::Nil)
.load
line.printSchema
The printSchema prints:
root
--value:String(nullable=true) |
According to the code, it should print the schema set by schema().
Suggestion from Michael Armbrust:
throw an exception saying that you can't set schema here.