問題文
A specialist has to compute the length of each of several thousand text files on a stage, where the file names are not known in advance and arrive as a column of values. Which approach reads the files from inside Snowflake?
選択肢
- Create a DataFrame over the stage with the reader and read the length from the metadata columns it exposes for each file.
- Download the files to the client with the file get operation and measure them there, because stage files cannot be opened from a handler that runs on a warehouse.
- Register a function whose handler opens each path with the file class from the Snowpark files module, which gives dynamic access to a stage file.
- Add every file as an import when registering the function, then open each one from the home directory of the function at run time.