public RexNode convertJdbc( SqlRexContext cx, SqlJdbcFunctionCall op, SqlCall call) { // Yuck!! The function definition contains arguments! // TODO: adopt a more conventional definition/instance structure final SqlCall convertedCall = op.getLookupCall(); return cx.convertExpression(convertedCall); }
public RexNode convertJdbc( SqlRexContext cx, SqlJdbcFunctionCall op, SqlCall call) { // Yuck!! The function definition contains arguments! // TODO: adopt a more conventional definition/instance structure final SqlCall convertedCall = op.getLookupCall(); return cx.convertExpression(convertedCall); }
public RelDataType inferReturnType( SqlOperatorBinding opBinding) { // only expected to come here if validator called this method SqlCallBinding callBinding = (SqlCallBinding) opBinding; if (null == lookupMakeCallObj) { throw callBinding.newValidationError( RESOURCE.functionUndefined(getName())); } final String message = lookupMakeCallObj.isValidArgCount(callBinding); if (message != null) { throw callBinding.newValidationError( RESOURCE.wrongNumberOfParam(getName(), thisOperands.length, message)); } final SqlCall newCall = getLookupCall(); final SqlCallBinding newBinding = new SqlCallBinding(callBinding.getValidator(), callBinding.getScope(), newCall); final SqlOperator operator = lookupMakeCallObj.getOperator(); if (!operator.checkOperandTypes(newBinding, false)) { throw callBinding.newValidationSignatureError(); } return operator.validateOperands(callBinding.getValidator(), callBinding.getScope(), newCall); }
public RelDataType inferReturnType( SqlOperatorBinding opBinding) { // only expected to come here if validator called this method SqlCallBinding callBinding = (SqlCallBinding) opBinding; if (null == lookupMakeCallObj) { throw callBinding.newValidationError( RESOURCE.functionUndefined(getName())); } final String message = lookupMakeCallObj.isValidArgCount(callBinding); if (message != null) { throw callBinding.newValidationError( RESOURCE.wrongNumberOfParam(getName(), thisOperands.length, message)); } final SqlCall newCall = getLookupCall(); final SqlCallBinding newBinding = new SqlCallBinding(callBinding.getValidator(), callBinding.getScope(), newCall); final SqlOperator operator = lookupMakeCallObj.getOperator(); if (!operator.checkOperandTypes(newBinding, false)) { throw callBinding.newValidationSignatureError(); } return operator.validateOperands(callBinding.getValidator(), callBinding.getScope(), newCall); }