diff --git a/connector/connect/common/src/test/resources/query-tests/explain-results/streaming_table_API_with_options.explain b/connector/connect/common/src/test/resources/query-tests/explain-results/streaming_table_API_with_options.explain index 2a20daaefa8c..2cc166efa99e 100644 --- a/connector/connect/common/src/test/resources/query-tests/explain-results/streaming_table_API_with_options.explain +++ b/connector/connect/common/src/test/resources/query-tests/explain-results/streaming_table_API_with_options.explain @@ -1,2 +1,2 @@ -SubqueryAlias primary.tempdb.myStreamingTable -+- StreamingRelationV2 primary.tempdb.myStreamingTable, org.apache.spark.sql.connector.catalog.InMemoryTable, [p1=v1, p2=v2], [id#0L], org.apache.spark.sql.connector.catalog.InMemoryCatalog, tempdb.myStreamingTable +~SubqueryAlias primary.tempdb.myStreamingTable ++- ~StreamingRelationV2 primary.tempdb.myStreamingTable, org.apache.spark.sql.connector.catalog.InMemoryTable, [p1=v1, p2=v2], [id#0L], org.apache.spark.sql.connector.catalog.InMemoryCatalog, tempdb.myStreamingTable diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala index a2ede8ac735c..938a8ffe9e44 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala @@ -104,7 +104,20 @@ abstract class LogicalPlan */ lazy val resolved: Boolean = expressions.forall(_.resolved) && childrenResolved - override protected def statePrefix = if (!resolved) "'" else super.statePrefix + override protected def statePrefix = { + if (!resolved) { + "'" + } else { + val prefixFromSuper = super.statePrefix + // Ancestor class could mark something on the prefix, including 'invalid'. Add a marker for + // `streaming` only when there is no marker from ancestor class. + if (prefixFromSuper.isEmpty && isStreaming) { + "~" + } else { + prefixFromSuper + } + } + } /** * Returns true if all its children of this query plan have been resolved.