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

parameter markers are not blocked from DEFAULT (and other places)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.5.0, 4.0.0
    • Spark Core
    • None

    Description

      scala> spark.sql("CREATE TABLE t11(c1 int default :parm)", args = Map("parm" -> 5)).show()

      -> success

      scala> spark.sql("describe t11");

      [INVALID_DEFAULT_VALUE.UNRESOLVED_EXPRESSION] Failed to execute EXISTS_DEFAULT command because the destination table column `c1` has a DEFAULT value :parm, which fails to resolve as a valid expression.

      This likely extends to other DDL-y places.
      I can only find protection against placement in the body of a CREATE VIEW.

      I see two ways out of this:

      • Raise an error (as we do for CREATE VIEW v1(c1) AS SELECT ? )
         * Improve the way we persist queries/expressions to substitute the at-DDL-time bound parameter value (it' not a bug it's a feature....)

      Attachments

        Activity

          People

            maxgekk Max Gekk
            srielau Serge Rielau
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: