Skip to content

Commit 0ce28d9

Browse files
committed
Remove unnecessary check
1 parent 737a7d0 commit 0ce28d9

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/CreateViewAsSelect.scala

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, Project}
2424
import org.apache.spark.sql.execution.RunnableCommand
2525
import org.apache.spark.sql.hive.{HiveContext, HiveMetastoreTypes, SQLBuilder}
2626
import org.apache.spark.sql.hive.client.{HiveColumn, HiveTable}
27-
import org.apache.spark.sql.types.StructType
2827

2928
/**
3029
* Create Hive view on non-hive-compatible tables by specifying schema ourselves instead of
@@ -117,19 +116,6 @@ private[hive] case class CreateViewAsSelect(
117116
val logicalPlan = if (tableDesc.schema.isEmpty) {
118117
child
119118
} else {
120-
if (childSchema.length != tableDesc.schema.length) {
121-
throw new IllegalStateException(
122-
s"""View definition schema is incompatible with the required one:
123-
:
124-
:${StructType.fromAttributes(childSchema).treeString}
125-
:
126-
:Required Hive schema:
127-
:
128-
:${tableDesc.schema.mkString("\n")}
129-
""".stripMargin(':')
130-
)
131-
}
132-
133119
val projectList = childSchema.zip(tableDesc.schema).map {
134120
case (attr, col) => Alias(attr, col.name)()
135121
}

0 commit comments

Comments
 (0)