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

TableIdentifier.quotedString creates un-parseable names when name contains a backtick

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.0.2, 2.1.0
    • SQL
    • None

    Description

      The quotedString method in TableIdentifier and FunctionIdentifier produce an illegal (un-parseable) name when the name contains a backtick. For example:

      import org.apache.spark.sql.catalyst.parser.CatalystSqlParser._
      import org.apache.spark.sql.catalyst.TableIdentifier
      import org.apache.spark.sql.catalyst.analysis.UnresolvedAttribute
      val complexName = TableIdentifier("`weird`table`name", Some("`d`b`1"))
      parseTableIdentifier(complexName.unquotedString) // Does not work
      parseTableIdentifier(complexName.quotedString) // Does not work
      UnresolvedAttribute.parseAttributeName(complexName.unquotedString) // Does not work
      UnresolvedAttribute.parseAttributeName(complexName.quotedString) // Does not work
      

      The quotedString method should escape backticks properly.

      Attachments

        Activity

          People

            jiangxb1987 Xingbo Jiang
            hvanhovell Herman van Hövell
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: