Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-31262

Test case import another test case contains bracketed comments, can't display bracketed comments in golden files well.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.1.0
    • 3.0.0
    • SQL, Tests
    • None

    Description

      The content of

      nested-comments.sql 
      

      show below:

      -- This test case just used to test imported bracketed comments.
      
      -- the first case of bracketed comment
      --QUERY-DELIMITER-START
      /* This is the first example of bracketed comment.
      SELECT 'ommented out content' AS first;
      */
      SELECT 'selected content' AS first;
      --QUERY-DELIMITER-END
      

      The test case

      comments.sql 
      

      imports

      nested-comments.sql
      

      below:

      --IMPORT nested-comments.sql
      

      The output will be:

      -- !query
      /* This is the first example of bracketed comment.
      SELECT 'ommented out content' AS first
      -- !query schema
      struct<>
      -- !query output
      org.apache.spark.sql.catalyst.parser.ParseException
      
      mismatched input '/' expecting {'(', 'ADD', 'ALTER', 'ANALYZE', 'CACHE', 'CLEAR', 'COMMENT', 'COMMIT', 'CREATE', 'DELETE', 'DESC', 'DESCRIBE', 'DFS', 'DROP', 
      'EXPLAIN', 'EXPORT', 'FROM', 'GRANT', 'IMPORT', 'INSERT', 'LIST', 'LOAD', 'LOCK', 'MAP', 'MERGE', 'MSCK', 'REDUCE', 'REFRESH', 'REPLACE', 'RESET', 'REVOKE', '
      ROLLBACK', 'SELECT', 'SET', 'SHOW', 'START', 'TABLE', 'TRUNCATE', 'UNCACHE', 'UNLOCK', 'UPDATE', 'USE', 'VALUES', 'WITH'}(line 1, pos 0)
      
      == SQL ==
      /* This is the first example of bracketed comment.
      ^^^
      SELECT 'ommented out content' AS first
      
      
      -- !query
      */
      SELECT 'selected content' AS first
      -- !query schema
      struct<>
      -- !query output
      org.apache.spark.sql.catalyst.parser.ParseException
      
      extraneous input '*/' expecting {'(', 'ADD', 'ALTER', 'ANALYZE', 'CACHE', 'CLEAR', 'COMMENT', 'COMMIT', 'CREATE', 'DELETE', 'DESC', 'DESCRIBE', 'DFS', 'DROP', 'EXPLAIN', 'EXPORT', 'FROM', 'GRANT', 'IMPORT', 'INSERT', 'LIST', 'LOAD', 'LOCK', 'MAP', 'MERGE', 'MSCK', 'REDUCE', 'REFRESH', 'REPLACE', 'RESET', 'REVOKE', 'ROLLBACK', 'SELECT', 'SET', 'SHOW', 'START', 'TABLE', 'TRUNCATE', 'UNCACHE', 'UNLOCK', 'UPDATE', 'USE', 'VALUES', 'WITH'}(line 1, pos 0)
      
      == SQL ==
      */
      ^^^
      SELECT 'selected content' AS first
      

      Attachments

        Issue Links

          Activity

            People

              beliefer Jiaan Geng
              beliefer Jiaan Geng
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: