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


Java Util.needToImplement方法代码示例

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


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

示例1: rewriteRel

import org.apache.calcite.util.Util; //导入方法依赖的package包/类
public void rewriteRel(Sort rel) {
  RelCollation oldCollation = rel.getCollation();
  final RelNode oldChild = rel.getInput();
  final RelNode newChild = getNewForOldRel(oldChild);
  final Mappings.TargetMapping mapping =
      getNewForOldInputMapping(oldChild);

  // validate
  for (RelFieldCollation field : oldCollation.getFieldCollations()) {
    int oldInput = field.getFieldIndex();
    RelDataType sortFieldType =
        oldChild.getRowType().getFieldList().get(oldInput).getType();
    if (sortFieldType.isStruct()) {
      // TODO jvs 10-Feb-2005
      throw Util.needToImplement("sorting on structured types");
    }
  }
  RelCollation newCollation = RexUtil.apply(mapping, oldCollation);
  Sort newRel =
      LogicalSort.create(newChild, newCollation, rel.offset, rel.fetch);
  setNewForOldRel(rel, newRel);
}
 
开发者ID:apache,项目名称:calcite,代码行数:23,代码来源:RelStructuredTypeFlattener.java

示例2: getDynamicParamType

import org.apache.calcite.util.Util; //导入方法依赖的package包/类
/**
 * Returns the type inferred for a dynamic parameter.
 *
 * @param index 0-based index of dynamic parameter
 * @return inferred type, never null
 */
