You have a requirement to create Snowpark DataFrames from CSV files located in an AWS S3 external stage. Some CSV files have a header row, while others do not. The files also use different delimiters (comma, semicolon, or tab). You want to create a single function that can handle all these variations, without creating separate functions for each combination. The 'create_dataframe' function receives the stage path, the delimiter, and a boolean indicating whether a header is present. Which of the following code snippets, when implemented inside the function, BEST achieves this goal using the Snowpark Python API? Assume a Snowpark session 'session'.
A.

B.

C.

D.

E.

正解:D
解説: (Pass4Test メンバーにのみ表示されます)
質問 2:
You are developing a Snowpark application that needs to connect to Snowflake using programmatic access. You want to use a secure method of authentication. Which of the following methods, when passed as parameters to the 'snowpark.Session.builder.configS method, would be MOST secure and appropriate for production environments?
A. Using 'private_key' stored securely and referencing it using 'private_key_file'.
B. Passing the 'user' and 'password' directly, but retrieving the 'account' from an environment variable.
C. Setting the 'authenticator' parameter to 'snowflake' and rely on default Snowflake authentication mechanism assuming it setup correctly
D. Passing the 'user', 'password', and 'account' parameters directly as strings.
E. Using 'oauth_access_token' obtained from an external OAuth server.
正解:A,E
解説: (Pass4Test メンバーにのみ表示されます)
質問 3:
You are troubleshooting a Snowpark application that fails to connect to Snowflake intermittently. The error message indicates an issue with the specified account identifier Which of the following actions could help resolve this issue? Select all that apply.
A. Check the Snowflake network policy to ensure that the IP address from which the Snowpark application is connecting is allowed.
B. Verify that the account identifier is correctly specified in the connection parameters, including the region if applicable.
C. Restart the Snowpark application server to clear any cached connection information.
D. Confirm that the Snowflake service is not experiencing any outages in the specified region.
E. Ensure that the user specified in the connection parameters has the necessary privileges to access the database and schema.
正解:A,B,D
解説: (Pass4Test メンバーにのみ表示されます)
質問 4:
You are developing a Snowpark Python stored procedure that needs to interact with an external REST API. The API requires authentication using an API key, which you want to store securely and access within the stored procedure. What is the MOST secure and recommended way to store and retrieve the API key within the stored procedure?
A. Store the API Key as a comment in the Store procedure code, and retrieve it using REGEX
B. Store the API key as an environment variable within the Snowflake warehouse configuration.
C. Store the API key in a Snowflake table and query it within the stored procedure.
D. Store the API key in a Snowflake Secret and access it using the 'secrets' module within the stored procedure.
E. Store the API key as a constant string within the stored procedure's code.
正解:D
解説: (Pass4Test メンバーにのみ表示されます)
質問 5:
You are tasked with building a Snowpark Python application to process JSON files stored in a Snowflake stage. The JSON files contain customer feedback data, including sentiment scores. You need to create a stored procedure that reads the JSON files, calculates the average sentiment score, and stores the result in a Snowflake table. You also need to handle potential errors, such as invalid JSON format in some files, and continue processing other files. Which of the following approaches is MOST efficient and robust to handle this scenario?
A. Implement an external function using AWS Lambda or Azure Functions to parse the JSON files and calculate the average sentiment score. Call this external function from the stored procedure. This provides better error handling and scalability.
B. Download the JSON files to the Snowpark client, process them using standard Python libraries (like 'json'), and then upload the aggregated data back to Snowflake using 'session.write_pandas()'. Handle errors locally and log them.
C. Use the function directly within the stored procedure to parse each JSON file. Catch exceptions within the loop and log errors to a separate table. Use 'DataFrame.write.mode('append')' to write the average sentiment score to the target table.
D. Use and return a DataFrame containing the average sentiment score and file name for each processed file. Handle JSON parsing errors by skipping the file and logging the error. Use to write the DataFrame to the target table.
E. Load the JSON data into a VARIANT column in a temporary table. Use a Snowpark DataFrame transformation to parse the JSON data from the VARIANT column. Catch errors during the DataFrame transformation process and log them to a separate table. Finally, calculate the average sentiment score using Snowpark functions.
正解:C
解説: (Pass4Test メンバーにのみ表示されます)
901 お客様のコメント







寉冈** -
SPS-C01問題集ぽく、この一冊でだけで合格できました。Pass4Testありがとうございました。