yifan-c commented on code in PR #131: URL: https://github.com/apache/cassandra-analytics/pull/131#discussion_r2274097480
########## cassandra-analytics-common/src/main/java/org/apache/cassandra/spark/data/SSTable.java: ########## @@ -95,11 +101,38 @@ public void verify() throws IncompleteSSTableException throw new IncompleteSSTableException(FileType.STATISTICS); } // Need Summary.db or Index.db to read first/last partition key - if (isMissing(FileType.SUMMARY) && isMissing(FileType.INDEX)) + if (isBigFormat() && isMissing(FileType.SUMMARY) && isMissing(FileType.INDEX)) { throw new IncompleteSSTableException(FileType.SUMMARY, FileType.INDEX); } + // For BTI format, we just need partitions index + if (isBtiFormat() && isMissing(FileType.PARTITIONS_INDEX)) + { + throw new IncompleteSSTableException(FileType.PARTITIONS_INDEX); + } } public abstract String getDataFileName(); + + public boolean isBigFormat() + { + return getDataFileName().contains("-big-"); + } + + public boolean isBtiFormat() + { + return getDataFileName().contains("-bti-"); + } + + public String getFormat() + { + List<String> tokens = filenameSplitter.splitToList(getDataFileName()); + return tokens.get(tokens.size() - 2); + } + + public String getVersion() + { + List<String> tokens = filenameSplitter.splitToList(getDataFileName()); + return tokens.get(tokens.size() - 4); + } Review Comment: Adding a bit more context... The filename format is internal to Cassandra. It had been changed in the past and it might be changed again in the future. As mentioned, it is just a minor one. -- 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. To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org