Github user ajantha-bhat commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2747#discussion_r219758599
  
    --- Diff: 
integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/createTable/TestNonTransactionalCarbonTableForMapType.scala
 ---
    @@ -401,6 +406,89 @@ class TestNonTransactionalCarbonTableForMapType 
extends QueryTest with BeforeAnd
         dropSchema
       }
     
    +  test("SDK Reader Without Projection Columns"){
    +    deleteDirectory(writerPath)
    +    val mySchema =
    +      """
    +        |{
    +        |  "name": "address",
    +        |  "type": "record",
    +        |  "fields": [
    +        |    {
    +        |      "name": "name",
    +        |      "type": "string"
    +        |    },
    +        |    {
    +        |      "name": "age",
    +        |      "type": "int"
    +        |    },
    +        |    {
    +        |      "name": "arrayRecord",
    +        |      "type": {
    +        |        "type": "array",
    +        |        "items": {
    +        |           "name": "houseDetails",
    +        |           "type": "map",
    +        |           "values": "string"
    +        |        }
    +        |      }
    +        |    }
    +        |  ]
    +        |}
    +      """.stripMargin
    +    val json = """ {"name":"bob", "age":10, "arrayRecord": [{"101": 
"Rahul", "102": "Pawan"}]} """.stripMargin
    +    nonTransactionalCarbonTable.WriteFilesWithAvroWriter(2, mySchema, json)
    +
    +    val reader = CarbonReader.builder(writerPath, 
"_temp").isTransactionalTable(false).build(conf)
    +    reader.close()
    +    println("Done test")
    +  }
    +
    +  test("SDK Reader Without Projection Columns1"){
    +    deleteDirectory(writerPath)
    +    val mySchema =
    +      """
    +        |{
    +        |  "name": "address",
    +        |  "type": "record",
    +        |  "fields": [
    +        |    {
    +        |      "name": "name",
    +        |      "type": "string"
    +        |    },
    +        |    {
    +        |      "name": "age",
    +        |      "type": "int"
    +        |    },
    +        |    {
    +        |      "name": "arrayRecord",
    +        |      "type": {
    +        |        "type": "array",
    +        |        "items": {
    +        |           "name": "houseDetails",
    +        |           "type": "map",
    +        |           "values": "string"
    +        |        }
    +        |      }
    +        |    }
    +        |  ]
    +        |}
    +      """.stripMargin
    +    val json = """ {"name":"bob", "age":10, "arrayRecord": [{"101": 
"Rahul", "102": "Pawan"}]} """.stripMargin
    +    nonTransactionalCarbonTable.WriteFilesWithAvroWriter(2, mySchema, json)
    +
    +    val exception1 = intercept[Exception] {
    --- End diff --
    
    Handle this in above test case itself. As we are testing reader. No need to 
write again and read it.


---

Reply via email to