Github user kunal642 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2308#discussion_r190504512
  
    --- Diff: 
integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/SDKwriterTestCase.scala
 ---
    @@ -0,0 +1,743 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.carbondata.cluster.sdv.generated
    +
    +
    +import java.util
    +
    +import org.apache.spark.sql.Row
    +import org.apache.spark.sql.common.util.QueryTest
    +import org.scalatest.BeforeAndAfterEach
    +import scala.collection.JavaConverters._
    +import scala.collection.mutable
    +
    +import org.apache.avro
    +import org.apache.commons.lang.CharEncoding
    +import org.junit.Assert
    +import tech.allegro.schema.json2avro.converter.JsonAvroConverter
    +
    +import org.apache.carbondata.core.constants.CarbonCommonConstants
    +import org.apache.carbondata.core.datastore.filesystem.CarbonFile
    +import org.apache.carbondata.core.datastore.impl.FileFactory
    +import org.apache.carbondata.core.util.CarbonUtil
    +import org.apache.carbondata.sdk.file.{AvroCarbonWriter, CarbonWriter, 
Schema}
    +
    +/**
    + * Test Class for SDKwriterTestcase to verify all scenarios
    + */
    +
    +class SDKwriterTestCase extends QueryTest with BeforeAndAfterEach {
    +
    +  var writerPath =
    +    s"${ resourcesPath }" + "/SparkCarbonFileFormat/WriterOutput1/"
    +
    +  override def beforeEach: Unit = {
    +    sql("DROP TABLE IF EXISTS sdkTable1")
    +    sql("DROP TABLE IF EXISTS sdkTable2")
    +    sql("DROP TABLE IF EXISTS table1")
    +    cleanTestData()
    +  }
    +  
    +  def cleanTestData() = {
    +    
FileFactory.deleteAllCarbonFilesOfDir(FileFactory.getCarbonFile(writerPath))
    +  }
    +
    +  override def afterEach(): Unit = {
    +    sql("DROP TABLE IF EXISTS sdkTable1")
    +    sql("DROP TABLE IF EXISTS sdkTable2")
    +    sql("DROP TABLE IF EXISTS table1")
    +    cleanTestData()
    +  }
    +
    +  def buildTestDataSingleFile(): Any = {
    +    
FileFactory.deleteAllCarbonFilesOfDir(FileFactory.getCarbonFile(writerPath))
    --- End diff --
    
    This is already added in beforeAll no need to add in other places


---

Reply via email to