ajantha-bhat commented on a change in pull request #3197: [CARBONDATA-3367][CARBONDATA-3368] Fix multiple issues in SDK reader
URL:
https://github.com/apache/carbondata/pull/3197#discussion_r281200219
##########
File path: core/src/main/java/org/apache/carbondata/core/metadata/schema/table/CarbonTable.java
##########
@@ -252,12 +250,9 @@ public static CarbonTable buildTable(
String tableName,
Configuration configuration) throws IOException {
TableInfo tableInfoInfer = CarbonUtil.buildDummyTableInfo(tablePath, "null", "null");
- CarbonFile carbonFile = getLatestIndexFile(FileFactory.getCarbonFile(tablePath, configuration));
- if (carbonFile == null) {
- throw new RuntimeException("Carbon index file not exists.");
- }
- org.apache.carbondata.format.TableInfo tableInfo = CarbonUtil
- .inferSchemaFromIndexFile(carbonFile.getPath(), tableName);
+ // InferSchema from data file
+ org.apache.carbondata.format.TableInfo tableInfo =
+ CarbonUtil.inferSchema(tablePath, tableName, false, configuration);
Review comment:
only footer is read. so not much difference and only one IO.
Index file was introduced to avoid multiple data file footer reading, but here for carbon reader to infer schema one file footer reading is enough.
----------------------------------------------------------------
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:
[hidden email]
With regards,
Apache Git Services