snowflake.snowpark.Session.sql¶
- Session.sql(query: str, params: Optional[Sequence[Any]] = None) DataFrame[source]¶
Returns a new DataFrame representing the results of a SQL query. You can use this method to execute a SQL statement. Note that you still need to call
DataFrame.collect()to execute this query in Snowflake.- Parameters:
query – The SQL statement to execute.
params – binding parameters. We only support qmark bind variables. For more information, check https://docs.snowflake.com/en/developer-guide/python-connector/python-connector-example#qmark-or-numeric-binding
Example: