Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -622,11 +622,10 @@ public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings)
ExprEval<?> exprEval = expr.eval(bindings);
ExpressionType exprType = exprEval.type();

if (isValidType(exprType)) {
outputType = ExpressionTypeConversion.function(outputType, exprType);
}

if (exprEval.value() != null) {
if (isValidType(exprType)) {
outputType = ExpressionTypeConversion.function(outputType, exprType);
}
evals.add(exprEval);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ public void testGreatest()
assertExpr("greatest()", null);
assertExpr("greatest(null, null)", null);
assertExpr("greatest(1, null, 'A')", "A");
assertExpr("greatest(1.0, 1, null)", 1.0);
}

@Test
Expand All @@ -703,6 +704,7 @@ public void testLeast()
assertExpr("least()", null);
assertExpr("least(null, null)", null);
assertExpr("least(1, null, 'A')", "1");
assertExpr("least(1.0, 1, null)", 1.0);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public void testDecimal()
}

@Test
public void testDecimalWithNullShouldReturnString()
public void testDecimalWithNullShouldNotReturnString()
{
testExpression(
Arrays.asList(
Expand All @@ -227,7 +227,7 @@ public void testDecimalWithNullShouldReturnString()
null,
3.4
),
"3.4"
3.4
);
}
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public void testDecimal()
}

@Test
public void testDecimalWithNullShouldReturnString()
public void testDecimalWithNullShouldNotReturnString()
{
testExpression(
Arrays.asList(
Expand All @@ -227,7 +227,7 @@ public void testDecimalWithNullShouldReturnString()
3.4,
null
),
"1.2"
1.2
);
}

Expand Down