파라미터 관리(Parameter Management)

파라미터 관리(Parameter Management)

Snowflake는 계정에 설정할 수 있는 세 가지 유형의 파라미터를 제공해요.

  • 계정 전체에 영향을 주는 계정 파라미터(Account parameters)
  • 사용자와 그 세션에 기본값이 적용되는 세션 파라미터(Session parameters)
  • 객체(웨어하우스, 데이터베이스, 스키마, 테이블)에 기본값이 적용되는 객체 파라미터(Object parameters)

모든 파라미터에는 기본값이 있으며, 계정 수준에서 재정의할 수 있어요. 계정 수준에서 기본값을 재정의하려면 계정 관리자(즉 ACCOUNTADMIN 역할을 부여받은 사용자)여야 해요.

추가로 세션 및 객체 파라미터의 기본값은 파라미터 계층 구조의 각 수준에서 재정의할 수 있어요.

출처: Snowflake 문서

본문

계정의 파라미터 보기

계정의 파라미터와 그 현재 값, 그리고 기본값 목록을 보려면 SHOW PARAMETERS 명령을 다음 구문으로 사용해요.

SHOW PARAMETERS [ LIKE '<pattern>' ] IN ACCOUNT

예를 들어 모든 계정 수준 파라미터의 전체 목록을 보려면:

