[enhance](mtmv)when calculating the availability of MTMV, no longer c… (#36617)
pick: #36507
This commit is contained in:
@ -62,8 +62,8 @@ public class MTMVRewriteUtil {
|
||||
return res;
|
||||
}
|
||||
// check mv is normal
|
||||
if (!(mtmv.getStatus().getState() == MTMVState.NORMAL
|
||||
&& mtmv.getStatus().getRefreshState() == MTMVRefreshState.SUCCESS)) {
|
||||
if (mtmv.getStatus().getState() != MTMVState.NORMAL
|
||||
|| mtmv.getStatus().getRefreshState() == MTMVRefreshState.INIT) {
|
||||
return res;
|
||||
}
|
||||
Map<String, Set<String>> partitionMappings = null;
|
||||
|
||||
@ -256,7 +256,20 @@ public class MTMVRewriteUtilTest {
|
||||
};
|
||||
Collection<Partition> mtmvCanRewritePartitions = MTMVRewriteUtil
|
||||
.getMTMVCanRewritePartitions(mtmv, ctx, currentTimeMills);
|
||||
Assert.assertEquals(0, mtmvCanRewritePartitions.size());
|
||||
Assert.assertEquals(1, mtmvCanRewritePartitions.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetMTMVCanRewritePartitionsRefreshStateInit() {
|
||||
new Expectations() {
|
||||
{
|
||||
status.getRefreshState();
|
||||
minTimes = 0;
|
||||
result = MTMVRefreshState.INIT;
|
||||
}
|
||||
};
|
||||
Collection<Partition> mtmvCanRewritePartitions = MTMVRewriteUtil
|
||||
.getMTMVCanRewritePartitions(mtmv, ctx, currentTimeMills);
|
||||
Assert.assertEquals(0, mtmvCanRewritePartitions.size());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user