本文整理了Java中org.apache.calcite.util.Util.needToImplement()
方法的一些代码示例,展示了Util.needToImplement()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.needToImplement()
方法的具体详情如下:
包路径:org.apache.calcite.util.Util
类名称:Util
方法名:needToImplement
[英]Returns a java.lang.RuntimeException indicating that a particular feature has not been implemented, but should be.
If every 'hole' in our functionality uses this method, it will be easier for us to identity the holes. Throwing a java.lang.UnsupportedOperationException isn't as good, because sometimes we actually want to partially implement an API.
Example usage:
class MyVisitor extends BaseVisitor {
void accept(Foo foo) {
// Exception will identify which subclass forgot to override
// this method
throw Util.needToImplement(this);
}
}
[中]返回一个java。lang.RuntimeException指示特定功能尚未实现,但应该实现。
如果我们的功能中的每个“漏洞”都使用这种方法,我们就更容易识别漏洞。扔爪哇。UnsupportedOperationException并没有那么好,因为有时我们实际上想要部分实现一个API。
用法示例:
class MyVisitor extends BaseVisitor {
void accept(Foo foo) {
// Exception will identify which subclass forgot to override
// this method
throw Util.needToImplement(this);
}
}
代码示例来源:origin: apache/flink
@Override public Void visit(SqlIntervalQualifier intervalQualifier) {
throw Util.needToImplement(intervalQualifier);
}
}
代码示例来源:origin: apache/flink
@Override public Void visit(SqlNodeList nodeList) {
throw Util.needToImplement(nodeList);
}
代码示例来源:origin: apache/flink
@Override public Void visit(SqlDynamicParam param) {
throw Util.needToImplement(param);
}
代码示例来源:origin: apache/flink
@Override public Void visit(SqlDataTypeSpec type) {
throw Util.needToImplement(type);
}
代码示例来源:origin: apache/flink
public RelDataType getValidatedNodeType(SqlNode node) {
RelDataType type = getValidatedNodeTypeIfKnown(node);
if (type == null) {
throw Util.needToImplement(node);
} else {
return type;
}
}
代码示例来源:origin: apache/flink
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);
}
代码示例来源:origin: apache/flink
for (SqlNode operand : operands) {
if (!(operand.getKind() == SqlKind.ROW)) {
throw Util.needToImplement(
"Values function where operands are scalars");
代码示例来源:origin: Qihoo360/Quicksql
public void unparse(
SqlWriter writer,
SqlOperator operator,
SqlCall call,
int leftPrec,
int rightPrec) {
// You probably need to override the operator's unparse
// method.
throw Util.needToImplement(this);
}
},
代码示例来源:origin: Qihoo360/Quicksql
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;
}
代码示例来源:origin: org.apache.calcite/calcite-core
public void unparse(
SqlWriter writer,
SqlOperator operator,
SqlCall call,
int leftPrec,
int rightPrec) {
// You probably need to override the operator's unparse
// method.
throw Util.needToImplement(this);
}
},
代码示例来源:origin: Qihoo360/Quicksql
public Iterator<IntPair> iterator() {
throw Util.needToImplement(this);
}
}
代码示例来源:origin: org.apache.calcite/calcite-core
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;
}
代码示例来源:origin: Qihoo360/Quicksql
public RelDataType getValidatedNodeType(SqlNode node) {
RelDataType type = getValidatedNodeTypeIfKnown(node);
if (type == null) {
throw Util.needToImplement(node);
} else {
return type;
}
}
代码示例来源:origin: org.apache.calcite/calcite-core
public RelDataType getValidatedNodeType(SqlNode node) {
RelDataType type = getValidatedNodeTypeIfKnown(node);
if (type == null) {
throw Util.needToImplement(node);
} else {
return type;
}
}
代码示例来源:origin: org.apache.kylin/atopcalcite
/**
* 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);
}
代码示例来源:origin: Qihoo360/Quicksql
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);
}
代码示例来源:origin: Qihoo360/Quicksql
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);
}
代码示例来源:origin: org.apache.calcite/calcite-core
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);
}
代码示例来源:origin: Qihoo360/Quicksql
public void rewriteRel(LogicalAggregate rel) {
RelDataType inputType = rel.getInput().getRowType();
for (RelDataTypeField field : inputType.getFieldList()) {
if (field.getType().isStruct()) {
// TODO jvs 10-Feb-2005
throw Util.needToImplement("aggregation on structured types");
}
}
rewriteGeneric(rel);
}
代码示例来源:origin: org.apache.calcite/calcite-core
public void rewriteRel(LogicalAggregate rel) {
RelDataType inputType = rel.getInput().getRowType();
for (RelDataTypeField field : inputType.getFieldList()) {
if (field.getType().isStruct()) {
// TODO jvs 10-Feb-2005
throw Util.needToImplement("aggregation on structured types");
}
}
rewriteGeneric(rel);
}
内容来源于网络,如有侵权,请联系作者删除!