From 5b73da19594dcc0f4ed1898a85aba0bd8cf2dc0b Mon Sep 17 00:00:00 2001 From: Bing Li Date: Thu, 21 Nov 2024 11:12:31 -0800 Subject: [PATCH] refactor session sql --- .../scala/com/snowflake/snowpark/Session.scala | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/scala/com/snowflake/snowpark/Session.scala b/src/main/scala/com/snowflake/snowpark/Session.scala index 8a670b90..3511db00 100644 --- a/src/main/scala/com/snowflake/snowpark/Session.scala +++ b/src/main/scala/com/snowflake/snowpark/Session.scala @@ -945,11 +945,24 @@ class Session private (private[snowpark] val conn: ServerConnection) extends Log * You can use this method to execute an arbitrary SQL statement. * * @param query The SQL statement to execute. - * @param params for bind variables in SQL statement. * @return A [[DataFrame]] * @since 0.1.0 */ - def sql(query: String, params: Seq[Any] = Seq.empty): DataFrame = { + def sql(query: String): DataFrame = { + sql(query, Seq.empty) + } + + /** + * Returns a new DataFrame representing the results of a SQL query. + * + * You can use this method to execute an arbitrary SQL statement. + * + * @param query The SQL statement to execute. + * @param params for bind variables in SQL statement. + * @return A [[DataFrame]] + * @since 1.15.0 + */ + def sql(query: String, params: Seq[Any]): DataFrame = { // PUT and GET command cannot be executed in async mode DataFrame(this, plans.query(query, None, !Utils.isPutOrGetCommand(query), params)) }