public RexNode newAttributeInitializer( RelDataType type, SqlFunction constructor, int iAttribute, List<RexNode> constructorArgs) { return rexBuilder.constantNull(); } }
public RexNode newColumnDefaultValue( RelOptTable table, int iColumn) { return rexBuilder.constantNull(); }
public RexNode newAttributeInitializer( RelDataType type, SqlFunction constructor, int iAttribute, List<RexNode> constructorArgs) { return rexBuilder.constantNull(); } }
public RexNode newAttributeInitializer( RelDataType type, SqlFunction constructor, int iAttribute, List<RexNode> constructorArgs) { return rexBuilder.constantNull(); } }
public RexNode newColumnDefaultValue( RelOptTable table, int iColumn) { return rexBuilder.constantNull(); }
/** * Creates a new SargFactory. * * @param rexBuilder factory for instances of {@link RexNode}, needed * internally in the sarg representation, and also for recomposing sargs * into equivalent rex trees */ public SargFactory(RexBuilder rexBuilder) { this.rexBuilder = rexBuilder; rexNull = rexBuilder.constantNull(); }
public RexNode newColumnDefaultValue( RelOptTable table, int iColumn) { return rexBuilder.constantNull(); }
/** * Creates a new SargFactory. * * @param rexBuilder factory for instances of {@link RexNode}, needed * internally in the sarg representation, and also for * recomposing sargs into equivalent rex trees */ public SargFactory(RexBuilder rexBuilder) { this.rexBuilder = rexBuilder; rexNull = rexBuilder.constantNull(); }
public RexNode visitLiteral(RexLiteral literal) { // Use nullIndicator to decide whether to project null. // Do nothing if the literal is null. if (!RexUtil.isNull(literal) && projectPulledAboveLeftCorrelator && (nullIndicator != null)) { return createCaseExpression( nullIndicator, rexBuilder.constantNull(), literal); } return literal; }
public RexNode visitLiteral(RexLiteral literal) { // Use nullIndicator to decide whether to project null. // Do nothing if the literal is null. if (!RexUtil.isNull(literal) && projectPulledAboveLeftCorrelator && (nullIndicator != null)) { return createCaseExpression( nullIndicator, rexBuilder.constantNull(), literal); } return literal; }
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; }
/** * Creates an expression corresponding to a null literal, cast to a specific * type and precision * * @param typeName name of the type that the null will be cast to * @param precision precision of the type * @return created expression */ public RexNode makeNullLiteral(SqlTypeName typeName, int precision) { RelDataType type = typeFactory.createTypeWithNullability( typeFactory.createSqlType(typeName, precision), true); return makeCast(type, constantNull()); }
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; }
/** * Creates a literal whose value is NULL, with a particular type. * * <p>The typing is necessary because RexNodes are strictly typed. For * example, in the Rex world the <code>NULL</code> parameter to <code> * SUBSTRING(NULL FROM 2 FOR 4)</code> must have a valid VARCHAR type so * that the result type can be determined. * * @param typeName Type to cast NULL to * @return NULL literal of given type */ public RexNode makeNullLiteral(SqlTypeName typeName) { RelDataType type = typeFactory.createTypeWithNullability( typeFactory.createSqlType(typeName), true); return makeCast(type, constantNull()); }
/** * Creates an expression corresponding to a null literal, cast to a specific * type and precision * * @param typeName name of the type that the null will be cast to * @param precision precision of the type * * @return created expression */ public RexNode makeNullLiteral(SqlTypeName typeName, int precision) { RelDataType type = typeFactory.createTypeWithNullability( typeFactory.createSqlType(typeName, precision), true); return makeCast( type, constantNull()); }
/** * Creates a literal whose value is NULL, with a particular type. * * <p>The typing is necessary because RexNodes are strictly typed. For * example, in the Rex world the <code>NULL</code> parameter to <code> * SUBSTRING(NULL FROM 2 FOR 4)</code> must have a valid VARCHAR type so * that the result type can be determined. * * @param typeName Type to cast NULL to * * @return NULL literal of given type */ public RexNode makeNullLiteral(SqlTypeName typeName) { RelDataType type = typeFactory.createTypeWithNullability( typeFactory.createSqlType(typeName), true); return makeCast( type, constantNull()); }
private void flattenNullLiteral( RelDataType type, List<RexNode> flattenedExps, List<String> flattenedFieldNames) { RelDataType flattenedType = SqlTypeUtil.flattenRecordType( rexBuilder.getTypeFactory(), type, null); for (RelDataTypeField field : flattenedType.getFieldList()) { flattenedExps.add( rexBuilder.makeCast( field.getType(), rexBuilder.constantNull())); flattenedFieldNames.add(field.getName()); } }
private void flattenNullLiteral( RelDataType type, List<RexNode> flattenedExps, List<String> flattenedFieldNames) { RelDataType flattenedType = SqlTypeUtil.flattenRecordType( rexBuilder.getTypeFactory(), type, null); for (RelDataTypeField field : flattenedType.getFieldList()) { flattenedExps.add( rexBuilder.makeCast( field.getType(), rexBuilder.constantNull())); flattenedFieldNames.add(field.getName()); } }
rexBuilder.makeCast( structuredType, rexBuilder.constantNull());
rexBuilder.makeCast( structuredType, rexBuilder.constantNull());