当前位置: 首页>>代码示例>>Java>>正文


Java SqlFunction.getKind方法代码示例

本文整理汇总了Java中org.apache.calcite.sql.SqlFunction.getKind方法的典型用法代码示例。如果您正苦于以下问题:Java SqlFunction.getKind方法的具体用法?Java SqlFunction.getKind怎么用?Java SqlFunction.getKind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.calcite.sql.SqlFunction的用法示例。


在下文中一共展示了SqlFunction.getKind方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: DrillCalciteSqlFunctionWrapper

import org.apache.calcite.sql.SqlFunction; //导入方法依赖的package包/类
public DrillCalciteSqlFunctionWrapper(
    final SqlFunction wrappedFunction,
  final List<DrillFuncHolder> functions) {
  super(wrappedFunction.getName(),
      wrappedFunction.getSqlIdentifier(),
      wrappedFunction.getKind(),
      TypeInferenceUtils.getDrillSqlReturnTypeInference(
          wrappedFunction.getName(),
          functions),
      wrappedFunction.getOperandTypeInference(),
      Checker.ANY_CHECKER,
      wrappedFunction.getParamTypes(),
      wrappedFunction.getFunctionType());
  this.operator = wrappedFunction;
}
 
开发者ID:axbaretto,项目名称:drill,代码行数:16,代码来源:DrillCalciteSqlFunctionWrapper.java

示例2: visitCall

import org.apache.calcite.sql.SqlFunction; //导入方法依赖的package包/类
@Override
public RexNode visitCall(final RexCall call) {
	RexNode newCall;

	boolean[] update = {false};
	List<RexNode> clonedOperands = visitList(call.operands, update);
	if (update[0]) {
		SqlOperator operator = call.getOperator();

		boolean isSpecialCast = false;
		if (operator instanceof SqlFunction) {
			SqlFunction function = (SqlFunction) operator;
			if (function.getKind() == SqlKind.CAST) {
				if (call.operands.size() < 2) {
					isSpecialCast = true;
				}
			}
		}

		final RelDataType newType;
		if (!isSpecialCast) {
			// TODO: ideally this only needs to be called if the result
			// type will also change. However, since that requires
			// support from type inference rules to tell whether a rule
			// decides return type based on input types, for now all
			// operators will be recreated with new type if any operand
			// changed, unless the operator has "built-in" type.
			newType = rexBuilder.deriveReturnType(operator, clonedOperands);
		} else {
			// Use the current return type when creating a new call, for
			// operators with return type built into the operator
			// definition, and with no type inference rules, such as
			// cast function with less than 2 operands.

			// TODO: Comments in RexShuttle.visitCall() mention other
			// types in this category. Need to resolve those together
			// and preferably in the base class RexShuttle.
			newType = call.getType();
		}
		newCall = rexBuilder.makeCall(newType, operator, clonedOperands);
	} else {
		newCall = call;
	}

	if (projectPulledAboveLeftCorrelator && (nullIndicator != null)) {
		return createCaseExpression(nullIndicator, rexBuilder.constantNull(), newCall);
	}
	return newCall;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:50,代码来源:FlinkRelDecorrelator.java

示例3: visitCall

import org.apache.calcite.sql.SqlFunction; //导入方法依赖的package包/类
@Override public RexNode visitCall(final RexCall call) {
  RexNode newCall;

  boolean[] update = {false};
  List<RexNode> clonedOperands = visitList(call.operands, update);
  if (update[0]) {
    SqlOperator operator = call.getOperator();

    boolean isSpecialCast = false;
    if (operator instanceof SqlFunction) {
      SqlFunction function = (SqlFunction) operator;
      if (function.getKind() == SqlKind.CAST) {
        if (call.operands.size() < 2) {
          isSpecialCast = true;
        }
      }
    }

    final RelDataType newType;
    if (!isSpecialCast) {
      // TODO: ideally this only needs to be called if the result
      // type will also change. However, since that requires
      // support from type inference rules to tell whether a rule
      // decides return type based on input types, for now all
      // operators will be recreated with new type if any operand
      // changed, unless the operator has "built-in" type.
      newType = rexBuilder.deriveReturnType(operator, clonedOperands);
    } else {
      // Use the current return type when creating a new call, for
      // operators with return type built into the operator
      // definition, and with no type inference rules, such as
      // cast function with less than 2 operands.

      // TODO: Comments in RexShuttle.visitCall() mention other
      // types in this category. Need to resolve those together
      // and preferably in the base class RexShuttle.
      newType = call.getType();
    }
    newCall =
        rexBuilder.makeCall(
            newType,
            operator,
            clonedOperands);
  } else {
    newCall = call;
  }

  if (projectPulledAboveLeftCorrelator && (nullIndicator != null)) {
    return createCaseExpression(
        nullIndicator,
        rexBuilder.constantNull(),
        newCall);
  }
  return newCall;
}
 
开发者ID:apache,项目名称:calcite,代码行数:56,代码来源:RelDecorrelator.java


注:本文中的org.apache.calcite.sql.SqlFunction.getKind方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。