[CARBONDATA-4278] Avoid refetching all indexes to get segment properties
Why is this PR needed?
When block index[BlockIndex] is available then no need to prepare indexes[List[BlockIndex] from available segments and partition locations which might cause delay in query performance.
What changes were proposed in this PR?
Call directly get segment properties if block index[BlockIndex] available.
if (segmentIndices.get(0) instanceof BlockIndex) {
segmentProperties =
segmentPropertiesFetcher.getSegmentPropertiesFromIndex(segmentIndices.get(0));
} else {
segmentProperties =
segmentPropertiesFetcher.getSegmentProperties(segment, partitionLocations);
}
getSegmentPropertiesFromIndex is calling directly block index segment properties.
Does this PR introduce any user interface change?
No
Is any new testcase added?
No. Already index related test cases are present which can cover the added code.
This closes #4209