public RelDataType getDynamicParamType(int index) {
	SqlNode sqlNode = dynamicParamSqlNodes.get(index);
	if (sqlNode == null) {
		throw Util.needToImplement("dynamic param type inference");
	}
	return validator.getValidatedNodeType(sqlNode);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:14,代码来源:SqlToRelConverter.java

示例3: getDynamicParamType

import org.apache.calcite.util.Util; //导入方法依赖的package包/类
/**
 * Returns the type inferred for a dynamic parameter.
 *
 * @param index 0-based index of dynamic parameter
 * @return inferred type, never null
 */
public RelDataType getDynamicParamType(int index) {
  SqlNode sqlNode = dynamicParamSqlNodes.get(index);
  if (sqlNode == null) {
    throw Util.needToImplement("dynamic param type inference");
  }
  return validator.getValidatedNodeType(sqlNode);
}
 
开发者ID:apache,项目名称:kylin,代码行数:14,代码来源:SqlToRelConverter.java

示例4: convertCall

import org.apache.calcite.util.Util; //导入方法依赖的package包/类
public RexNode convertCall(SqlRexContext cx, SqlCall call) {
  final SqlRexConvertlet convertlet = convertletTable.get(call);
  if (convertlet != null) {
    return convertlet.convertCall(cx, call);
  }

  // No convertlet was suitable. (Unlikely, because the standard
  // convertlet table has a fall-back for all possible calls.)
  throw Util.needToImplement(call);
}
 
开发者ID:apache,项目名称:calcite,代码行数:11,代码来源:SqlNodeToRexConverterImpl.java

示例5: getValidatedNodeType

import org.apache.calcite.util.Util; //导入方法依赖的package包/类
public RelDataType getValidatedNodeType(SqlNode node) {
  RelDataType type = getValidatedNodeTypeIfKnown(node);
  if (type == null) {
    throw Util.needToImplement(node);
  } else {
    return type;
  }
}
 
开发者ID:apache,项目名称:calcite,代码行数:9,代码来源:SqlValidatorImpl.java

示例6: visit

import org.apache.calcite.util.Util; //导入方法依赖的package包/类
public RelDataType visit(SqlNodeList nodeList) {
  // Operand is of a type that we can't derive a type for. If the
  // operand is of a peculiar type, such as a SqlNodeList, then you
  // should override the operator's validateCall() method so that it
  // doesn't try to validate that operand as an expression.
  throw Util.needToImplement(nodeList);
}
 
开发者ID:apache,项目名称:calcite,代码行数:8,代码来源:SqlValidatorImpl.java

示例7: getOperandCountRange

import org.apache.calcite.util.Util; //导入方法依赖的package包/类
/**
 * Returns a constraint on the number of operands expected by this operator.
 * Subclasses may override this method; when they don't, the range is
 * derived from the {@link SqlOperandTypeChecker} associated with this
 * operator.
 *
 * @return acceptable range
 */
public SqlOperandCountRange getOperandCountRange() {
  if (operandTypeChecker != null) {
    return operandTypeChecker.getOperandCountRange();
  }

  // If you see this error you need to override this method
  // or give operandTypeChecker a value.
  throw Util.needToImplement(this);
}
 
开发者ID:apache,项目名称:calcite,代码行数:18,代码来源:SqlOperator.java

示例8: inferReturnType

import org.apache.calcite.util.Util; //导入方法依赖的package包/类
/**
 * Infers the return type of an invocation of this operator; only called
 * after the number and types of operands have already been validated.
 * Subclasses must either override this method or supply an instance of
 * {@link SqlReturnTypeInference} to the constructor.
 *
 * @param opBinding description of invocation (not necessarily a
 * {@link SqlCall})
 * @return inferred return type
 */
public RelDataType inferReturnType(
    SqlOperatorBinding opBinding) {
  if (returnTypeInference != null) {
    return returnTypeInference.inferReturnType(opBinding);
  }

  // Derived type should have overridden this method, since it didn't
  // supply a type inference rule.
  throw Util.needToImplement(this);
}
 
开发者ID:apache,项目名称:calcite,代码行数:21,代码来源:SqlOperator.java

示例9: checkOperandTypes

import org.apache.calcite.util.Util; //导入方法依赖的package包/类
/**
 * Checks that the operand values in a {@link SqlCall} to this operator are
 * valid. Subclasses must either override this method or supply an instance
 * of {@link SqlOperandTypeChecker} to the constructor.
 *
 * @param callBinding    description of call
 * @param throwOnFailure whether to throw an exception if check fails
 *                       (otherwise returns false in that case)
 * @return whether check succeeded
 */
public boolean checkOperandTypes(
    SqlCallBinding callBinding,
    boolean throwOnFailure) {
  // Check that all of the operands are of the right type.
  if (null == operandTypeChecker) {
    // If you see this you must either give operandTypeChecker a value
    // or override this method.
    throw Util.needToImplement(this);
  }

  if (kind != SqlKind.ARGUMENT_ASSIGNMENT) {
    for (Ord<SqlNode> operand : Ord.zip(callBinding.operands())) {
      if (operand.e != null
          && operand.e.getKind() == SqlKind.DEFAULT
          && !operandTypeChecker.isOptional(operand.i)) {
        throw callBinding.getValidator().newValidationError(
            callBinding.getCall(),
            RESOURCE.defaultForOptionalParameter());
      }
    }
  }

  return operandTypeChecker.checkOperandTypes(
      callBinding,
      throwOnFailure);
}
 
开发者ID:apache,项目名称:calcite,代码行数:37,代码来源:SqlOperator.java

示例10: addListener

import org.apache.calcite.util.Util; //导入方法依赖的package包/类
public void addListener(RelOptListener newListener) {
  // TODO jvs 6-Apr-2006:  new superclass AbstractRelOptPlanner
  // now defines a multicast listener; just need to hook it in
  if (listener != null) {
    throw Util.needToImplement("multiple VolcanoPlanner listeners");
  }
  listener = newListener;
}
 
开发者ID:apache,项目名称:calcite,代码行数:9,代码来源:VolcanoPlanner.java

示例11: flattenComparison

import org.apache.calcite.util.Util; //导入方法依赖的package包/类
private RexNode flattenComparison(
    RexBuilder rexBuilder,
    SqlOperator op,
    List<RexNode> exprs) {
  final List<Pair<RexNode, String>> flattenedExps = Lists.newArrayList();
  flattenProjections(this, exprs, null, "", flattenedExps);
  int n = flattenedExps.size() / 2;
  boolean negate = false;
  if (op.getKind() == SqlKind.NOT_EQUALS) {
    negate = true;
    op = SqlStdOperatorTable.EQUALS;
  }
  if ((n > 1) && op.getKind() != SqlKind.EQUALS) {
    throw Util.needToImplement(
        "inequality comparison for row types");
  }
  RexNode conjunction = null;
  for (int i = 0; i < n; ++i) {
    RexNode comparison =
        rexBuilder.makeCall(
            op,
            flattenedExps.get(i).left,
            flattenedExps.get(i + n).left);
    if (conjunction == null) {
      conjunction = comparison;
    } else {
      conjunction =
          rexBuilder.makeCall(
              SqlStdOperatorTable.AND,
              conjunction,
              comparison);
    }
  }
  if (negate) {
    return rexBuilder.makeCall(
        SqlStdOperatorTable.NOT,
        conjunction);
  } else {
    return conjunction;
  }
}
 
开发者ID:apache,项目名称:calcite,代码行数:42,代码来源:RelStructuredTypeFlattener.java

示例12: createSqlType

import org.apache.calcite.util.Util; //导入方法依赖的package包/类
public RelDataType createSqlType(RelDataTypeFactory typeFactory) {
  BitString bitString;
  switch (typeName) {
  case NULL:
  case BOOLEAN:
    RelDataType ret = typeFactory.createSqlType(typeName);
    ret = typeFactory.createTypeWithNullability(ret, null == value);
    return ret;
  case BINARY:
    bitString = (BitString) value;
    int bitCount = bitString.getBitCount();
    return typeFactory.createSqlType(SqlTypeName.BINARY, bitCount / 8);
  case CHAR:
    NlsString string = (NlsString) value;
    Charset charset = string.getCharset();
    if (null == charset) {
      charset = typeFactory.getDefaultCharset();
    }
    SqlCollation collation = string.getCollation();
    if (null == collation) {
      collation = SqlCollation.COERCIBLE;
    }
    RelDataType type =
        typeFactory.createSqlType(
            SqlTypeName.CHAR,
            string.getValue().length());
    type =
        typeFactory.createTypeWithCharsetAndCollation(
            type,
            charset,
            collation);
    return type;

  case INTERVAL_YEAR:
  case INTERVAL_YEAR_MONTH:
  case INTERVAL_MONTH:
  case INTERVAL_DAY:
  case INTERVAL_DAY_HOUR:
  case INTERVAL_DAY_MINUTE:
  case INTERVAL_DAY_SECOND:
  case INTERVAL_HOUR:
  case INTERVAL_HOUR_MINUTE:
  case INTERVAL_HOUR_SECOND:
  case INTERVAL_MINUTE:
  case INTERVAL_MINUTE_SECOND:
  case INTERVAL_SECOND:
    SqlIntervalLiteral.IntervalValue intervalValue =
        (SqlIntervalLiteral.IntervalValue) value;
    return typeFactory.createSqlIntervalType(
        intervalValue.getIntervalQualifier());

  case SYMBOL:
    return typeFactory.createSqlType(SqlTypeName.SYMBOL);

  case INTEGER: // handled in derived class
  case TIME: // handled in derived class
  case VARCHAR: // should never happen
  case VARBINARY: // should never happen

  default:
    throw Util.needToImplement(toString() + ", operand=" + value);
  }
}
 
开发者ID:apache,项目名称:calcite,代码行数:64,代码来源:SqlLiteral.java

示例13: iterator

import org.apache.calcite.util.Util; //导入方法依赖的package包/类
public Iterator<IntPair> iterator() {
  throw Util.needToImplement(this);
}
 
开发者ID:apache,项目名称:calcite,代码行数:4,代码来源:Mappings.java

示例14: reduceExpr

import org.apache.calcite.util.Util; //导入方法依赖的package包/类
/**
 * Reduces a list of operators and arguments according to the rules of
 * precedence and associativity. Returns the ordinal of the node which
 * replaced the expression.
 *
 * <p>The default implementation throws
 * {@link UnsupportedOperationException}.
 *
 * @param ordinal indicating the ordinal of the current operator in the list
 *                on which a possible reduction can be made
 * @param list    List of alternating
 *     {@link org.apache.calcite.sql.parser.SqlParserUtil.ToTreeListItem} and
 *     {@link SqlNode}
 * @return ordinal of the node which replaced the expression
 */
public ReduceResult reduceExpr(
    int ordinal,
    TokenSequence list) {
  throw Util.needToImplement(this);
}
 
开发者ID:apache,项目名称:calcite,代码行数:21,代码来源:SqlSpecialOperator.java


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