Stored Procedures: put_stream Uses Different Way to Get the File Name¶
Attention
This behavior change is in the 2023_02 bundle.
For the current status of the bundle, refer to Bundle History.
The way you use put_stream inside stored procedures to upload files to a stage has changed and now aligns with the put_stream
protocol to Snowpark Python client.
- Previously:
- Uploading files using - put_streamfrom stored procedures was called using a- stage_prefixand an- input_stream. The stored procedure inferred the file name from- input_streamusing- input_stream.nameand uploading it to the- stage_prefix.put_streamwould break in the case where- input_streamdid not have the- nameattribute. This behavior differed from- put_streamon the Snowpark Python client.
- Currently:
- Uploading files using put_stream from stored procedures is called using a - stage_location=- stage_prefix+- /+- file_name, and an- input_stream. The stored procedure infers the file name using- stage_location. This would work in the case where- input_streamdoes not have a- nameattribute and the behavior also aligns with the Snowpark Python client.
Note
Customers using put_stream without a full stage location should update their code to upload files using a full stage location with
stage prefix and target file name.
Ref: 943