15 package com.cloudera.impala.planner;
17 import java.util.List;
21 import com.cloudera.impala.thrift.TExplainLevel;
22 import com.cloudera.impala.thrift.TNetworkAddress;
23 import com.cloudera.impala.thrift.TScanRangeLocations;
24 import com.google.common.base.Joiner;
25 import com.google.common.base.Objects;
26 import com.google.common.base.Preconditions;
27 import com.google.common.collect.Lists;
45 super(
id, desc.
getId().asList(), displayName);
55 Preconditions.checkNotNull(
scanRanges_,
"Need to call init() first.");
61 return Objects.toStringHelper(
this)
63 .add(
"tblName", desc_.getTable().getFullName())
65 .addValue(super.debugString())
76 StringBuilder output =
new StringBuilder();
79 output.append(prefix +
"table stats: unavailable");
81 output.append(prefix +
"table stats: " + desc_.getTable().getNumRows() +
90 List<String> columnsMissingStats = Lists.newArrayList();
92 if (!slot.getStats().hasStats() && slot.getColumn() != null) {
93 columnsMissingStats.add(slot.getColumn().getName());
96 if (columnsMissingStats.isEmpty()) {
97 output.append(prefix +
"column stats: all");
98 }
else if (columnsMissingStats.size() == desc_.getSlots().size()) {
99 output.append(prefix +
"column stats: unavailable");
101 output.append(String.format(
"%scolumns missing stats: %s", prefix,
102 Joiner.on(
", ").join(columnsMissingStats)));
104 return output.toString();
122 if (!slot.getStats().hasStats())
return true;
133 TNetworkAddress result =
new TNetworkAddress();
134 String[] hostPort = address.split(
":");
135 result.hostname = hostPort[0];
136 result.port = Integer.parseInt(hostPort[1]);
static TNetworkAddress addressToTNetworkAddress(String address)
String getStatsExplainString(String prefix, TExplainLevel detailLevel)
boolean isTableMissingStats()
boolean isTableMissingTableStats()
long getInputCardinality()
List< Expr > getConjuncts()
int numPartitionsMissingStats_
List< TScanRangeLocations > getScanRangeLocations()
final TupleDescriptor desc_
ArrayList< SlotDescriptor > getSlots()
TupleDescriptor getTupleDesc()
boolean isTableMissingColumnStats()
ScanNode(PlanNodeId id, TupleDescriptor desc, String displayName)
List< TScanRangeLocations > scanRanges_