sourceSchema(
sqlContext: SQLContext,
schema: Option[StructType],
providerName: String,
parameters: Map[String, String]): (String, StructType)
StreamSourceProvider
— Streaming Source Provider
StreamSourceProvider
trait defines a contract for objects that can create a streaming Source
for a format (e.g. text file) or system (e.g. Apache Kafka) by their names.
Note
|
StreamSourceProvider is used when DataSource is requested for the name and schema of a Source or creates one.
|
Name | Description |
---|---|
Creates TextSocketSources (for |
|
Creates KafkaSourceProvider (for |
StreamSourceProvider
Contract
StreamSourceProvider
contract defines two methods:
-
sourceSchema that returns the name and schema of the Source.
-
createSource that produces a streaming Source (to continually read data).