Skip to content

Commit

Permalink
[CARBONDATA-762] Change schemaName to databaseName, cubeName to table…
Browse files Browse the repository at this point in the history
…Name
  • Loading branch information
lionelcao authored and jackylk committed Mar 16, 2017
1 parent 7ab727c commit 98ec428
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ object Compactor {
val startTime = System.nanoTime()
val mergedLoadName = CarbonDataMergerUtil.getMergedLoadName(loadsToMerge)
var finalMergeStatus = false
val schemaName: String = carbonLoadModel.getDatabaseName
val databaseName: String = carbonLoadModel.getDatabaseName
val factTableName = carbonLoadModel.getTableName
val validSegments: Array[String] = CarbonDataMergerUtil
.getValidSegments(loadsToMerge).split(',')
Expand All @@ -61,7 +61,7 @@ object Compactor {
mergedLoadName,
kettleHomePath,
cubeCreationTime,
schemaName,
databaseName,
factTableName,
validSegments,
carbonTable.getAbsoluteTableIdentifier.getCarbonTableIdentifier.getTableId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,23 @@ object CarbonHiveMetadataUtil {
/**
* This method invalidates the table from HiveMetastoreCatalog before dropping table
*
* @param schemaName
* @param cubeName
* @param databaseName
* @param tableName
* @param sqlContext
*/
def invalidateAndDropTable(schemaName: String,
cubeName: String,
def invalidateAndDropTable(databaseName: String,
tableName: String,
sqlContext: SQLContext): Unit = {
val hiveContext = sqlContext.asInstanceOf[HiveContext]
val tableWithDb = schemaName + "." + cubeName
val tableWithDb = databaseName + "." + tableName
val tableIdent = SqlParser.parseTableIdentifier(tableWithDb)
try {
hiveContext.catalog.invalidateTable(tableIdent)
hiveContext.runSqlHive(s"DROP TABLE IF EXISTS $schemaName.$cubeName")
hiveContext.runSqlHive(s"DROP TABLE IF EXISTS $databaseName.$tableName")
} catch {
case e: Exception =>
LOGGER.audit(
s"Error While deleting the table $schemaName.$cubeName during drop carbon table" +
s"Error While deleting the table $databaseName.$tableName during drop carbon table" +
e.getMessage)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ object CarbonHiveMetadataUtil {
/**
* This method invalidates the table from HiveMetastoreCatalog before dropping table
*
* @param schemaName
* @param cubeName
* @param databaseName
* @param tableName
* @param sparkSession
*/
def invalidateAndDropTable(schemaName: String,
cubeName: String,
def invalidateAndDropTable(databaseName: String,
tableName: String,
sparkSession: SparkSession): Unit = {
try {
sparkSession.sql(s"DROP TABLE IF EXISTS $schemaName.$cubeName")
sparkSession.sql(s"DROP TABLE IF EXISTS $databaseName.$tableName")
} catch {
case e: Exception =>
LOGGER.audit(
s"Error While deleting the table $schemaName.$cubeName during drop carbon table" +
s"Error While deleting the table $databaseName.$tableName during drop carbon table" +
e.getMessage)
}
}
Expand Down

0 comments on commit 98ec428

Please sign in to comment.