當前位置: 首頁>>代碼示例>>Java>>正文


Java Expressions類代碼示例

本文整理匯總了Java中net.hydromatic.linq4j.expressions.Expressions的典型用法代碼示例。如果您正苦於以下問題:Java Expressions類的具體用法?Java Expressions怎麽用?Java Expressions使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Expressions類屬於net.hydromatic.linq4j.expressions包,在下文中一共展示了Expressions類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: implement

import net.hydromatic.linq4j.expressions.Expressions; //導入依賴的package包/類
@Override
public Result implement(EnumerableRelImplementor implementor, Prefer pref) {
    if (!(implementor instanceof JavaImplementor))
        throw new IllegalStateException("implementor is not JavaImplementor");
    JavaImplementor javaImplementor = (JavaImplementor) implementor;

    int ctxId = this.context.id;
    if (javaImplementor.getParentContext() != null) {
        ctxId = javaImplementor.getParentContext().id;
    }

    PhysType physType = PhysTypeImpl.of(javaImplementor.getTypeFactory(), this.rowType, pref.preferArray());

    String execFunction = genExecFunc();

    return javaImplementor.result(physType, Blocks.toBlock(Expressions.call(table.getExpression(OLAPTable.class), execFunction, javaImplementor.getRootExpression(), Expressions.constant(ctxId))));
}
 
開發者ID:KylinOLAP,項目名稱:Kylin,代碼行數:18,代碼來源:OLAPTableScan.java

示例2: implement

import net.hydromatic.linq4j.expressions.Expressions; //導入依賴的package包/類
@Override
public Result implement(EnumerableRelImplementor implementor, Prefer pref) {
    Result result = null;
    if (this.hasSubQuery) {
        result = super.implement(implementor, pref);
    } else {
        PhysType physType = PhysTypeImpl.of(implementor.getTypeFactory(), getRowType(), pref.preferArray());

        RelOptTable factTable = context.firstTableScan.getTable();
        result = implementor.result(physType, Blocks.toBlock(Expressions.call(factTable.getExpression(OLAPTable.class), "executeIndexQuery", implementor.getRootExpression(), Expressions.constant(context.id))));
    }

    return result;
}
 
開發者ID:KylinOLAP,項目名稱:Kylin,代碼行數:15,代碼來源:OLAPJoinRel.java

示例3: buildHiveResult

import net.hydromatic.linq4j.expressions.Expressions; //導入依賴的package包/類
private Result buildHiveResult(EnumerableRelImplementor enumImplementor, Prefer pref, OLAPContext context) {
    RelDataType hiveRowType = getRowType();

    context.olapRowType = hiveRowType;
    PhysType physType = PhysTypeImpl.of(enumImplementor.getTypeFactory(), hiveRowType, pref.preferArray());

    RelOptTable factTable = context.firstTableScan.getTable();
    Result result = enumImplementor.result(physType, Blocks.toBlock(Expressions.call(factTable.getExpression(OLAPTable.class), "executeHiveQuery", enumImplementor.getRootExpression())));
    return result;
}
 
開發者ID:KylinOLAP,項目名稱:Kylin,代碼行數:11,代碼來源:OLAPToEnumerableConverter.java

示例4: select

import net.hydromatic.linq4j.expressions.Expressions; //導入依賴的package包/類
/**
 * Projects each element of a sequence into a new form.
 */
public static <T, TResult> Queryable<TResult> select(Queryable<T> source,
    FunctionExpression<Function1<T, TResult>> selector) {
  return source.getProvider().createQuery(
      Expressions.call(source.getExpression(), "select", selector),
      functionResultType(selector));
}
 
開發者ID:apache,項目名稱:incubator-optiq-linq4j,代碼行數:10,代碼來源:QueryableDefaults.java

示例5: getExpression

import net.hydromatic.linq4j.expressions.Expressions; //導入依賴的package包/類
@Override
public Expression getExpression() {
	return Expressions.convert_(Expressions.call(schema.getExpression(),
			"getTable", Expressions.constant(tableName),
			Expressions.constant(getElementType())), DataTable.class);

}
 
開發者ID:joshelser,項目名稱:cosmos,代碼行數:8,代碼來源:DataTable.java

