arunmahadevan commented on a change in pull request #23430: [SPARK-26520][SQL]
data source v2 API refactor (micro-batch read)
URL: https://github.com/apache/spark/pull/23430#discussion_r244876072
##########
File path:
external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala
##########
@@ -432,6 +400,54 @@ private[kafka010] class KafkaSourceProvider extends
DataSourceRegister
logWarning("maxOffsetsPerTrigger option ignored in batch queries")
}
}
+
+ class KafkaTable(options: DataSourceOptions) extends Table
+ with SupportsMicroBatchRead {
+
+ override def name(): String = s"Kafka
${strategy(options.asMap().asScala.toMap)}"
+
+ override def schema(): StructType = KafkaOffsetReader.kafkaSchema
+
+ override def newScanBuilder(options: DataSourceOptions): ScanBuilder = {
+ new KafkaScanBuilder(options)
+ }
+ }
+
+ class KafkaScanBuilder(options: DataSourceOptions) extends ScanBuilder with
Scan {
Review comment:
Its cleaner to separate the Scan and the Builder.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]