TextSocketSourceProvider is also a
The short name of the data source is
It requires two mandatory options (that you can set using
hostwhich is the host name.
portwhich is the port number. It must be an integer.
TextSocketSourceProvider also supports <
=== [[includeTimestamp]] includeTimestamp Option
=== [[createSource]] createSource
createSource grabs the two mandatory options --
port -- and returns an spark-sql-streaming-TextSocketSource.md[TextSocketSource].
=== [[sourceSchema]] sourceSchema
textSocket as the name of the source and the schema that can be one of the two available schemas:
SCHEMA_REGULAR(default) which is a schema with a single
valuefield of String type.
<<includeTimestamp, includeTimestamp>>flag option is set. It is not, i.e.
false, by default. The schema are
timestampfield of spark-sql-DataType.md#TimestampType[TimestampType] type of format
TIP: Read about spark-sql-schema.md[schema].
Internally, it starts by printing out the following WARN message to the logs:
WARN TextSocketSourceProvider: The socket source should not be used for production applications! It does not support recovery and stores state indefinitely.
It then checks whether
port parameters are defined and if not it throws a
Set a host to read from with option("host", ...).