Skip to content

Commit e215187

Browse files
eliminate the compiling warning
1 parent 4f97f14 commit e215187

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ private[hive] class HiveMetastoreCatalog(hive: HiveContext) extends Catalog with
271271
} else {
272272
val sa = new SemanticAnalyzer(hive.hiveconf) {
273273
override def analyzeInternal(ast: ASTNode) {
274-
// A hack to intercept the SemanticAnalyzer.analyzeInternal, ignore the query clause
275-
// for CTAS
274+
// A hack to intercept the SemanticAnalyzer.analyzeInternal,
275+
// to ignore the SELECT clause of the CTAS
276276
val method = classOf[SemanticAnalyzer].getDeclaredMethod(
277277
"analyzeCreateTable", classOf[ASTNode], classOf[QB])
278278
method.setAccessible(true)

sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveStrategies.scala

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,20 @@ private[hive] trait HiveStrategies {
182182
execution.InsertIntoHiveTable(
183183
table, partition, planLater(child), overwrite)(hiveContext) :: Nil
184184
case logical.CreateTableAsSelect(
185-
Some(database), tableName, child, allowExisting, desc: Option[CreateTableDesc]) =>
185+
Some(database), tableName, child, allowExisting, Some(desc: CreateTableDesc)) =>
186186
execution.CreateTableAsSelect(
187187
database,
188188
tableName,
189189
child,
190190
allowExisting,
191-
desc) :: Nil
191+
Some(desc)) :: Nil
192+
case logical.CreateTableAsSelect(Some(database), tableName, child, allowExisting, None) =>
193+
execution.CreateTableAsSelect(
194+
database,
195+
tableName,
196+
child,
197+
allowExisting,
198+
None) :: Nil
192199
case _ => Nil
193200
}
194201
}

0 commit comments

Comments
 (0)