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

'parseTableIdentifier' fails when a catalog name is provided

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.5.0, 4.0.0
    • None
    • Spark Core
    • None

    Description

      spark.sessionState.sqlParser.parseTableIdentifier(
        "`my catalog`.`my database`.`my table`"
      )
      

      fails with

      org.apache.spark.sql.catalyst.parser.ParseException: 
      [PARSE_SYNTAX_ERROR] Syntax error at or near '.'.(line 1, pos 26)
      
      == SQL ==
      `my catalog`.`my database`.`my table`
      --------------------------^^^
      
      	at org.apache.spark.sql.catalyst.parser.ParseException.withCommand(parsers.scala:257)
      	at org.apache.spark.sql.catalyst.parser.AbstractParser.parse(parsers.scala:98)
      	at org.apache.spark.sql.execution.SparkSqlParser.parse(SparkSqlParser.scala:54)
      	at org.apache.spark.sql.catalyst.parser.AbstractSqlParser.parseTableIdentifier(AbstractSqlParser.scala:41)
      

       

      Note: It works as expected on Databricks clusters (verified with Spark 3.3.2 and 3.5.0).

      Attachments

        Activity

          People

            Unassigned Unassigned
            dtarima Denis Tarima
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: