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

Allow parameter markers in DDL (again)

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.5.0
    • 3.5.0
    • Spark Core
    • None

    Description

      When we introduced parameter markers initially, we allowed them n any SQL statement.
      Subsequently, we have limited their use to DML and queries because that aligns better with the industry and we saw no immediate use for broader support.

      However, we have introduced the IDENTIFIER() clause, which allows templating table-, and function-identifiers in DDL statements. 
      To exploit this, we need parameter markers as argument:

      spark.sql("CREATE TABLE IDENTIFIER(:tableName) (c1 INT)", args = Map("tableName" -> "mytable") 

      Attachments

        Activity

          People

            srielau Serge Rielau
            srielau Serge Rielau
            Wenchen Fan Wenchen Fan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: