Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Resolved
    • 3.0.0
    • None
    • SQL
    • None

    Description

      Feature ID Feature Name Feature Description
      E021-03 Character literals — Subclause 5.3, “<literal>”: <quote> [ <character representation>... ] <quote>

      Example:

      SELECT 'first line' ' - next line' ' - third line' AS "Three lines to one";

      Postgresql:https://www.postgresql.org/docs/9.1/features-sql-standard.html

      Hive:https://cwiki.apache.org/confluence/display/Hive/Supported+Features%3A+Apache+Hive+2.1

       

      Attachments

        Activity

          beliefer Jiaan Geng added a comment -

          I'm working on.

          beliefer Jiaan Geng added a comment - I'm working on.
          beliefer Jiaan Geng added a comment -

          I think Spark SQL have implemented this syntax.

          I test this sql in spark:

           

          spark-sql> SELECT 'first line' ' - next line' ' - third line' AS a;
          first line - next line - third line
          Time taken: 0.207 seconds, Fetched 1 row(s)

           

          The g4 file exists the definition:

           

          STRING
           : '\'' ( ~('\''|'\\') | ('\\' .) )* '\''
           | '"' ( ~('"'|'\\') | ('\\' .) )* '"'
           ;

           

          Although this identity named `STRING`, it contains the definition of character literals.

          beliefer Jiaan Geng added a comment - I think Spark SQL have implemented this syntax. I test this sql in spark:   spark-sql> SELECT 'first line' ' - next line' ' - third line' AS a; first line - next line - third line Time taken: 0.207 seconds, Fetched 1 row(s)   The g4 file exists the definition:   STRING : '\' ' ( ~(' \ ''|' \\ ') | (' \\ ' .) )* ' \'' | ' "' ( ~( '" ' | '\\' ) | ( '\\' .) )* '"' ;   Although this identity named `STRING`, it contains the definition of character literals.
          yumwang Yuming Wang added a comment - Yes. We have implemented this syntax. https://github.com/postgres/postgres/blob/REL_12_BETA2/src/test/regress/sql/strings.sql#L7-L17

          People

            Unassigned Unassigned
            yumwang Yuming Wang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: