[ 
https://issues.apache.org/jira/browse/SPARK-21147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16056037#comment-16056037
 ] 

Apache Spark commented on SPARK-21147:
--------------------------------------

User 'HyukjinKwon' has created a pull request for this issue:
https://github.com/apache/spark/pull/18365

> 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-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to