Skip to content

Commit 5d58812

Browse files
revert the API changes
1 parent b85b620 commit 5d58812

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,22 @@ private[hive] class HiveMetastoreCatalog(hive: HiveContext) extends Catalog with
9494
* @param schema Schema of the new table, if not specified, will use the schema
9595
* specified in crtTbl
9696
* @param allowExisting if true, ignore AlreadyExistsException
97-
* @param crtTbl CreateTableDesc object which contains the SerDe info. Currently
97+
* @param desc CreateTableDesc object which contains the SerDe info. Currently
9898
* we support most of the features except the bucket.
9999
*/
100100
def createTable(
101101
databaseName: String,
102102
tableName: String,
103103
schema: Seq[Attribute],
104104
allowExisting: Boolean = false,
105-
crtTbl: CreateTableDesc = null) {
105+
desc: Option[CreateTableDesc] = None) {
106106
val hconf = hive.hiveconf
107107

108108
val (dbName, tblName) = processDatabaseAndTableName(databaseName, tableName)
109109
val tbl = new Table(dbName, tblName)
110110

111+
val crtTbl: CreateTableDesc = desc.getOrElse(null)
112+
111113
// We should respect the passed in schema, unless it's not set
112114
val hiveSchema: JList[FieldSchema] = if (schema == null || schema.isEmpty) {
113115
crtTbl.getCols

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ case class CreateTableAsSelect(
5353
// A lazy computing of the metastoreRelation
5454
private[this] lazy val metastoreRelation: MetastoreRelation = {
5555
// Create Hive Table
56-
sc.catalog.createTable(database, tableName, query.output, allowExisting, desc.getOrElse(null))
56+
sc.catalog.createTable(database, tableName, query.output, allowExisting, desc)
5757

5858
// Get the Metastore Relation
5959
sc.catalog.lookupRelation(Some(database), tableName, None) match {

0 commit comments

Comments
 (0)