-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some queries return JSONResultBatch result type, causing errors #21
Comments
Thanks @noyoshi for trying |
So this is caused by the fact that Snowflake cannot always provide results in Arrow format. Currently only with snowflake.connector.connect(
...
) as cnx:
with cnx.cursor() as cur:
cur.execute(f"SHOW TABLES")
cur.execute(f"select * from table(result_scan('{cur.sfqid}'));")
print(cur.fetchall()) |
Thanks for the additional context @sfc-gh-mkeller -- I hadn't realized that only I could be missing something, but it looks like the snippet you posted might cause the entire query result to be loaded into memory -- is that the case? Is there a standard way to convert a |
That's right, @jrbourbeau Not currently, unless you could convert the Python results yourself into I'd imagine that this might return different data types than what our Arrow converter does, but if this works at all I'd be happy to get us to take over and add a way to do this natively in our connector. |
It appears some queries return results as a JSONResultBatch, which causes issues as the connector assumes the format will be arrow.
Specific error:
The query in this case was
SHOW TABLES;
. Not sure if snowflake makes it clear what types of results we can get, if so we can add some validation to the connector to check the different types perhaps? (More than just arrow)Validated that a normal query would return the proper result
SELECT * FROM TABLE LIMIT 100
, which worked.The text was updated successfully, but these errors were encountered: