You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Fei Shao (JIRA)" <ji...@apache.org> on 2017/06/20 01:44:02 UTC

[jira] [Created] (SPARK-21147) the schema of socket source can not be set.

Fei Shao created SPARK-21147:
--------------------------------

             Summary: the schema of socket source can not be set.
                 Key: SPARK-21147
                 URL: https://issues.apache.org/jira/browse/SPARK-21147
             Project: Spark
          Issue Type: Bug
          Components: Structured Streaming
    Affects Versions: 2.1.0
         Environment: Win7,spark 2.1.0
            Reporter: Fei Shao


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.




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org