SHOW PARAMETERS IN ACCOUNT;
+-------------------------------------+----------------------------------+----------------------------------+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| key                                 | value                            | default                          | level   | description                                                                                                                                                                         |
|-------------------------------------+----------------------------------+----------------------------------+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ABORT_DETACHED_QUERY                | false                            | false                            |         | If true, Snowflake will automatically abort queries when it detects that the client has disappeared.                                                                                |
| AUTOCOMMIT                          | true                             | true                             |         | The autocommit property determines whether a statement should be implicitly                                                                                                     |
|                                     |                                  |                                  |         | wrapped within a transaction or not. If autocommit is set to true, then a                                                                                                           |
|                                     |                                  |                                  |         | statement that requires a transaction is executed within a transaction                                                                                                              |
|                                     |                                  |                                  |         | implicitly. If autocommit is off then an explicit commit or rollback is required                                                                                                    |
|                                     |                                  |                                  |         | to close a transaction. The default autocommit value is true.                                                                                                                       |
| AUTOCOMMIT_API_SUPPORTED            | true                             | true                             |         | Whether autocommit feature is enabled for this client. This parameter is for                                                                                                        |
|                                     |                                  |                                  |         | Snowflake use only.                                                                                                                                                                 |
| BINARY_INPUT_FORMAT                 | HEX                              | HEX                              |         | input format for binary                                                                                                                                                             |
| BINARY_OUTPUT_FORMAT                | HEX                              | HEX                              |         | display format for binary                                                                                                                                                           |
| CLIENT_ENCRYPTION_KEY_SIZE          | 128                              | 128                              |         | Client-side encryption key size in bits. Either 128 or 256.                                                                                                                         |
| CLIENT_SESSION_KEEP_ALIVE           | false                            | false                            |         | If true, client session will not expire automatically                                                                                                                               |
| DATA_RETENTION_TIME_IN_DAYS         | 1                                | 1                                |         | number of days to retain the old version of deleted/updated data                                                                                                                    |
| DATE_INPUT_FORMAT                   | AUTO                             | AUTO                             |         | input format for date                                                                                                                                                               |
| DATE_OUTPUT_FORMAT                  | YYYY-MM-DD                       | YYYY-MM-DD                       |         | display format for date                                                                                                                                                             |
| ERROR_ON_NONDETERMINISTIC_MERGE     | true                             | true                             |         | raise an error when attempting to merge-update a row that joins many rows                                                                                                           |
| ERROR_ON_NONDETERMINISTIC_UPDATE    | false                            | false                            |         | raise an error when attempting to update a row that joins many rows                                                                                                                 |
| LOCK_TIMEOUT                        | 43200                            | 43200                            |         | Number of seconds to wait while trying to lock a resource, before timing out                                                                                                        |
|                                     |                                  |                                  |         | and aborting the statement. A value of 0 turns off lock waiting i.e. the                                                                                                            |
|                                     |                                  |                                  |         | statement must acquire the lock immediately or abort. If multiple resources                                                                                                         |
|                                     |                                  |                                  |         | need to be locked by the statement, the timeout applies separately to each                                                                                                          |
|                                     |                                  |                                  |         | lock attempt.                                                                                                                                                                       |
| MAX_CONCURRENCY_LEVEL               | 8                                | 8                                |         | Concurrency level for SQL statements (i.e. queries and DML) executed by a warehouse cluster (used to determine when statements are queued or additional clusters are started).      |
| NETWORK_POLICY                      |                                  |                                  |         | Network policy assigned for the given target.                                                                                                                                       |
| PERIODIC_DATA_REKEYING              | false                            | false                            |         | If true, Snowflake will re-encrypt data that was encrypted more than a year ago.                                                                                                    |
| QUERY_TAG                           |                                  |                                  |         | String (up to 2000 characters) used to tag statements executed by the session                                                                                                       |
| QUOTED_IDENTIFIERS_IGNORE_CASE      | false                            | false                            |         | If true, the case of quoted identifiers is ignored                                                                                                                                  |
| ROWS_PER_RESULTSET                  | 0                                | 0                                |         | maximum number of rows in a result set                                                                                                                                               |
| SAML_IDENTITY_PROVIDER              |                                  |                                  |         | Authentication attributes for the SAML Identity provider                                                                                                                            |
| SSO_LOGIN_PAGE                      | true                             | false                            | ACCOUNT | Enable federated authentication for console login and redirects preview page to console login                                                                                       |
| STATEMENT_QUEUED_TIMEOUT_IN_SECONDS | 0                                | 0                                |         | Timeout in seconds for queued statements: statements will automatically be canceled if they are queued on a warehouse for longer than this amount of time; disabled if set to zero. |
| STATEMENT_TIMEOUT_IN_SECONDS        | 0                                | 0                                |         | Timeout in seconds for statements: statements will automatically be canceled if they run for longer than this amount of time; disabled if set to zero.                              |
| TIMESTAMP_DAY_IS_ALWAYS_24H         | false                            | true                             | SYSTEM  | If set, arithmetic on days always uses 24 hours per day,                                                                                                                            |
|                                     |                                  |                                  |         | possibly not preserving the time (due to DST changes)                                                                                                                               |
| TIMESTAMP_INPUT_FORMAT              | AUTO                             | AUTO                             |         | input format for timestamp                                                                                                                                                          |
| TIMESTAMP_LTZ_OUTPUT_FORMAT         |                                  |                                  |         | Display format for TIMESTAMP_LTZ values. If empty, TIMESTAMP_OUTPUT_FORMAT is used.                                                                                                 |
| TIMESTAMP_NTZ_OUTPUT_FORMAT         | YYYY-MM-DD HH24:MI:SS.FF3        | YYYY-MM-DD HH24:MI:SS.FF3        | SYSTEM  | Display format for TIMESTAMP_NTZ values. If empty, TIMESTAMP_OUTPUT_FORMAT is used.                                                                                                 |
| TIMESTAMP_OUTPUT_FORMAT             | YYYY-MM-DD HH24:MI:SS.FF3 TZHTZM | YYYY-MM-DD HH24:MI:SS.FF3 TZHTZM | SYSTEM  | Default display format for all timestamp types.                                                                                                                                     |
| TIMESTAMP_TYPE_MAPPING              | TIMESTAMP_NTZ                    | TIMESTAMP_NTZ                    | SYSTEM  | If TIMESTAMP type is used, what specific TIMESTAMP* type it should map to:                                                                                                          |
|                                     |                                  |                                  |         |   TIMESTAMP_LTZ (default), TIMESTAMP_NTZ or TIMESTAMP_TZ                                                                                                                            |
| TIMESTAMP_TZ_OUTPUT_FORMAT          |                                  |                                  |         | Display format for TIMESTAMP_TZ values. If empty, TIMESTAMP_OUTPUT_FORMAT is used.                                                                                                  |
| TIMEZONE                            | America/Los_Angeles              | America/Los_Angeles              |         | time zone                                                                                                                                                                           |
| TIME_INPUT_FORMAT                   | AUTO                             | AUTO                             |         | input format for time                                                                                                                                                               |
| TIME_OUTPUT_FORMAT                  | HH24:MI:SS                       | HH24:MI:SS                       |         | display format for time                                                                                                                                                             |
| TRANSACTION_ABORT_ON_ERROR          | false                            | false                            |         | If this parameter is true, and a statement issued within a non-autocommit                                                                                                           |
|                                     |                                  |                                  |         | transaction returns with an error, then the non-autocommit transaction is                                                                                                           |
|                                     |                                  |                                  |         | aborted. All statements issued inside that transaction will fail until an                                                                                                           |
|                                     |                                  |                                  |         | commit or rollback statement is executed to close that transaction.                                                                                                                 |
| TRANSACTION_DEFAULT_ISOLATION_LEVEL | READ COMMITTED                   | READ COMMITTED                   |         | The default isolation level when starting a transaction, when no                                                                                                         |
|                                     |                                  |                                  |         | isolation level was specified                                                                                                                                                       |
| TWO_DIGIT_CENTURY_START             | 1970                             | 1970                             |         | For 2-digit dates, defines a century-start year.                                                                                                                                    |
|                                     |                                  |                                  |         | For example, when set to 1980:                                                                                                                                                      |
|                                     |                                  |                                  |         |   - parsing a string '79' will produce 2079                                                                                                                                         |
|                                     |                                  |                                  |         |   - parsing a string '80' will produce 1980                                                                                                                                         |
| UNSUPPORTED_DDL_ACTION              | ignore                           | ignore                           |         | The action to take upon encountering an unsupported ddl statement                                                                                                                   |
| USE_CACHED_RESULT                   | true                             | true                             |         | If enabled, query results can be reused between successive invocations of the same query as long as the original result has not expired                                             |
+-------------------------------------+----------------------------------+----------------------------------+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

