Skip to content

Commit

Permalink
Merge d3e5940 into 6b853ce
Browse files Browse the repository at this point in the history
  • Loading branch information
caidezhi committed Nov 18, 2019
2 parents 6b853ce + d3e5940 commit e74e18d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Expand Up @@ -94,7 +94,7 @@ public static StorageURL valueOf(String metadataUrl) {
}
}

this.identifier = n.isEmpty() || n==null ? "kylin_metadata" : n;
this.identifier = n==null || n.isEmpty() ? "kylin_metadata" : n;
this.scheme = s;
this.params = ImmutableMap.copyOf(m);
}
Expand Down
Expand Up @@ -22,6 +22,7 @@
import java.util.Locale;
import java.util.function.Function;

import com.google.common.base.Preconditions;
import org.apache.commons.lang3.StringUtils;
import org.apache.kylin.common.util.ClassUtil;
import org.apache.kylin.common.util.DateFormat;
Expand Down Expand Up @@ -321,9 +322,8 @@ public String buildDateRangeCondition(PartitionDesc partDesc, ISegment seg, Segm
long endExclusive = (Long) segRange.end.v;

TblColRef partitionColumn = partDesc.getPartitionDateColumnRef();
if (partitionColumn != null) {
partitionColumn.setQuotedFunc(func);
}
Preconditions.checkNotNull(partitionColumn);
partitionColumn.setQuotedFunc(func);
String tableAlias = partitionColumn.getTableAlias();

String concatField = String.format(Locale.ROOT, "CONCAT(%s.YEAR,'-',%s.MONTH,'-',%s.DAY)", tableAlias,
Expand Down
Expand Up @@ -19,6 +19,7 @@
package org.apache.kylin.engine.mr.common;

import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand All @@ -45,7 +46,7 @@ public static Map<Long, Long> readCuboidStatsFromCube(Set<Long> cuboidIds, CubeI
} catch (IOException e) {
logger.warn("Fail to read statistics for cube " + cubeInstance.getName() + " due to " + e);
}
return statisticsMerged.isEmpty() ? null : statisticsMerged;
return statisticsMerged == null ? Collections.emptyMap() : statisticsMerged;
}

public static Pair<Map<Long, Long>, Map<Long, Double>> readCuboidStatsAndSizeFromCube(Set<Long> cuboidIds,
Expand Down
Expand Up @@ -80,6 +80,7 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.google.common.base.Preconditions;

/**
* StreamingController is defined as Restful API entrance for UI.
Expand Down Expand Up @@ -495,6 +496,7 @@ private TableDesc deserializeTableDesc(StreamingRequestV2 streamingRequest) {
throw new InternalErrorException("Failed to deal with the request:" + e.getMessage(), e);
}

Preconditions.checkNotNull(desc, "Failed to deserialize from TableDesc definition");
String[] dbTable = HadoopUtil.parseHiveTableName(desc.getName());
desc.setName(dbTable[1]);
desc.setDatabase(dbTable[0]);
Expand Down

0 comments on commit e74e18d

Please sign in to comment.