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

EXECUTE IMMEDIATE USING does not recognize session variable names

    XMLWordPrintableJSON

Details

    Description

      DECLARE parm = 'Hello';
      
      EXECUTE IMMEDIATE 'SELECT :parm' USING parm;
      [ALL_PARAMETERS_MUST_BE_NAMED] Using name parameterized queries requires all parameters to be named. Parameters missing names: "parm". SQLSTATE: 07001
      
      EXECUTE IMMEDIATE 'SELECT :parm' USING parm AS parm;
      Hello
      
      

      variables are like column references, they act as their own aliases and thus should not be required to be named to associate with a named parameter with the same name.

      Note that unlike for pySpark this should be case insensitive (haven't verified).

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: