[fix](statistics) fix npe when __internal_schema not created (#15464)

This commit is contained in:
Kikyou1997
2022-12-29 21:24:33 +08:00
committed by GitHub
parent 9b371f6b0b
commit c54c2f8035

View File

@ -53,10 +53,12 @@ import org.apache.doris.system.SystemInfoService;
import org.apache.doris.thrift.TUniqueId;
import com.google.common.base.Preconditions;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.text.StringSubstitutor;
import org.apache.thrift.TException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@ -99,6 +101,9 @@ public class StatisticsUtil {
public static List<ColumnStatistic> deserializeToColumnStatistics(List<ResultRow> resultBatches)
throws Exception {
if (CollectionUtils.isEmpty(resultBatches)) {
return Collections.emptyList();
}
return resultBatches.stream().map(ColumnStatistic::fromResultRow).collect(Collectors.toList());
}