congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
RelMdCollation.values
Code IndexAdd Tabnine to your IDE (free)

How to use
values
method
in
org.apache.calcite.rel.metadata.RelMdCollation

Best Java code snippets using org.apache.calcite.rel.metadata.RelMdCollation.values (Showing top 10 results out of 315)

origin: apache/kylin

  public RelDistribution get() {
    return RelMdDistribution.values(rowType, tuples);
  }
});
origin: org.apache.kylin/kylin-query

  public RelDistribution get() {
    return RelMdDistribution.values(rowType, tuples);
  }
});
origin: Qihoo360/Quicksql

public ImmutableList<RelCollation> collations(Values values,
  RelMetadataQuery mq) {
 return ImmutableList.copyOf(
   values(mq, values.getRowType(), values.getTuples()));
}
origin: org.apache.calcite/calcite-core

public ImmutableList<RelCollation> collations(Values values,
  RelMetadataQuery mq) {
 return ImmutableList.copyOf(
   values(mq, values.getRowType(), values.getTuples()));
}
origin: Qihoo360/Quicksql

/** Creates a LogicalValues. */
public static LogicalValues create(RelOptCluster cluster,
  final RelDataType rowType,
  final ImmutableList<ImmutableList<RexLiteral>> tuples) {
 final RelMetadataQuery mq = cluster.getMetadataQuery();
 final RelTraitSet traitSet = cluster.traitSetOf(Convention.NONE)
   .replaceIfs(RelCollationTraitDef.INSTANCE,
     () -> RelMdCollation.values(mq, rowType, tuples));
 return new LogicalValues(cluster, traitSet, rowType, tuples);
}
origin: org.apache.calcite/calcite-core

/** Creates a LogicalValues. */
public static LogicalValues create(RelOptCluster cluster,
  final RelDataType rowType,
  final ImmutableList<ImmutableList<RexLiteral>> tuples) {
 final RelMetadataQuery mq = cluster.getMetadataQuery();
 final RelTraitSet traitSet = cluster.traitSetOf(Convention.NONE)
   .replaceIfs(RelCollationTraitDef.INSTANCE,
     () -> RelMdCollation.values(mq, rowType, tuples));
 return new LogicalValues(cluster, traitSet, rowType, tuples);
}
origin: org.apache.calcite/calcite-core

/** Creates an EnumerableValues. */
public static EnumerableValues create(RelOptCluster cluster,
  final RelDataType rowType,
  final ImmutableList<ImmutableList<RexLiteral>> tuples) {
 final RelMetadataQuery mq = cluster.getMetadataQuery();
 final RelTraitSet traitSet =
   cluster.traitSetOf(EnumerableConvention.INSTANCE)
     .replaceIfs(RelCollationTraitDef.INSTANCE,
       () -> RelMdCollation.values(mq, rowType, tuples))
     .replaceIf(RelDistributionTraitDef.INSTANCE,
       () -> RelMdDistribution.values(rowType, tuples));
 return new EnumerableValues(cluster, rowType, tuples, traitSet);
}
origin: Qihoo360/Quicksql

/** Creates an EnumerableValues. */
public static EnumerableValues create(RelOptCluster cluster,
  final RelDataType rowType,
  final ImmutableList<ImmutableList<RexLiteral>> tuples) {
 final RelMetadataQuery mq = cluster.getMetadataQuery();
 final RelTraitSet traitSet =
   cluster.traitSetOf(EnumerableConvention.INSTANCE)
     .replaceIfs(RelCollationTraitDef.INSTANCE,
       () -> RelMdCollation.values(mq, rowType, tuples))
     .replaceIf(RelDistributionTraitDef.INSTANCE,
       () -> RelMdDistribution.values(rowType, tuples));
 return new EnumerableValues(cluster, rowType, tuples, traitSet);
}
origin: Qihoo360/Quicksql

collations = RelMdCollation.values(mq, empTable.getRowType(),
  ImmutableList.of());
assertThat(collations.toString(),
addRow(tuples, rexBuilder, 2, 3, 2, 2);
addRow(tuples, rexBuilder, 3, 3, 1, 4);
collations = RelMdCollation.values(mq, rowType, tuples.build());
assertThat(collations.toString(),
  equalTo("[[0, 1, 2, 3], [1, 3]]"));
origin: org.apache.calcite/calcite-core

collations = RelMdCollation.values(mq, empTable.getRowType(),
  ImmutableList.of());
assertThat(collations.toString(),
addRow(tuples, rexBuilder, 2, 3, 2, 2);
addRow(tuples, rexBuilder, 3, 3, 1, 4);
collations = RelMdCollation.values(mq, rowType, tuples.build());
assertThat(collations.toString(),
  equalTo("[[0, 1, 2, 3], [1, 3]]"));
org.apache.calcite.rel.metadataRelMdCollationvalues

Javadoc

Helper method to determine a org.apache.calcite.rel.core.Values's collation.

We actually under-report the collations. A Values with 0 or 1 rows - an edge case, but legitimate and very common - is ordered by every permutation of every subset of the columns.

So, our algorithm aims to:

  • produce at most N collations (where N is the number of columns);
  • make each collation as long as possible;
  • do not repeat combinations already emitted - if we've emitted (a, b) do not later emit (b, a);
  • probe the actual values and make sure that each collation is consistent with the data

So, for an empty Values with 4 columns, we would emit (a, b, c, d), (b, c, d), (c, d), (d).

Popular methods of RelMdCollation

  • project
    Helper method to determine a Project's collation.
  • mergeJoin
    Helper method to determine a Join's collation assuming that it uses a merge-join algorithm.If the in
  • sort
    Helper method to determine a org.apache.calcite.rel.core.Sort's collation.
  • table
    Helper method to determine a org.apache.calcite.rel.core.TableScan's collation.
  • calc
    Helper method to determine a org.apache.calcite.rel.core.Calc's collation.
  • comparator
  • filter
    Helper method to determine a org.apache.calcite.rel.core.Filter's collation.
  • limit
    Helper method to determine a limit's collation.
  • window
    Helper method to determine a org.apache.calcite.rel.core.Window's collation.A Window projects the fi

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (Timer)
  • getApplicationContext (Context)
  • setScale (BigDecimal)
  • Kernel (java.awt.image)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • JTextField (javax.swing)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now