You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Maryann Xue (JIRA)" <ji...@apache.org> on 2016/09/13 20:06:20 UTC

[jira] [Comment Edited] (CALCITE-1374) Support operator "!=" as an alternative to "<>"

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

Maryann Xue edited comment on CALCITE-1374 at 9/13/16 8:06 PM:
---------------------------------------------------------------

As I was adding some new tests and verifying existing tests, I found the following code comment in SqlOperatorBaseTest.java. Is or was there any reason that we would not like to allow "!=" as an alternative to "<>", [~julianhyde]?
{code}
  @Test public void testNotEqualsOperatorIntervals() {
    tester.checkBoolean(
        "interval '2' day <> interval '1' day",
        Boolean.TRUE);
    tester.checkBoolean(
        "interval '2' day <> interval '2' day",
        Boolean.FALSE);
    tester.checkBoolean(
        "interval '2:2:2' hour to second <> interval '2' hour",
        Boolean.TRUE);
    tester.checkNull(
        "cast(null as interval hour) <> interval '2' minute");

    // "!=" is not an acceptable alternative to "<>"
    tester.checkFails(
        "1 ^!^= 1",
        "(?s).*Encountered: \"!\" \\(33\\).*",
        false);
  }
{code}


was (Author: maryannxue):
As I was adding some new tests and verifying existing tests, I found the following code comment in SqlOperatorBaseTest.java. Is or was there any reason that we would not like to allow "!=" as an alternative to "<>"?
{code}
  @Test public void testNotEqualsOperatorIntervals() {
    tester.checkBoolean(
        "interval '2' day <> interval '1' day",
        Boolean.TRUE);
    tester.checkBoolean(
        "interval '2' day <> interval '2' day",
        Boolean.FALSE);
    tester.checkBoolean(
        "interval '2:2:2' hour to second <> interval '2' hour",
        Boolean.TRUE);
    tester.checkNull(
        "cast(null as interval hour) <> interval '2' minute");

    // "!=" is not an acceptable alternative to "<>"
    tester.checkFails(
        "1 ^!^= 1",
        "(?s).*Encountered: \"!\" \\(33\\).*",
        false);
  }
{code}

> Support operator "!=" as an alternative to "<>"
> -----------------------------------------------
>
>                 Key: CALCITE-1374
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1374
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Maryann Xue
>            Assignee: Maryann Xue
>            Priority: Minor
>              Labels: phoenix
>             Fix For: 1.9.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)