Skip to content

Commit

Permalink
restore shim
Browse files Browse the repository at this point in the history
  • Loading branch information
jose-torres committed Dec 29, 2017
1 parent e27d1db commit 9ffb92c
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ class MicroBatchExecution(
// "df.logicalPlan" has already used attributes of the previous `output`.
StreamingExecutionRelation(reader, output)(sparkSession)
})
case s @ StreamingRelationV2(_, _, _, output, v1DataSource) =>
v2ToExecutionRelationMap.getOrElseUpdate(s, {
// Materialize source to avoid creating it in every batch
val metadataPath = s"$resolvedCheckpointRoot/sources/$nextSourceId"
val source = v1DataSource.createSource(metadataPath)
nextSourceId += 1
// We still need to use the previous `output` instead of `source.schema` as attributes in
// "df.logicalPlan" has already used attributes of the previous `output`.
StreamingExecutionRelation(source, output)(sparkSession)
})
}
sources = _logicalPlan.collect { case s: StreamingExecutionRelation => s.source }
uniqueSources = sources.distinct
Expand Down

0 comments on commit 9ffb92c

Please sign in to comment.