本文整理汇总了Java中org.apache.calcite.rex.RexInputRef.getType方法的典型用法代码示例。如果您正苦于以下问题:Java RexInputRef.getType方法的具体用法?Java RexInputRef.getType怎么用?Java RexInputRef.getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.calcite.rex.RexInputRef
的用法示例。
在下文中一共展示了RexInputRef.getType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitInputRef
import org.apache.calcite.rex.RexInputRef; //导入方法依赖的package包/类
@Override
public RexNode visitInputRef(RexInputRef inputRef) {
// see if we have a reference to our child.
if(inputRef instanceof MutableRexInputRef && refs.contains(inputRef)){
return inputRef;
}
if( !(inputRef instanceof MutableRexInputRef) ){
MutableRexInputRef previousPointer = refMap.get(inputRef.getIndex());
if(previousPointer != null){
return previousPointer;
}
}
// create a new holder to add to the child of this.
final MutableRexInputRef inputPointer = new MutableRexInputRef(inputRef.getType());
holders.add(new ProjectSlotHolder(inputRef, inputPointer));
if( !(inputRef instanceof MutableRexInputRef) ){
refMap.put(inputRef.getIndex(), inputPointer);
}
return inputPointer;
}
示例2: visitInputRef
import org.apache.calcite.rex.RexInputRef; //导入方法依赖的package包/类
@Override
public RexNode visitInputRef(RexInputRef inputRef) {
if (currentRel instanceof LogicalCorrelate) {
// if this rel references corVar
// and now it needs to be rewritten
// it must have been pulled above the Correlator
// replace the input ref to account for the LHS of the
// Correlator
final int leftInputFieldCount = ((LogicalCorrelate) currentRel).getLeft().getRowType().getFieldCount();
RelDataType newType = inputRef.getType();
if (projectPulledAboveLeftCorrelator) {
newType = typeFactory.createTypeWithNullability(newType, true);
}
int pos = inputRef.getIndex();
RexInputRef newInputRef = new RexInputRef(leftInputFieldCount + pos, newType);
if ((isCount != null) && isCount.contains(pos)) {
return createCaseExpression(newInputRef, rexBuilder.makeExactLiteral(BigDecimal.ZERO), newInputRef);
} else {
return newInputRef;
}
}
return inputRef;
}
示例3: visitInputRef
import org.apache.calcite.rex.RexInputRef; //导入方法依赖的package包/类
@Override public RexNode visitInputRef(RexInputRef inputRef) {
final RexInputRef ref = getNewForOldInputRef(currentRel, map, inputRef);
if (ref.getIndex() == inputRef.getIndex()
&& ref.getType() == inputRef.getType()) {
return inputRef; // re-use old object, to prevent needless expr cloning
}
return ref;
}
示例4: visitInputRef
import org.apache.calcite.rex.RexInputRef; //导入方法依赖的package包/类
@Override
public RexNode visitInputRef(RexInputRef inputRef) {
return new RexInputRef(map.get(inputRef.getIndex()), inputRef.getType());
}