SNOW-2098847: Do not use "scoped temporary" stage for XML reader in stored procedure #3354
SNOW-2098847: Do not use "scoped temporary" stage for XML reader in stored procedure #3354sfc-gh-jdu merged 1 commit intomainfrom
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
ac3a34a to
d18d851
Compare
d18d851 to
d0a482a
Compare
d0a482a to
113eca5
Compare
| _, input_types = get_types_from_type_hints( | ||
| (XML_READER_FILE_PATH, handler_name), TempObjectType.TABLE_FUNCTION |
There was a problem hiding this comment.
There appears to be a path inconsistency in the type hint resolution. The code is using XML_READER_FILE_PATH to extract type hints, but then using python_file_path when calling register_from_file(). In the stored procedure case, these paths differ significantly - XML_READER_FILE_PATH is a local filesystem path while python_file_path is a stage path.
For consistency and correctness, the same path should be used in both places. Consider modifying the code to use python_file_path for both the type hint extraction and the registration.
| _, input_types = get_types_from_type_hints( | |
| (XML_READER_FILE_PATH, handler_name), TempObjectType.TABLE_FUNCTION | |
| _, input_types = get_types_from_type_hints( | |
| (python_file_path, handler_name), TempObjectType.TABLE_FUNCTION |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-2098847
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
register_from_file() doesn't work in stored procedure when calling the UDF, if the underlying stage (session stage) is scoped temporary.