ShreelekhyaG commented on a change in pull request #3988:
URL: https://github.com/apache/carbondata/pull/3988#discussion_r611628424
##########
File path:
integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/util/SecondaryIndexUtil.scala
##########
@@ -217,8 +216,16 @@ object SecondaryIndexUtil {
}
if (finalMergeStatus) {
if (null != mergeStatus && mergeStatus.length != 0) {
+ // Segment file is not yet written during SI load, then we can
delete old index
+ // files immediately. If segment file is already present and SI
refresh is triggered, then
+ // do not delete immediately to avoid failures during parallel
queries.
val validSegmentsToUse = validSegments.asScala
- .filter(segment =>
mergeStatus.map(_._2).toSet.contains(segment.getSegmentNo))
+ .filter(segment => {
Review comment:
we can either check or make default behavior for load/rebuild command.
As reading segment file can be a costly operation, I have changed to
`isFileExist`.
--
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:
[email protected]