Github user kunal642 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2829#discussion_r226979070
--- Diff:
store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonSchemaReader.java
---
@@ -76,6 +81,19 @@ public static Schema readSchemaInDataFile(String
dataFilePath) throws IOExceptio
return new Schema(columnSchemaList);
}
+ public static String getVersionDetails(String dataFilePath) throws
IOException {
+ long fileSize =
+ FileFactory.getCarbonFile(dataFilePath,
FileFactory.getFileType(dataFilePath)).getSize();
+ FileReader fileReader =
FileFactory.getFileHolder(FileFactory.getFileType(dataFilePath));
+ ByteBuffer buffer =
+
fileReader.readByteBuffer(FileFactory.getUpdatedFilePath(dataFilePath),
fileSize - 8, 8);
+ CarbonFooterReaderV3 footerReader = new
CarbonFooterReaderV3(dataFilePath, buffer.getLong());
+ FileFooter3 footer = footerReader.readFooterVersion3();
+ return
footer.getExtra_info().get(CarbonCommonConstants.CARBON_WRITTEN_BY_FOOTER_INFO)
--- End diff --
getExtra_info().get(CarbonCommonConstants.CARBON_WRITTEN_BY_FOOTER_INFO)
will give null for old store tables. Same goes for
.getExtra_info().get(CarbonCommonConstants.CARBON_VERSION_FOOTER_INFO).
Check for null and return empty string
---