> if creation of one CarbonReader for non-transactional table fails then we are not able to create new object of CarbonReader
> ----------------------------------------------------------------------------------------------------------------------------
>
> Key: CARBONDATA-2603
> URL:
https://issues.apache.org/jira/browse/CARBONDATA-2603> Project: CarbonData
> Issue Type: Improvement
> Reporter: Rahul Kumar
> Assignee: Rahul Kumar
> Priority: Major
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> *to reproduce follow the following steps :*
> # create a carbonReader for non transactional Table and give the wrong projection column name (so that it will fail).
> # create another carbonReader for non-transactional table with correct values.
> Expectation : Second reader should be successfully created
> Actual : creation of second carbonReader is failing with following exception.
>
> TestCase to reproduce the issue ;
> {{Field[] fields = new Field[] { new Field("c1", "string"),}}
> {{ new Field("c2", "int") };}}
> {{Schema schema = new Schema(fields);}}
> {{CarbonWriterBuilder builder = CarbonWriter.builder();}}
> {{CarbonWriter carbonWriter =}}
> {{ builder.outputPath("D:/mydata").isTransactionalTable(false).uniqueIdentifier(12345)}}
> {{ .buildWriterForCSVInput(schema);}}
> {{carbonWriter.write(new String[] \{ "MNO", "100" });}}
> {{carbonWriter.close();}}
> {{Field[] fields1 = new Field[] { new Field("p1", "string"),}}
> {{ new Field("p2", "int") };}}
> {{Schema schema1 = new Schema(fields1);}}
> {{CarbonWriterBuilder builder1 = CarbonWriter.builder();}}
> {{CarbonWriter carbonWriter1 =}}
> {{ builder1.outputPath("D:/mydata1").isTransactionalTable(false).uniqueIdentifier(12345)}}
> {{ .buildWriterForCSVInput(schema1);}}
> {{carbonWriter1.write(new String[] \{ "PQR", "200" });}}
> {{carbonWriter1.close();}}
> {{try {}}
> {{ CarbonReader reader =}}
> {{ CarbonReader.builder("D:/mydata", "_temp").}}
> {{ projection(new String[] \{ "c1", "c3" })}}
> {{ .isTransactionalTable(false).build();}}
> {{} catch (Exception e){}}
> {{ System.out.println("Success");}}
> {{}}}
> {{CarbonReader reader1 =}}
> {{ CarbonReader.builder("D:/mydata1", "_temp1")}}
> {{ .projection(new String[] \{ "p1", "p2" })}}
> {{ .isTransactionalTable(false).build();}}
> {{while (reader1.hasNext()) {}}
> {{ Object[] row1 = (Object[]) reader1.readNextRow();}}
> {{ System.out.println(row1[0]);}}
> {{ System.out.println(row1[1]);}}
> {{}}}
> {{reader1.close();}}{{}}
>
>
>