Github user xuchuanyin commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2324#discussion_r189798225
--- Diff:
datamap/bloom/src/main/java/org/apache/carbondata/datamap/bloom/BloomDataMapCache.java
---
@@ -133,15 +132,14 @@ private int validateAndGetCacheSize() {
*/
private List<BloomDMModel> loadBloomDataMapModel(CacheKey cacheKey) {
DataInputStream dataInStream = null;
- ObjectInputStream objectInStream = null;
List<BloomDMModel> bloomDMModels = new ArrayList<BloomDMModel>();
try {
String indexFile = getIndexFileFromCacheKey(cacheKey);
dataInStream = FileFactory.getDataInputStream(indexFile,
FileFactory.getFileType(indexFile));
- objectInStream = new ObjectInputStream(dataInStream);
try {
- BloomDMModel model = null;
- while ((model = (BloomDMModel) objectInStream.readObject()) !=
null) {
+ while (dataInStream.available() > 0) {
--- End diff --
That's my understanding of the javadoc.
If the datamap file is small, it may not cause problem, but I insist that
it will cause problem in some scenario.
---