You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2022/04/22 05:11:12 UTC
[GitHub] [calcite] libenchao commented on a diff in pull request #2772: [CALCITE-4861] Optimisation of chained cast calls for literal can lea…
libenchao commented on code in PR #2772:
URL: https://github.com/apache/calcite/pull/2772#discussion_r855771402
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -845,15 +845,15 @@ protected SqlOperatorFixture fixture() {
final SqlOperatorFixture f = fixture();
f.setFor(SqlStdOperatorTable.CAST, VmName.EXPAND);
- f.checkScalarExact("cast( cast(1.25 as double) as integer)", 1);
- f.checkScalarExact("cast( cast(-1.25 as double) as integer)", -1);
+ f.checkFails("cast( cast(1.25 as double) as integer)", "Value out of range.", true);
+ f.checkFails("cast( cast(-1.25 as double) as integer)", "Value out of range.", true);
if (!f.brokenTestsEnabled()) {
return;
}
- f.checkScalarExact("cast( cast(1.75 as double) as integer)", 2);
- f.checkScalarExact("cast( cast(-1.75 as double) as integer)", -2);
- f.checkScalarExact("cast( cast(1.5 as double) as integer)", 2);
- f.checkScalarExact("cast( cast(-1.5 as double) as integer)", -2);
+ f.checkFails("cast( cast(1.75 as double) as integer)", "Value out of range.", true);
+ f.checkFails("cast( cast(-1.75 as double) as integer)", "Value out of range.", true);
+ f.checkFails("cast( cast(1.5 as double) as integer)", "Value out of range.", true);
Review Comment:
nice suggestion, revised.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org