SnowConvert AI - Vertica - Vertica와 Snowflake 간의 식별자 차이

따옴표가 있는 식별자

In Vertica, quoted identifiers stick to the case sensitivity rules, which means that, for example, column names are still case insensitive even when quoted. Thus, identifiers "ABC", "ABc", and "aBc" are synonymous, as are ABC, ABc, and aBc :

Vertica

CREATE TABLE test.quotedIdentTable
(
  "col#1" INTEGER
);

SELECT "col#1" FROM test.quotedIdentTable;

SELECT "COL#1" FROM test.quotedIdentTable;
Copy

Snowflake에서 따옴표가 있는 식별자의 대/소문자 구분은 세션 매개 변수QUOTED_IDENTIFIERS_IGNORE_CASE에 따라 좌우되며, 기본적으로 따옴표가 있는 식별자 비교는 대/소문자를 구분합니다. 즉, 위의 예를 마이그레이션한 결과 코드는 다음과 같습니다.

Snowflake

CREATE TABLE test.quotedIdentTable
(
  "col#1" INTEGER
);

SELECT
  "col#1"
FROM
  test.quotedIdentTable;

SELECT
  "COL#1"
FROM
  test.quotedIdentTable;
Copy

세션 매개 변수가 TRUE로 설정되어 있지 않으면 두 번째 선택을 실행할 때 실패합니다.

SnowConvert AI가 따옴표가 있는 식별자를 마이그레이션하는 방법

SnowConvert AI will analyze quoted identifiers to determine if they contain non-alphanumeric characters or are reserved words in Snowflake, if they do SnowConvert AI will leave them as they are, alphanumeric identifiers will be left unquoted:

Vertica

CREATE TABLE test.identsTable1
(
  "col#1" INTEGER,
  "col2" INTEGER
);

-- Group is a reserved word
SELECT 
"col#1" AS "group",
"col2" AS "hello"
FROM
test.identsTable1;
Copy

Snowflake

CREATE TABLE test.identsTable1
(
  "col#1" INTEGER,
  col2 INTEGER
);

-- Group is a reserved word
SELECT
  "col#1" AS "group",
  col2 AS hello
FROM
  test.identsTable1;
Copy