return rewriteAggIf( _fun, this.generatedRules.fold_sum() );
case COUNTIF:
return rewriteAggIf( _fun, fold_count() );
case ISNONTEXT: {
final ExpressionNode arg = _fun.argument( 0 );
TypeAnnotator.annotateExpr( arg );
return DataType.STRING != arg.getDataType() ? TRUE : FALSE;
}
case ISNUMBER: {
final ExpressionNode arg = _fun.argument( 0 );
TypeAnnotator.annotateExpr( arg );
return DataType.NUMERIC == arg.getDataType() ? TRUE : FALSE;
}
case ISTEXT: {
final ExpressionNode arg = _fun.argument( 0 );
TypeAnnotator.annotateExpr( arg );
return DataType.STRING == arg.getDataType() ? TRUE : FALSE;
}
case VALUE: {
final ExpressionNode arg = _fun.argument( 0 );
TypeAnnotator.annotateExpr( arg );
if (DataType.NUMERIC == arg.getDataType()) {
return arg;
}
break;
}
case N: {
final ExpressionNode arg = _fun.argument( 0 );
TypeAnnotator.annotateExpr( arg );
if (DataType.NUMERIC == arg.getDataType()) {
return arg;
}
else {
return ZERO;
}
}
case T: {
final ExpressionNode arg = _fun.argument( 0 );
TypeAnnotator.annotateExpr( arg );
if (DataType.STRING == arg.getDataType()) {
return arg;
}
else {
return EMPTY_STRING;
}
}
case TEXT: {
final ExpressionNode arg = _fun.argument( 0 );
TypeAnnotator.annotateExpr( arg );
if (DataType.STRING == arg.getDataType()) {
return arg;
}
break;
}