[GitHub] [carbondata] akashrn5 commented on a change in pull request #3862: [CARBONDATA-3933]Fix DDL/DML failures after table is created with column names having special characters like #,\,%

2020-08-24 Thread GitBox


akashrn5 commented on a change in pull request #3862:
URL: https://github.com/apache/carbondata/pull/3862#discussion_r475390842



##
File path: 
integration/spark/src/test/scala/org/apache/spark/carbondata/restructure/AlterTableRevertTestCase.scala
##
@@ -30,6 +32,13 @@ import 
org.apache.carbondata.spark.exception.ProcessMetaDataException
 class AlterTableRevertTestCase extends QueryTest with BeforeAndAfterAll {
 
   override def beforeAll() {
+new MockUp[MockClassForAlterRevertTests]() {

Review comment:
   @QiangCai Since CarbonSessionCatalogUtil is a singleton object in scala, 
we cant mock its method directly, so i think this should be fine right for now?





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [carbondata] akashrn5 commented on a change in pull request #3862: [CARBONDATA-3933]Fix DDL/DML failures after table is created with column names having special characters like #,\,%

2020-08-23 Thread GitBox


akashrn5 commented on a change in pull request #3862:
URL: https://github.com/apache/carbondata/pull/3862#discussion_r475353691



##
File path: 
integration/spark/src/test/scala/org/apache/spark/carbondata/restructure/AlterTableRevertTestCase.scala
##
@@ -30,6 +32,13 @@ import 
org.apache.carbondata.spark.exception.ProcessMetaDataException
 class AlterTableRevertTestCase extends QueryTest with BeforeAndAfterAll {
 
   override def beforeAll() {
+new MockUp[MockClassForAlterRevertTests]() {

Review comment:
   yeah, i tried that, but since im using MockUp[T], it needs actual scala 
class name, not the object, as MockUp identifies class, so i followed this 
similarly by referring the `TableStatusBackupTest`





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [carbondata] akashrn5 commented on a change in pull request #3862: [CARBONDATA-3933]Fix DDL/DML failures after table is created with column names having special characters like #,\,%

2020-08-23 Thread GitBox


akashrn5 commented on a change in pull request #3862:
URL: https://github.com/apache/carbondata/pull/3862#discussion_r475336910



##
File path: 
integration/spark/src/test/scala/org/apache/spark/carbondata/restructure/AlterTableRevertTestCase.scala
##
@@ -30,6 +32,13 @@ import 
org.apache.carbondata.spark.exception.ProcessMetaDataException
 class AlterTableRevertTestCase extends QueryTest with BeforeAndAfterAll {
 
   override def beforeAll() {
+new MockUp[MockClassForAlterRevertTests]() {

Review comment:
   i checked for static methods, but all were defined in scala object not 
class, so i thought i can do this way.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [carbondata] akashrn5 commented on a change in pull request #3862: [CARBONDATA-3933]Fix DDL/DML failures after table is created with column names having special characters like #,\,%

2020-08-23 Thread GitBox


akashrn5 commented on a change in pull request #3862:
URL: https://github.com/apache/carbondata/pull/3862#discussion_r475336497



##
File path: 
integration/spark/src/main/scala/org/apache/spark/sql/hive/CarbonSessionCatalogUtil.scala
##
@@ -61,21 +61,6 @@ object CarbonSessionCatalogUtil {
   s"'dbName'='${ newTableIdentifier.database.get }', 'tablePath'='${ 
newTablePath }')")
   }
 
-  /**
-   * Below method will be used to update serde properties
-   * @param tableIdentifier table identifier
-   * @param schemaParts schema parts
-   * @param cols cols
-   */
-  def alterTable(tableIdentifier: TableIdentifier,
-  schemaParts: String,
-  cols: Option[Seq[ColumnSchema]],
-  sparkSession: SparkSession): Unit = {
-getClient(sparkSession)
-  .runSqlHive(s"ALTER TABLE 
`${tableIdentifier.database.get}`.`${tableIdentifier.table}` " +
-  s"SET TBLPROPERTIES($schemaParts)")

Review comment:
   yes, we are calling the API 
`org.apache.spark.sql.hive.CarbonSessionUtil#alterExternalCatalogForTableWithUpdatedSchema`
 which does for us. All the alter tests are passing if you see.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org