Skip to content

Commit

Permalink
revert the API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
chenghao-intel committed Dec 7, 2014
1 parent b85b620 commit 5d58812
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,22 @@ private[hive] class HiveMetastoreCatalog(hive: HiveContext) extends Catalog with
* @param schema Schema of the new table, if not specified, will use the schema
* specified in crtTbl
* @param allowExisting if true, ignore AlreadyExistsException
* @param crtTbl CreateTableDesc object which contains the SerDe info. Currently
* @param desc CreateTableDesc object which contains the SerDe info. Currently
* we support most of the features except the bucket.
*/
def createTable(
databaseName: String,
tableName: String,
schema: Seq[Attribute],
allowExisting: Boolean = false,
crtTbl: CreateTableDesc = null) {
desc: Option[CreateTableDesc] = None) {
val hconf = hive.hiveconf

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

val crtTbl: CreateTableDesc = desc.getOrElse(null)

// We should respect the passed in schema, unless it's not set
val hiveSchema: JList[FieldSchema] = if (schema == null || schema.isEmpty) {
crtTbl.getCols
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ case class CreateTableAsSelect(
// A lazy computing of the metastoreRelation
private[this] lazy val metastoreRelation: MetastoreRelation = {
// Create Hive Table
sc.catalog.createTable(database, tableName, query.output, allowExisting, desc.getOrElse(null))
sc.catalog.createTable(database, tableName, query.output, allowExisting, desc)

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

0 comments on commit 5d58812

Please sign in to comment.