carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipesala <...@git.apache.org>
Subject [GitHub] carbondata pull request #1443: [CARBONDATA-1524][CARBONDATA-1525][AggTable] ...
Date Thu, 09 Nov 2017 11:31:00 GMT
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1443#discussion_r149936691
  
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala
---
    @@ -446,6 +447,35 @@ class CarbonFileMetastore extends CarbonMetaStore {
         }
       }
     
    +  protected def updateParentTableInfo(parentRelationIdentifier: RelationIdentifier,
    +      childCarbonTable: CarbonTable)(sparkSession: SparkSession): Unit = {
    +    val dbName = parentRelationIdentifier.getDatabaseName
    +    val tableName = parentRelationIdentifier.getTableName
    +    try {
    +      val parentCarbonTable = CarbonEnv.getInstance(sparkSession).carbonMetastore
    +        .lookupRelation(Some(dbName), tableName)(sparkSession).asInstanceOf[CarbonRelation]
    +        .tableMeta.carbonTable
    +      val childSchemas = parentCarbonTable.getTableInfo.getDataMapSchemaList
    +      val childSchemaIterator = childSchemas.iterator()
    +      while (childSchemaIterator.hasNext) {
    +        val childSchema = childSchemaIterator.next()
    +        if (childSchema.getChildSchema.equals(childCarbonTable.getTableInfo.getFactTable))
{
    +          childSchemaIterator.remove()
    +        }
    +      }
    +      val schemaConverter = new ThriftWrapperSchemaConverterImpl
    +      PreAggregateUtil
    +        .updateSchemaInfo(parentCarbonTable,
    +          schemaConverter
    +            .fromWrapperToExternalTableInfo(parentCarbonTable.getTableInfo,
    +              dbName,
    +              tableName))(sparkSession)
    +    } catch {
    +      case ex: Exception =>
    +        LOGGER.error(ex, s"Table $dbName.$tableName does not exist.")
    --- End diff --
    
    throw exception


---

Mime
View raw message