carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anubhav100 <...@git.apache.org>
Subject [GitHub] carbondata pull request #984: [CARBONDATA-1008] Make Caron table schema comp...
Date Tue, 11 Jul 2017 04:28:47 GMT
Github user anubhav100 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/984#discussion_r126592144
  
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala
---
    @@ -195,11 +195,43 @@ case class CreateTable(cm: TableModel, createDSTable: Boolean =
true) extends Ru
               val fields = new Array[Field](cm.dimCols.size + cm.msrCols.size)
               cm.dimCols.foreach(f => fields(f.schemaOrdinal) = f)
               cm.msrCols.foreach(f => fields(f.schemaOrdinal) = f)
    -          sparkSession.sql(
    -            s"""CREATE TABLE $dbName.$tbName
    -                |(${ fields.map(f => f.rawSchema).mkString(",") })
    -                |USING org.apache.spark.sql.CarbonSource""".stripMargin +
    -            s""" OPTIONS (tableName "$tbName", dbName "$dbName", tablePath "$tablePath")
""")
    +          val useCompatibleSchema = sparkSession.sparkContext.conf
    +            .getBoolean(CarbonCommonConstants.SPARK_SCHEMA_HIVE_COMPATIBILITY_ENABLE,
false)
    +          if (useCompatibleSchema) {
    +            val tableIdentifier = TableIdentifier(tbName, Some(dbName))
    +            val tableSchema = CarbonEnv.getInstance(sparkSession).carbonMetastore
    +              .lookupRelation(tableIdentifier)(sparkSession).schema.json
    +            val schemaParts = AlterTableUtil.prepareSchemaJsonForAlterTable(
    +              sparkSession.sparkContext.conf, tableSchema)
    +            sparkSession.sharedState.externalCatalog.asInstanceOf[HiveExternalCatalog].client
    --- End diff --
    
    @cenyuhai ok change it and also change pr title from caron to carbon


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message