jose-torres 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_r249304766
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/MicroBatchExecution.scala
##########
@@ -90,36 +88,39 @@ class MicroBatchExecution(
logInfo(s"Using Source [$source] from DataSourceV1 named
'$sourceName' [$dataSourceV1]")
StreamingExecutionRelation(source, output)(sparkSession)
})
- case s @ StreamingRelationV2(
- dataSourceV2: MicroBatchReadSupportProvider, sourceName, options,
output, _) if
- !disabledSources.contains(dataSourceV2.getClass.getCanonicalName) =>
- v2ToExecutionRelationMap.getOrElseUpdate(s, {
+ case s @ StreamingRelationV2(ds, dsName, table: SupportsMicroBatchRead,
options, output, _)
+ if !disabledSources.contains(ds.getClass.getCanonicalName) =>
+ v2ToRelationMap.getOrElseUpdate(s, {
// Materialize source to avoid creating it in every batch
val metadataPath = s"$resolvedCheckpointRoot/sources/$nextSourceId"
- val readSupport = dataSourceV2.createMicroBatchReadSupport(
- metadataPath,
- new DataSourceOptions(options.asJava))
nextSourceId += 1
- readSupportToDataSourceMap(readSupport) = dataSourceV2 -> options
- logInfo(s"Using MicroBatchReadSupport [$readSupport] from " +
- s"DataSourceV2 named '$sourceName' [$dataSourceV2]")
- StreamingExecutionRelation(readSupport, output)(sparkSession)
+ logInfo(s"Reading table [$table] from DataSourceV2 named '$dsName'
[$ds]")
+ val dsOptions = new DataSourceOptions(options.asJava)
+ // TODO: operator pushdown.
Review comment:
Is this an urgent TODO, or does the existing v2 interface already not handle
pushdown. (I probably should know this, but it's been a while since the
original implementation.)
----------------------------------------------------------------
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]