Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!
- What version of JDBC driver are you using?
3.23.2
- What operating system and processor architecture are you using?
PopOS 22.04 / x86
- What version of Java are you using?
Adoptium JDK 21
- What did you do?
I wrote a Python procedure that returns a table (DataFrame). That procedure is called from within a SQL procedure which just stores the result of the nested procedure as result set and returns it.
CREATE OR REPLACE TABLE data AS
SELECT "ID" FROM VALUES (42), (43), (44), (45), (46), (47) AS TEMP_TABLE("ID");
CREATE OR REPLACE PROCEDURE nested_proc(table_name string)
RETURNS TABLE(id bigint)
LANGUAGE PYTHON
RUNTIME_VERSION = '3.11'
PACKAGES = ('snowflake-snowpark-python')
HANDLER = 'run_job'
AS
$$
import snowflake.snowpark as snowpark
def run_job(session: snowpark.Session, table_name: str) -> snowpark.DataFrame:
return session.table(table_name)
$$;
CREATE OR REPLACE PROCEDURE outer_proc(table_name string)
RETURNS TABLE(id bigint)
LANGUAGE SQL AS
DECLARE
res resultset;
BEGIN
res := (CALL nested_proc(:table_name));
RETURN TABLE(res);
END;
CALL outer_proc('data');
When CALL outer_proc('data') is called from either JDBC directly or via SnowCLI, the response is
240010 (08004): 01bb879c-0001-b638-0001-87e201eb6252: Uncaught exception of type 'STATEMENT_ERROR' on line 4 at position 12 : Missing rowset from response. No results found.
- What did you expect to see?
The column values of the given table.
This works fine when calling via snowsql or directly in Snowsight.
I can confirm that it works if outer_proc is also written in Python, e.g.
CREATE OR REPLACE PROCEDURE outer_proc_python(table_name string)
RETURNS TABLE(id bigint)
LANGUAGE PYTHON
RUNTIME_VERSION = '3.11'
PACKAGES = ('snowflake-snowpark-python')
HANDLER = 'run_job'
AS
$$
import snowflake.snowpark as snowpark
def run_job(session: snowpark.Session, table_name: str) -> snowpark.DataFrame:
return session.sql(f"CALL nested_proc('{table_name}')")
$$;
I assume that this is somehow related to the session which might be bound to the returned dataframe but somehow lost when the execution of the nested proc is done.
Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!
3.23.2
PopOS 22.04 / x86
Adoptium JDK 21
I wrote a Python procedure that returns a table (DataFrame). That procedure is called from within a SQL procedure which just stores the result of the nested procedure as result set and returns it.
When
CALL outer_proc('data')is called from either JDBC directly or via SnowCLI, the response isThe column values of the given table.
This works fine when calling via
snowsqlor directly in Snowsight.I can confirm that it works if
outer_procis also written in Python, e.g.I assume that this is somehow related to the session which might be bound to the returned dataframe but somehow lost when the execution of the nested proc is done.