출력에서 value와 level 열을 주목해요.

  • value는 각 파라미터의 현재 값을 지정해요.
  • level은 현재 값의 출처를 지정해요. 파라미터에 대해 level 열이 비어 있으면 파라미터가 명시적으로 설정되지 않았고 현재 값이 기본값이라는 뜻이에요.

계정의 파라미터 변경

계정의 파라미터를 변경하려면 계정 관리자로 Snowflake에 로그인하고 ALTER ACCOUNT 명령을 다음 구문으로 사용해요.

ALTER ACCOUNT SET <param> = <value>

예를 들어 DATE_OUTPUT_FORMAT 세션 파라미터를 설정하려면:

ALTER ACCOUNT SET DATE_OUTPUT_FORMAT = 'DD/MM/YYYY';

SHOW PARAMETERS LIKE 'DATE_OUTPUT%' IN ACCOUNT;
+--------------------+------------+------------+---------+-------------------------+
| key                | value      | default    | level   | description             |
|--------------------+------------+------------+---------+-------------------------|
| DATE_OUTPUT_FORMAT | DD/MM/YYYY | YYYY-MM-DD | ACCOUNT | display format for date |
+--------------------+------------+------------+---------+-------------------------+

출력의 level 열이 파라미터의 값이 현재 계정 수준에서 설정되어 있음을 보여준다는 점을 주목해요.

이것은 세션의 모든 날짜에 대한 기본 표시 형식이 YYYY-MM-DD 대신 DD/MM/YYYY가 됨을 지정해요(예: 2016-04-23 대신 23/04/2016). 이 날짜 표시 형식은 기본값일 뿐이며 개별 사용자나 세션에 대해 재정의할 수 있다는 점을 주목해요.

파라미터 재설정

계정의 파라미터를 기본값으로 재설정하려면 ALTER ACCOUNT를 다음 구문으로 사용해요.

ALTER ACCOUNT UNSET <param>

예를 들어 DATE_OUTPUT_FORMAT 세션 파라미터를 기본값으로 재설정하려면:

ALTER ACCOUNT UNSET DATE_OUTPUT_FORMAT;

더 알아보기 (Learn more)