You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Tanner Clary (Jira)" <ji...@apache.org> on 2023/06/07 03:20:00 UTC

[jira] [Commented] (CALCITE-5760) SqlOperatorTest::testDateTrunc does not validate results

    [ https://issues.apache.org/jira/browse/CALCITE-5760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17729899#comment-17729899 ] 

Tanner Clary commented on CALCITE-5760:
---------------------------------------

[~mbudiu] Try running these tests from CalciteSqlOperatorTest instead. Let me know if you have the same issue. I think if you run any SqlOperatorTest, you may notice it passes regardless if the expectedValue is correct or not. If this turns out to be the case here, feel free to close this case. Thanks!

> SqlOperatorTest::testDateTrunc does not validate results
> --------------------------------------------------------
>
>                 Key: CALCITE-5760
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5760
>             Project: Calcite
>          Issue Type: Bug
>          Components: tests
>    Affects Versions: 1.34.0
>            Reporter: Mihai Budiu
>            Priority: Minor
>
> I was trying to reproduce a bug where DATE_TRUNC returns an incorrect result when truncating a constant date to a MILLENNIUM.
> I found test cases for DATE_TRUNC in SqlOperatorTest; these test cases do specify the expected result, e.g.:
> f.checkScalar("date_trunc(date '2015-02-19', isoyear)",
>         "2014-12-29", "DATE NOT NULL");
> However, the test fixture uses AbstractSqlTester::check, which ignores the result!
> As a proof, one can replace the results with arbitrary strings and the tests will still pass.
> I presume that this is not the intent of the test writers. How could this test be fixed to also check the results?
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)