Skip to content

Commit

Permalink
add asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
imback82 committed Apr 14, 2021
1 parent a0a7297 commit 111ef8b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1025,8 +1025,10 @@ case class CacheTableAsSelect(
options: Map[String, String],
isAnalyzed: Boolean = false) extends AnalysisOnlyCommand {
override protected def withNewChildrenInternal(
newChildren: IndexedSeq[LogicalPlan]): CacheTableAsSelect =
newChildren: IndexedSeq[LogicalPlan]): CacheTableAsSelect = {
assert(!isAnalyzed)
copy(plan = newChildren.head)
}

override def childrenToAnalyze: Seq[LogicalPlan] = plan :: Nil

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ case class CreateViewCommand(
import ViewHelper._

override protected def withNewChildrenInternal(
newChildren: IndexedSeq[LogicalPlan]): CreateViewCommand =
newChildren: IndexedSeq[LogicalPlan]): CreateViewCommand = {
assert(!isAnalyzed)
copy(plan = newChildren.head)
}

override def innerChildren: Seq[QueryPlan[_]] = Seq(plan)

Expand Down Expand Up @@ -249,8 +251,10 @@ case class AlterViewAsCommand(
import ViewHelper._

override protected def withNewChildrenInternal(
newChildren: IndexedSeq[LogicalPlan]): AlterViewAsCommand =
newChildren: IndexedSeq[LogicalPlan]): AlterViewAsCommand = {
assert(!isAnalyzed)
copy(query = newChildren.head)
}

override def innerChildren: Seq[QueryPlan[_]] = Seq(query)

Expand Down

0 comments on commit 111ef8b

Please sign in to comment.