Skip to content

Commit

Permalink
fixes from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
squito committed Sep 18, 2017
1 parent c5571a8 commit 950d33a
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 @@ -86,8 +86,7 @@ case class CreateTableLikeCommand(
schema = sourceTableDesc.schema,
provider = newProvider,
partitionColumnNames = sourceTableDesc.partitionColumnNames,
bucketSpec = sourceTableDesc.bucketSpec,
properties = sourceTableDesc.properties)
bucketSpec = sourceTableDesc.bucketSpec)

catalog.createTable(newTableDesc, ifNotExists)
Seq.empty[Row]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package org.apache.spark.sql.execution.datasources

import org.apache.spark.sql.{AnalysisException, SparkSession}
import org.apache.spark.sql.catalyst.TableIdentifier
import org.apache.spark.sql.catalyst.analysis.UnresolvedException
import org.apache.spark.sql.catalyst.catalog.CatalogTable
import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, Project}
Expand Down Expand Up @@ -89,7 +90,13 @@ private[sql] case class TimestampTableTimeZone(sparkSession: SparkSession)
// now we need to adjust all names to use the new version.
val fixedExpressions = fixedPlan.mapExpressions { outerExp =>
val adjustedExp = outerExp.transformUp { case exp: NamedExpression =>
newReplacements.get(exp.exprId).getOrElse(exp)
try {
newReplacements.get(exp.exprId).getOrElse(exp)
} catch {
// UnresolvedAttributes etc. will cause problems later anyway, we just dont' want to
// expose the error here
case ue: UnresolvedException[_] => exp
}
}
logDebug(s"adjusted $outerExp to $adjustedExp using $newReplacements")
adjustedExp
Expand Down

0 comments on commit 950d33a

Please sign in to comment.