SnowConvert AI Vertica – Unterschiede bei Bezeichnern zwischen Vertica und Snowflake

Bezeichner in Anführungszeichen

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

In Snowflake hängt die Groß-/Kleinschreibung von Bezeichnern in Anführungszeichen vom Sitzungsparameter QUOTED_IDENTIFIERS_IGNORE_CASE ab. Standardmäßig wird beim Vergleich von Bezeichnern in Anführungszeichen zwischen Groß- und Kleinschreibung unterschieden. Dies bedeutet, dass der Ergebniscode aus der Migration des obigen Beispiels:

Snowflake

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

SELECT
  "col#1"
FROM
  test.quotedIdentTable;

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

Bei der Ausführung der zweiten Auswahl fehlschlägt, es sei denn, der Sitzungsparameter ist auf TRUE gesetzt.

Wie SnowConvert AI Bezeichner in Anführungszeichen migriert

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