Github user rahulforallp commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2398#discussion_r197852069
--- Diff:
integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/createTable/TestNonTransactionalCarbonTable.scala
---
@@ -2301,3 +2292,29 @@ class TestNonTransactionalCarbonTable extends
QueryTest with BeforeAndAfterAll {
checkAnswer(sql("select * from sdkOutputTable"),
Seq(Row(Timestamp.valueOf("1970-01-02 16:00:00"),
Row(Timestamp.valueOf("1970-01-02 16:00:00")))))
}
}
+
+
+object avroUtil{
+
+ def jsonToAvro(json: String, avroSchema: String): GenericRecord = {
+ var input: InputStream = null
+ var writer: DataFileWriter[GenericRecord] = null
+ var encoder: Encoder = null
+ var output: ByteArrayOutputStream = null
+ try {
+ val schema = new org.apache.avro.Schema.Parser().parse(avroSchema)
+ val reader = new GenericDatumReader[GenericRecord](schema)
+ input = new ByteArrayInputStream(json.getBytes())
--- End diff --
test-cases are from two different packages , so we should write the util
class separately.
---