Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4980

Babel parser support MySQL NULL-safe equal operator '<=>'

    XMLWordPrintableJSON

Details

    Description

      Babel parser support MySQL equal operator '<=>'.

      Mysql link: https://dev.mysql.com/doc/refman/8.0/en/comparison-operators.html#operator_equal-to

       

      // test case
      @Test void testParseEqual()  {
        final String sql = "select '1' <=> '2' from t";
        final String expected = ""
            + "SELECT 1' <=> '2'\n"
            + "FROM `T`";
        sql(sql).ok(expected);
      } 
      // exception stack
          java.lang.RuntimeException: Error while parsing SQL: select '1' <=> '2' from t
              at org.apache.calcite.sql.parser.SqlParserTest$TesterImpl.parseStmtAndHandleEx(SqlParserTest.java:9704)
              at org.apache.calcite.sql.parser.SqlParserTest$TesterImpl.check(SqlParserTest.java:9690)
              at org.apache.calcite.sql.parser.SqlParserTest$Sql.ok(SqlParserTest.java:10047)
              at org.apache.calcite.test.BabelParserTest.testParseEqual(BabelParserTest.java:246)
              Caused by: java.lang.RuntimeException: org.apache.calcite.sql.parser.SqlParseException: Encountered "<= >" at line 1, column 12.
              Was expecting one of: 

       

      Attachments

        Issue Links

          Activity

            People

              wojustme Xurenhe
              wojustme Xurenhe
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h 50m
                  3h 50m