本文整理了Java中org.apache.calcite.linq4j.Enumerable.select()
方法的一些代码示例,展示了Enumerable.select()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Enumerable.select()
方法的具体详情如下:
包路径:org.apache.calcite.linq4j.Enumerable
类名称:Enumerable
方法名:select
暂无
代码示例来源:origin: Qihoo360/Quicksql
/** Converts an {@link Enumerable} over object arrays into an
* {@link Enumerable} over {@link Row} objects. */
public static Enumerable<Row> toRow(final Enumerable<Object[]> enumerable) {
return enumerable.select((Function1<Object[], Row>) Row::asCopy);
}
代码示例来源:origin: org.apache.calcite/calcite-core
/** Converts an enumerable over singleton arrays into the enumerable of their
* first elements. */
public static <E> Enumerable<E> slice0(Enumerable<E[]> enumerable) {
//noinspection unchecked
return enumerable.select(elements -> elements[0]);
}
代码示例来源:origin: org.apache.calcite/calcite-core
/** Converts an {@link Enumerable} over object arrays into an
* {@link Enumerable} over {@link Row} objects. */
public static Enumerable<Row> toRow(final Enumerable<Object[]> enumerable) {
return enumerable.select((Function1<Object[], Row>) Row::asCopy);
}
代码示例来源:origin: Qihoo360/Quicksql
public Enumerable<Object[]> scan(DataContext root) {
if (elementType == Object[].class) {
//noinspection unchecked
return enumerable;
} else {
//noinspection unchecked
return enumerable.select(new FieldSelector((Class) elementType));
}
}
代码示例来源:origin: org.apache.calcite/calcite-linq4j
/**
* Invokes a transform function on each element of a
* sequence and returns the maximum nullable Float
* value.
*/
public static <TSource> Float max(Enumerable<TSource> source,
NullableFloatFunction1<TSource> selector) {
return aggregate(source.select(selector), null, Extensions.FLOAT_MAX);
}
代码示例来源:origin: org.apache.calcite/calcite-linq4j
/**
* Invokes a transform function on each element of a
* sequence and returns the minimum nullable Double
* value.
*/
public static <TSource> Double min(Enumerable<TSource> source,
NullableDoubleFunction1<TSource> selector) {
return aggregate(source.select(selector), null, Extensions.DOUBLE_MIN);
}
代码示例来源:origin: org.apache.calcite/calcite-linq4j
/**
* Computes the sum of the sequence of nullable
* Decimal values that are obtained by invoking a transform
* function on each element of the input sequence.
*/
public static <TSource> BigDecimal sum(Enumerable<TSource> source,
NullableBigDecimalFunction1<TSource> selector) {
return aggregate(source.select(selector), BigDecimal.ZERO,
Extensions.BIG_DECIMAL_SUM);
}
代码示例来源:origin: org.apache.calcite/calcite-linq4j
/**
* Computes the sum of the sequence of nullable
* Double values that are obtained by invoking a transform
* function on each element of the input sequence.
*/
public static <TSource> Double sum(Enumerable<TSource> source,
NullableDoubleFunction1<TSource> selector) {
return aggregate(source.select(selector), 0d, Extensions.DOUBLE_SUM);
}
代码示例来源:origin: org.apache.calcite/calcite-linq4j
/**
* Invokes a transform function on each element of a
* sequence and returns the maximum Double value.
*/
public static <TSource> double max(Enumerable<TSource> source,
DoubleFunction1<TSource> selector) {
return aggregate(source.select(adapt(selector)), null,
Extensions.DOUBLE_MAX);
}
代码示例来源:origin: org.apache.calcite/calcite-linq4j
/**
* Invokes a transform function on each element of a
* generic sequence and returns the maximum resulting
* value.
*/
public static <TSource, TResult extends Comparable<TResult>> TResult max(
Enumerable<TSource> source, Function1<TSource, TResult> selector) {
Function2<TResult, TResult, TResult> max = maxFunction();
return aggregate(source.select(selector), null, max);
}
代码示例来源:origin: org.apache.calcite/calcite-linq4j
/**
* Invokes a transform function on each element of a
* sequence and returns the minimum int value.
*/
public static <TSource> int min(Enumerable<TSource> source,
IntegerFunction1<TSource> selector) {
return aggregate(source.select(adapt(selector)), null,
Extensions.INTEGER_MIN);
}
代码示例来源:origin: org.apache.calcite/calcite-linq4j
/**
* Invokes a transform function on each element of a
* generic sequence and returns the minimum resulting
* value.
*/
public static <TSource, TResult extends Comparable<TResult>> TResult min(
Enumerable<TSource> source, Function1<TSource, TResult> selector) {
Function2<TResult, TResult, TResult> min = minFunction();
return aggregate(source.select(selector), null, min);
}
代码示例来源:origin: org.apache.calcite/calcite-linq4j
/**
* Computes the sum of the sequence of Double values
* that are obtained by invoking a transform function on each
* element of the input sequence.
*/
public static <TSource> double sum(Enumerable<TSource> source,
DoubleFunction1<TSource> selector) {
return aggregate(source.select(adapt(selector)), 0d, Extensions.DOUBLE_SUM);
}
代码示例来源:origin: org.apache.calcite/calcite-linq4j
/**
* Computes the sum of the sequence of Float values
* that are obtained by invoking a transform function on each
* element of the input sequence.
*/
public static <TSource> float sum(Enumerable<TSource> source,
FloatFunction1<TSource> selector) {
return aggregate(source.select(adapt(selector)), 0F, Extensions.FLOAT_SUM);
}
代码示例来源:origin: org.apache.calcite/calcite-linq4j
/**
* Invokes a transform function on each element of a
* sequence and returns the maximum Float value.
*/
public static <TSource> float max(Enumerable<TSource> source,
FloatFunction1<TSource> selector) {
return aggregate(source.select(adapt(selector)), null,
Extensions.FLOAT_MAX);
}
代码示例来源:origin: org.apache.calcite/calcite-linq4j
/**
* Computes the sum of the sequence of int values
* that are obtained by invoking a transform function on each
* element of the input sequence.
*/
public static <TSource> int sum(Enumerable<TSource> source,
IntegerFunction1<TSource> selector) {
return aggregate(source.select(adapt(selector)), 0, Extensions.INTEGER_SUM);
}
代码示例来源:origin: org.apache.calcite/calcite-linq4j
/**
* Computes the sum of the sequence of long values
* that are obtained by invoking a transform function on each
* element of the input sequence.
*/
public static <TSource> long sum(Enumerable<TSource> source,
LongFunction1<TSource> selector) {
return aggregate(source.select(adapt(selector)), 0L, Extensions.LONG_SUM);
}
代码示例来源:origin: org.apache.calcite/calcite-core
CatalogScope(SqlValidatorScope parent, List<String> names) {
super(parent);
this.names = ImmutableList.copyOf(names);
this.schemaNames =
Linq4j.asEnumerable(
validator.getCatalogReader()
.getAllSchemaObjectNames(ImmutableList.of()))
.where(input -> input.getType() == SqlMonikerType.SCHEMA)
.select(SqlMoniker::getFullyQualifiedNames)
.into(new HashSet<>());
}
代码示例来源:origin: Qihoo360/Quicksql
CatalogScope(SqlValidatorScope parent, List<String> names) {
super(parent);
this.names = ImmutableList.copyOf(names);
this.schemaNames =
Linq4j.asEnumerable(
validator.getCatalogReader()
.getAllSchemaObjectNames(ImmutableList.of()))
.where(input -> input.getType() == SqlMonikerType.SCHEMA)
.select(SqlMoniker::getFullyQualifiedNames)
.into(new HashSet<>());
}
代码示例来源:origin: Qihoo360/Quicksql
Enumerable<MetaSchema> schemas(final String catalog) {
return Linq4j.asEnumerable(
getConnection().rootSchema.getSubSchemaMap().values())
.select((Function1<CalciteSchema, MetaSchema>) calciteSchema ->
new CalciteMetaSchema(calciteSchema, catalog,
calciteSchema.getName()))
.orderBy((Function1<MetaSchema, Comparable>) metaSchema ->
(Comparable) FlatLists.of(Util.first(metaSchema.tableCatalog, ""),
metaSchema.tableSchem));
}
内容来源于网络,如有侵权,请联系作者删除!