示例6: skipWhile

import net.hydromatic.linq4j.expressions.Expressions; //導入依賴的package包/類
/**
 * Bypasses elements in a sequence as long as a
 * specified condition is true and then returns the remaining
 * elements.
 */
public static <T> Queryable<T> skipWhile(Queryable<T> source,
    FunctionExpression<Predicate1<T>> predicate) {
  return skipWhileN(source, Expressions.lambda(
      Functions.<T, Integer>toPredicate2(predicate.getFunction())));
}
 
開發者ID:apache,項目名稱:incubator-optiq-linq4j,代碼行數:11,代碼來源:QueryableDefaults.java

示例7: takeWhile

import net.hydromatic.linq4j.expressions.Expressions; //導入依賴的package包/類
/**
 * Returns elements from a sequence as long as a
 * specified condition is true.
 */
public static <T> Queryable<T> takeWhile(Queryable<T> source,
    FunctionExpression<Predicate1<T>> predicate) {
  return takeWhileN(source, Expressions.lambda(
      Functions.<T, Integer>toPredicate2(predicate.getFunction())));
}
 
開發者ID:apache,項目名稱:incubator-optiq-linq4j,代碼行數:10,代碼來源:QueryableDefaults.java

示例8: apply

import net.hydromatic.linq4j.expressions.Expressions; //導入依賴的package包/類
@Override
public Expression apply(String a0) {
  return Expressions.constant(a0);
}
 
開發者ID:joshelser,項目名稱:cosmos,代碼行數:5,代碼來源:EnumerableRelation.java

示例9: implement

import net.hydromatic.linq4j.expressions.Expressions; //導入依賴的package包/類
public Result implement(EnumerableRelImplementor implementor, Prefer pref) {
  
  final BlockBuilder list = new BlockBuilder();
  
  selectQuery = new CosmosRelNode.Plan();
  
  selectQuery.visitChild(getChild());
  
  final Expression table = list.append("table", selectQuery.table.getExpression());
  
  selectQuery.table.enqueue(selectQuery);
  
  final PhysType physType = PhysTypeImpl.of(implementor.getTypeFactory(), getReturnType(), pref.prefer(JavaRowFormat.CUSTOM));
  
  final List<String> fieldNameList = getRowType().getFieldNames();
  
  Expression accumuloResults = list.append(
      "enumerable",
      Expressions.call(table, "accumulate",
          Expressions.call(Arrays.class, "asList", Expressions.newArrayInit(String.class, Functions.apply(fieldNameList, TO_LITERAL)))));
  
  list.add(Expressions.return_(null, accumuloResults));
  
  return implementor.result(physType, list.toBlock());
  
}
 
開發者ID:joshelser,項目名稱:cosmos,代碼行數:27,代碼來源:EnumerableRelation.java

示例10: implement

import net.hydromatic.linq4j.expressions.Expressions; //導入依賴的package包/類
@Override
public Result implement(EnumerableRelImplementor implementor, Prefer pref) {
  
  final JavaTypeFactory typeFactory = implementor.getTypeFactory();
  final BlockBuilder builder = new BlockBuilder();
  final EnumerableRel child = (EnumerableRel) getChild();
  
  Plan aggregatePlan = new Plan();
  
  List<String> fieldName = child.getRowType().getFieldNames();
  
  for (int i = 0; i < getGroupCount(); i++) {
    if (getGroupSet().get(i)) {
      aggregatePlan.add("groupBy", new Field(fieldName.get(i)));
    }
  }
  
  accumuloAccessor.groupBy(aggregatePlan);
  
  final Result result = implementor.visitChild(this, 0, child, pref);
  
  Expression childExp = builder.append("child", result.block);
  
  final PhysType physType = PhysTypeImpl.of(typeFactory, getRowType(), pref.preferCustom());
  
  builder.add(Expressions.return_(null, childExp));
  
  return implementor.result(physType, builder.toBlock());
}
 
開發者ID:joshelser,項目名稱:cosmos,代碼行數:30,代碼來源:GroupBy.java


注:本文中的net.hydromatic.linq4j.expressions.Expressions類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。