cloud-fan commented on code in PR #52173: URL: https://github.com/apache/spark/pull/52173#discussion_r2312774664
########## sql/core/src/test/resources/sql-tests/inputs/execute-immediate.sql: ########## @@ -140,10 +142,40 @@ EXECUTE IMMEDIATE 'SELECT id FROM tbl_view WHERE id = :p' USING p, 'p'; EXECUTE IMMEDIATE 'SELECT id, data.f1 FROM tbl_view WHERE id = 10' INTO res_id, res_id; -- nested execute immediate -EXECUTE IMMEDIATE 'EXECUTE IMMEDIATE \'SELECT id FROM tbl_view WHERE id = ? USING 10\''; +EXECUTE IMMEDIATE 'EXECUTE IMMEDIATE \'SELECT id FROM tbl_view WHERE id = ?\' USING 10'; -- sqlString is null SET VAR sql_string = null; EXECUTE IMMEDIATE sql_string; +-- sqlString is null +SET VAR sql_string = 5; +EXECUTE IMMEDIATE sql_string; + +-- sqlString is null +SET VAR sql_string = 'hello'; +EXECUTE IMMEDIATE length(sql_string); + +-- mixed positional and named parameters in query +EXECUTE IMMEDIATE 'SELECT 42 where ? = :first' USING 1, 2 as first; Review Comment: and `2 as first` won't be treated as positional argument in the position 2? -- 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