Java Code Examples for org.apache.calcite.rel.RelWriter#itemIf()

The following examples show how to use org.apache.calcite.rel.RelWriter#itemIf() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ScanRelBase.java    From dremio-oss with Apache License 2.0 6 votes vote down vote up
@Override
public RelWriter explainTerms(RelWriter pw) {
  pw.item("table", tableMetadata.getName());
  if(projectedColumns != null){
    pw.item("columns", FluentIterable.from(projectedColumns).transform(new Function<SchemaPath, String>(){

      @Override
      public String apply(SchemaPath input) {
        return input.toString();
      }}).join(Joiner.on(", ")));
  }

  pw.item("splits", getTableMetadata().getSplitCount());

  if(observedRowcountAdjustment != 1.0d){
    pw.item("rowAdjust", observedRowcountAdjustment);
  }

  // we need to include the table metadata digest since not all properties (specifically which splits) are included in the explain output  (what base computeDigest uses).
  pw.itemIf("tableDigest", tableMetadata.computeDigest(), pw.getDetailLevel() == SqlExplainLevel.DIGEST_ATTRIBUTES);

  return pw;
}
 
Example 2
Source File: DrillLimitRelBase.java    From Bats with Apache License 2.0 5 votes vote down vote up
@Override
public RelWriter explainTerms(RelWriter pw) {
  super.explainTerms(pw);
  pw.itemIf("offset", offset, offset != null);
  pw.itemIf("fetch", fetch, fetch != null);
  return pw;
}
 
Example 3
Source File: LimitPrel.java    From Bats with Apache License 2.0 4 votes vote down vote up
@Override
public RelWriter explainTerms(RelWriter pw) {
  super.explainTerms(pw);
  pw.itemIf("partitioned", isPartitioned, isPartitioned);
  return pw;
}
 
Example 4
Source File: ElasticsearchLimit.java    From dk-fitting with Apache License 2.0 4 votes vote down vote up
public RelWriter explainTerms(RelWriter pw) {
    super.explainTerms(pw);
    pw.itemIf("offset", offset, offset != null);
    pw.itemIf("fetch", fetch, fetch != null);
    return pw;
}
 
Example 5
Source File: ElasticsearchLimit.java    From dk-fitting with Apache License 2.0 4 votes vote down vote up
public RelWriter explainTerms(RelWriter pw) {
    super.explainTerms(pw);
    pw.itemIf("offset", offset, offset != null);
    pw.itemIf("fetch", fetch, fetch != null);
    return pw;
}
 
Example 6
Source File: HiveRulesFactory.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
@Override
public RelWriter explainTerms(RelWriter pw) {
  pw = super.explainTerms(pw);
  return pw.itemIf("filters",  filter, filter != null);
}
 
Example 7
Source File: HiveRulesFactory.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
@Override
public RelWriter explainTerms(RelWriter pw) {
  pw = super.explainTerms(pw);
  pw = pw.item("mode", readerType.name());
  return pw.itemIf("filters", filter, filter != null);
}
 
Example 8
Source File: CassandraLimit.java    From calcite with Apache License 2.0 4 votes vote down vote up
public RelWriter explainTerms(RelWriter pw) {
  super.explainTerms(pw);
  pw.itemIf("offset", offset, offset != null);
  pw.itemIf("fetch", fetch, fetch != null);
  return pw;
}