You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/01/03 02:55:22 UTC

[GitHub] cloud-fan commented on a change in pull request #23430: [SPARK-26520][SQL] data source v2 API refactor (micro-batch read)

cloud-fan 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_r244905252
 
 

 ##########
 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:
   I don't have a strong preference, currently all the streaming sources don't support operator pushdown, so it's easier to implement both of them together.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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