
Answer-first summary for fast verification
Answer: If a role was specified as part of the connection and that role has been granted to the Snowflake user, the specified role becomes the current role., If no role was specified as part of the connection and a default role has been defined for the Snowflake user, that role becomes the current role.
The correct answers are A and B based on Snowflake's documented role determination logic and the community consensus. Option A is correct because when a role is explicitly specified in the connection parameters and that role has been granted to the user, Snowflake uses that specified role as the current role. Option B is correct because when no role is specified in the connection, Snowflake falls back to using the user's default role (if one is defined). Option C is incorrect because the session will still initiate and use the PUBLIC role if no default role is set. Option D is incorrect because if a specified role hasn't been granted to the user, it's not ignored - the connection fails or uses an alternative role. Option E is incorrect because roles are not automatically granted; they must be explicitly granted to users beforehand.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
Which two factors does Snowflake use to determine the initial current role for a new session?
A
If a role was specified as part of the connection and that role has been granted to the Snowflake user, the specified role becomes the current role.
B
If no role was specified as part of the connection and a default role has been defined for the Snowflake user, that role becomes the current role.
C
If no role was specified as part of the connection and a default role has not been set for the Snowflake user, the session will not be initiated and the log in will fail.
D
If a role was specified as part of the connection and that role has not been granted to the Snowflake user, it will be ignored and the default role will become the current role.
E
If a role was specified as part of the connection and that role has not been granted to the Snowflake user, the role is automatically granted and it becomes the current role.
No comments yet.