public RexNode visitFieldAccess(RexFieldAccess fieldAccess) { if (cm.mapFieldAccessToCorVar.containsKey(fieldAccess)) { // if it is a corVar, change it to be input ref. Correlation corVar = cm.mapFieldAccessToCorVar.get(fieldAccess); // corVar offset should point to the leftInput of currentRel, // which is the CorrelatorRel. RexNode newRexNode = new RexInputRef(corVar.getOffset(), fieldAccess.getType()); if (projectPulledAboveLeftCorrelator && (nullIndicator != null)) { // need to enforce nullability by applying an additional // cast operator over the transformed expression. newRexNode = createCaseExpression( nullIndicator, rexBuilder.constantNull(), newRexNode); } return newRexNode; } return fieldAccess; }
public RexNode visitFieldAccess(RexFieldAccess fieldAccess) { if (mapFieldAccessToCorVar.containsKey(fieldAccess)) { // if it is a corVar, change it to be input ref. CorrelatorRel.Correlation corVar = mapFieldAccessToCorVar.get(fieldAccess); // corVar offset shuold point to the leftInput of currentRel, // which is the CorrelatorRel. RexNode newRexNode = new RexInputRef(corVar.getOffset(), fieldAccess.getType()); if (projectPulledAboveLeftCorrelator && (nullIndicator != null)) { // need to enforce nullability by applying an additional // cast operator over the transformed expression. newRexNode = createCaseExpression( nullIndicator, rexBuilder.constantNull(), newRexNode); } return newRexNode; } return fieldAccess; }
new RexInputRef( newInputPos, fieldAccess.getType()); return newInput;
new RexInputRef( newInputPos, fieldAccess.getType()); return newInput;
public Boolean visitFieldAccess(RexFieldAccess fieldAccess) { super.visitFieldAccess(fieldAccess); final RelDataType refType = fieldAccess.getReferenceExpr().getType(); assert refType.isStruct(); final RelDataTypeField field = fieldAccess.getField(); final int index = field.getIndex(); if ((index < 0) || (index > refType.getFieldList().size())) { assert !fail; ++failCount; return false; } final RelDataTypeField typeField = refType.getFieldList().get(index); if (!RelOptUtil.eq( "type1", typeField.getType(), "type2", fieldAccess.getType(), fail)) { assert !fail; ++failCount; return false; } return true; }
public Boolean visitFieldAccess(RexFieldAccess fieldAccess) { super.visitFieldAccess(fieldAccess); final RelDataType refType = fieldAccess.getReferenceExpr().getType(); assert refType.isStruct(); final RelDataTypeField field = fieldAccess.getField(); final int index = field.getIndex(); if ((index < 0) || (index > refType.getFieldList().size())) { assert !fail; ++failCount; return false; } final RelDataTypeField typeField = refType.getFieldList().get(index); if (!RelOptUtil.eq( "type1", typeField.getType(), "type2", fieldAccess.getType(), fail)) { assert !fail; ++failCount; return false; } return true; }
public Boolean visitFieldAccess(RexFieldAccess fieldAccess) { super.visitFieldAccess(fieldAccess); final RelDataType refType = fieldAccess.getReferenceExpr().getType(); assert refType.isStruct(); final RelDataTypeField field = fieldAccess.getField(); final int index = field.getIndex(); if ((index < 0) || (index > refType.getFieldList().size())) { assert !fail; ++failCount; return false; } final RelDataTypeField typeField = refType.getFieldList().get(index); if (!RelOptUtil.eq( "type1", typeField.getType(), "type2", fieldAccess.getType(), fail)) { assert !fail; ++failCount; return false; } return true; } }
public Boolean visitFieldAccess(RexFieldAccess fieldAccess) { super.visitFieldAccess(fieldAccess); final RelDataType refType = fieldAccess.getReferenceExpr().getType(); assert refType.isStruct(); final RelDataTypeField field = fieldAccess.getField(); final int index = field.getIndex(); if ((index < 0) || (index > refType.getFieldList().size())) { assert !fail; ++failCount; return false; } final RelDataTypeField typeField = refType.getFieldList().get(index); if (!RelOptUtil.eq( "type1", typeField.getType(), "type2", fieldAccess.getType(), fail)) { assert !fail; ++failCount; return false; } return true; } }
RelDataType fieldType = removeDistinct(fieldAccess.getType());
RelDataType fieldType = removeDistinct(fieldAccess.getType());