srielau commented on PR #49442:
URL: https://github.com/apache/spark/pull/49442#issuecomment-2585328459

   Because it’s a question mark in a string.
   It is the job of execute immediate using to bind parameter markers to the 
plan generated by that string. The outside client has no business binding in 
except to the USING clause.
   
   Our current implementation (macro expansion) is semantically very suspect. 
If we did a proper nesting this “firewall” between the EXECUTE IMMEDIATE and 
the payload statement would be more obvious.
   
   
   Sent from my iPhone
   
   On Jan 11, 2025, at 8:32 AM, Maxim Gekk ***@***.***> wrote:
   
   
   
   General comment: ensure that the parameter markers inside the execute 
immediate string are NOT bound by anything except the USING clause.
   
   @srielau<https://github.com/srielau> Is it restricted by the SQL standard?
   
   So spark.sql("execute immediate 'select ?'", seq(5)) must Not work.
   
   Why? What kind of issue might we face if we substitute a parameter in 
already parsed query of EXECUTE IMMEDIATE?
   
   —
   Reply to this email directly, view it on 
GitHub<https://github.com/apache/spark/pull/49442#issuecomment-2585325909>, or 
unsubscribe<https://github.com/notifications/unsubscribe-auth/AA22CFGO2ZVM6DRPRQVHO5D2KFBRNAVCNFSM6AAAAABU6QFZI2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOBVGMZDKOJQHE>.
   You are receiving this because you were mentioned.Message ID: ***@***.***>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to