Zgodność ANSI w środowisku Databricks Runtime

Dotyczy:check marked yes Databricks Runtime

W tym artykule opisano zgodność ANSI w środowisku Databricks Runtime. W przypadku trybu ANSI w usłudze Databricks SQL zobacz ANSI_MODE.

Usługa Spark SQL oferuje dwie opcje obsługi zgodności ze standardem ANSI SQL: spark.sql.ansi.enabled i spark.sql.storeAssignmentPolicy.

Gdy spark.sql.ansi.enabled jest ustawiona wartość true, usługa Spark SQL używa zgodnego dialektu ANSI zamiast zgodnego z programem Hive. Na przykład platforma Spark zgłosi wyjątek w czasie wykonywania zamiast zwracać wyniki o wartości null, jeśli dane wejściowe do operatora/funkcji SQL są nieprawidłowe. Niektóre funkcje dialektu ANSI mogą nie pochodzić bezpośrednio ze standardu ANSI SQL, ale ich zachowania są zgodne ze stylem ANSI SQL.

Ponadto usługa Spark SQL ma niezależną opcję kontrolowania niejawnych zachowań rzutowania podczas przechowywania wierszy w tabeli. Zachowania rzutowania są definiowane jako reguły przypisywania magazynu w standardzie.

Gdy spark.sql.storeAssignmentPolicy jest ustawiona wartość ANSI, usługa Spark SQL jest zgodna z regułami przypisywania magazynu ANSI. Jest to oddzielna konfiguracja, ponieważ jej wartość domyślna to ANSI, a konfiguracja spark.sql.ansi.enabled jest domyślnie wyłączona.

Poniższa tabela zawiera podsumowanie zachowania:

Nazwa właściwości Wartość domyślna Znaczenie
spark.sql.ansi.enabled fałsz Jeśli to prawda, platforma Spark próbuje dostosować się do specyfikacji ANSI SQL:

* Zgłasza wyjątek środowiska uruchomieniowego, jeśli przepełnienie występuje w dowolnej operacji na liczbą całkowitą lub polem dziesiętnym.
* Zabrania używania zarezerwowanych słów kluczowych sql ANSI jako identyfikatorów w analizatorze SQL.
spark.sql.storeAssignmentPolicy ANSI Podczas przechowywania wartości w kolumnie o innym typie danych platforma Spark wykonuje konwersję typu. Istnieją trzy zasady dotyczące reguł przymusu typów: ANSI, legacyi strict.

* ANSI: Platforma Spark wykonuje przymus typu zgodnie z instrukcjami ANSI SQL. W praktyce zachowanie jest w większości takie samo jak w przypadku bazy danych PostgreSQL. Nie zezwala na pewne nieuzasadnione konwersje typów, takie jak konwertowanie ciągu na int lub podwójne na wartość logiczną.
* legacy: Platforma Spark zezwala na przymus typu, o ile jest to prawidłowa obsada, która jest bardzo luźna. Na przykład konwertowanie ciągu na int lub podwójne na wartość logiczną jest dozwolone. Jest to również jedyne zachowanie platformy Spark 2.x i jest zgodne z programem Hive.
* strict: Platforma Spark nie zezwala na żadną możliwą utratę precyzji ani obcinanie danych w trybie przymusu typu, na przykład konwersja podwójna na wartość int lub liczba dziesiętna na podwójną nie jest dozwolona.

W poniższych podsekcjach przedstawiono zmiany zachowania operacji arytmetycznych, konwersji typów i analizowania SQL po włączeniu trybu ANSI. W przypadku konwersji typów w usłudze Spark SQL istnieją trzy rodzaje, a w tym artykule przedstawiono je jeden po jednym: rzutowanie, przypisywanie magazynu i typ przymusu.

Operacje arytmetyczne

W usłudze Spark SQL operacje arytmetyczne wykonywane na typach liczbowych (z wyjątkiem liczby dziesiętnej) nie są domyślnie sprawdzane pod kątem przepełnienia. Oznacza to, że w przypadku, gdy operacja powoduje przepełnienie, wynik jest taki sam w przypadku odpowiedniej operacji w programie Java lub Scala (na przykład jeśli suma 2 liczb całkowitych jest wyższa niż maksymalna wartość, którą można przedstawić, wynik jest liczbą ujemną). Z drugiej strony usługa Spark SQL zwraca wartość null dla przepełnienia dziesiętnego. Gdy spark.sql.ansi.enabled jest ustawiona wartość i true przepełnienie występuje w operacjach arytmetycznych liczbowych i interwałowych, zgłasza wyjątek arytmetyczny w czasie wykonywania.

-- `spark.sql.ansi.enabled=true`
> SELECT 2147483647 + 1;
 error: integer overflow

-- `spark.sql.ansi.enabled=false`
> SELECT 2147483647 + 1;
  -2147483648

Rzutowanie

Gdy spark.sql.ansi.enabled jest ustawiona wartość true, jawne rzutowanie przez CAST składnię zgłasza wyjątek środowiska uruchomieniowego dla nielegalnych wzorców rzutowania zdefiniowanych w standardzie, takich jak rzutowania z ciągu na liczbę całkowitą.

Klauzula CAST trybu Spark ANSI jest zgodna z regułami składni w sekcji 6.13 "specyfikacja rzutowania" w standardzie ISO/IEC 9075-2:2011 Information technology — Database languages — SQL — Part 2: Foundation (SQL/Foundation), z wyjątkiem następujących prostych konwersji typów, które są niedozwolone zgodnie ze standardem ANSI:

  • NumericType <=> Wartość logiczna
  • StringType => BinaryType <

Prawidłowe kombinacje typu danych źródłowych i docelowych w wyrażeniu CAST są podane w poniższej tabeli. "Y" wskazuje, że kombinacja jest składniowo prawidłowa bez ograniczeń i "N" wskazuje, że kombinacja jest nieprawidłowa.

SourceTarget Liczbowe String Data Sygnatura czasowa Interwał Wartość logiczna Plik binarny Tablica Mapowanie Struktura
Liczbowe Y Y N N N Y N N N N
String Y Y Y Y Y Y Y N N N
Data N Y Y Y N N N N N N
Sygnatura czasowa N Y Y Y N N N N N N
Interwał N Y N N Y N N N N N
Wartość logiczna Y Y N N N Y N N N N
Plik binarny Y N N N N N Y N N N
Tablica N N N N N N N Y N N
Mapowanie N N N N N N N N Y N
Struktura N N N N N N N N N Y
-- Examples of explicit casting

-- `spark.sql.ansi.enabled=true`
> SELECT CAST('a' AS INT);
  ERROR: [CAST_INVALID_INPUT] The value 'a' of the type "STRING" cannot be cast to "INT" because it is malformed.

> SELECT CAST(2147483648L AS INT);
  ERROR: [CAST_OVERFLOW] The value 2147483648L of the type "BIGINT" cannot be cast to "INT" due to an overflow.

> SELECT CAST(DATE'2020-01-01' AS INT)
  ERROR: [DATATYPE_MISMATCH.CAST_WITH_FUNC_SUGGESTION] Cannot resolve "CAST(DATE '2020-01-01' AS INT)" due to data type mismatch: cannot cast "DATE" to "INT".

-- `spark.sql.ansi.enabled=false` (This is a default behavior)
> SELECT cast('a' AS INT);
  null

> SELECT CAST(2147483648L AS INT);
  -2147483648

> SELECT CAST(DATE'2020-01-01' AS INT);
  null

Przypisanie magazynu

spark.sql.storeAssignmentPolicy Ustawienie ma wartość domyślną ANSI. Dzięki temu ustawieniu, gdy typy danych wartości źródłowych nie są zgodne z typami kolumn docelowych, usługa Spark SQL automatycznie dodaje klauzule ANSI CAST do instrukcji INSERT. Podczas wstawiania tabeli w ramach tych zasad platforma Spark sprawdza i odrzuca nieprawidłowe rzutowania, zgłaszając wyjątek w celu zapewnienia jakości danych. Oznacza to, że jeśli próba wstawiania nie powiedzie się z powodu niezgodności typu, nie spowoduje to częściowego zapisania danych w tabeli.

Przykłady:

-- spark.sql.storeAssignmentPolicy=ANSI
> CREATE TABLE test(i INT);
> INSERT INTO test VALUES (2147483648L);
  ERROR: [CAST_OVERFLOW_IN_TABLE_INSERT] Fail to insert a value of "BIGINT" type into the "INT" type column `i` due to an overflow.

> INSERT INTO test VALUES ('a');
  ERROR: [CAST_INVALID_INPUT ERROR] The value 'a' of the type "STRING" cannot be cast to "INT" because it is malformed

W tych przykładach pokazano, że usługa Spark SQL uniemożliwia wstawianie niezgodnych danych, zapewniając integralność danych.

spark.sql.storeAssignmentPolicy Gdy właściwość jest ustawiona na LEGACYwartość , usługa Spark SQL przywraca zachowanie rozpowszechnione do platformy Spark 2.x. W tym trybie zamiast używać funkcji ANSI CAST, stosuje starsze operacje CAST. W ramach tych zasad nieprawidłowe rzutowania podczas wstawiania tabeli powodują wstawienie wartości NULL lub niepoprawnych wartości zamiast zgłaszania wyjątku. Przykłady:

-- spark.sql.storeAssignmentPolicy=LEGACY
> CREATE TABLE test(i INT);
> INSERT INTO test VALUES (2147483648L);
> INSERT INTO test VALUES ('a');
> SELECT * FROM test;

-- Results
--  -2147483648 (incorrect value due to overflow)
--  null (cannot cast 'a' to INT)

Wymuszanie typu

Typ Podwyższanie poziomu i pierwszeństwo

Gdy spark.sql.ansi.enabled jest ustawiona wartość true, usługa Spark SQL używa kilku reguł, które określają sposób rozwiązywania konfliktów między typami danych. W centrum tej rozwiązywania konfliktów jest lista pierwszeństwa typu, która określa, czy wartości danego typu danych mogą być promowane do innego typu danych niejawnie.

Typ danych lista pierwszeństwa (od najwęższej do najszerszej)
Byte Byte - Short -> Int - Long ->> Decimal -> Float* -> Double>
Krótkie Krótki - Int ->> Long -> Decimal-> Float* -> Double
Int Int - Long ->> Decimal -> Float* -> Double
Długi Długi — dziesiętny —>> zmiennoprzecinkowy* —> podwójny
Dziesiętne Liczba dziesiętna —> liczba zmiennoprzecinkowa* —> podwójna
Liczba zmiennoprzecinkowa Zmiennoprzecinkowy —> podwójny
Liczba rzeczywista Liczba rzeczywista
Data Data —> sygnatura czasowa
Sygnatura czasowa Sygnatura czasowa
String String
Plik binarny Plik binarny
Wartość logiczna Wartość logiczna
Interwał Interwał
Mapowanie Mapę**
Tablica Tablicy**
Struktura Struct**
  • W przypadku najmniejszej typowej rozdzielczości zmiennoprzecinkowej jest pomijana, aby uniknąć utraty precyzji.

** W przypadku typu złożonego reguła pierwszeństwa jest cyklicznie stosowana do jej elementów składowych.

Reguły specjalne mają zastosowanie do typu Ciąg i nietypowej wartości NULL. Wartość NULL można awansować do dowolnego innego typu, a ciąg może zostać podwyższony do dowolnego prostego typu danych.

Jest to graficzne przedstawienie listy pierwszeństwa jako drzewa kierowanego: Graphical representation of precedence rules

Rozpoznawanie najmniej typowych typów

Najmniej typowym typem z zestawu typów jest najwęższy typ osiągalny z listy pierwszeństwa przez wszystkie elementy zestawu typów.

Najmniej typowe rozpoznawanie typów jest używane do:

  • Zdecyduj, czy można wywołać funkcję oczekującą parametru typu przy użyciu argumentu węższego typu.
  • Utwórz typ argumentu dla funkcji, które oczekują współużytkowanego typu argumentu dla wielu parametrów, takich jak łączenie, najmniej lub największe.
  • Utwórz typy operandów dla operatorów, takich jak operacje arytmetyczne lub porównania.
  • Utwórz typ wyniku dla wyrażeń, takich jak wyrażenie przypadku.
  • Wyodrębnij typy elementów, kluczy lub wartości dla konstruktorów tablic i map.

Specjalne reguły są stosowane, jeśli najmniej typowy typ jest rozpoznawany jako FLOAT. W przypadku wartości typu zmiennoprzecinkowego, jeśli którykolwiek z typów to INT, BIGINT lub DECIMAL najmniej typowy typ jest wypychany do wartości DOUBLE, aby uniknąć potencjalnej utraty cyfr.

-- The coalesce function accepts any set of argument types as long as they share a least common type.
-- The result type is the least common type of the arguments.
> SET spark.sql.ansi.enabled=true;

> SELECT typeof(coalesce(1Y, 1L, NULL));
BIGINT

> SELECT typeof(coalesce(1, DATE'2020-01-01'));
Error: Incompatible types [INT, DATE]

> SELECT typeof(coalesce(ARRAY(1Y), ARRAY(1L)));
ARRAY<BIGINT>

> SELECT typeof(coalesce(1, 1F));
DOUBLE

> SELECT typeof(coalesce(1L, 1F));
DOUBLE

> SELECT (typeof(coalesce(1BD, 1F)));
DOUBLE

-- The substring function expects arguments of type INT for the start and length parameters.
> SELECT substring('hello', 1Y, 2);
he

> SELECT substring('hello', '1', 2);
he

> SELECT substring('hello', 1L, 2);
Error: Argument 2 requires an INT type.

> SELECT substring('hello', str, 2) FROM VALUES(CAST('1' AS STRING)) AS T(str);
Error: Argument 2 requires an INT type.

Funkcje SQL

Zachowanie niektórych funkcji SQL może być inne w trybie ANSI (spark.sql.ansi.enabled=true).

  • size: Ta funkcja zwraca wartość null dla danych wejściowych o wartości null w trybie ANSI.
  • element_at:
    • Ta funkcja zgłasza wyjątek w przypadku używania nieprawidłowych ArrayIndexOutOfBoundsException indeksów.
    • Ta funkcja zgłasza, NoSuchElementException czy klucz nie istnieje na mapie.
  • elt: Ta funkcja zgłasza wyjątek w przypadku używania nieprawidłowych ArrayIndexOutOfBoundsException indeksów.
  • make_date: Ta funkcja kończy się niepowodzeniem z wyjątkiem, jeśli data wyniku jest nieprawidłowa.
  • make_timestamp: Ta funkcja kończy się niepowodzeniem z wyjątkiem, jeśli sygnatura czasowa wyniku jest nieprawidłowa.
  • make_interval: Ta funkcja kończy się niepowodzeniem z wyjątkiem, jeśli interwał wyników jest nieprawidłowy.
  • next_day: Ta funkcja zgłasza, IllegalArgumentException jeśli dane wejściowe nie są prawidłowym dniem tygodnia.
  • parse_url: Ta funkcja zgłasza, IllegalArgumentException jeśli ciąg wejściowy nie jest prawidłowym adresem URL.
  • to_date: Ta funkcja kończy się niepowodzeniem z wyjątkiem, jeśli nie można przeanalizować ciągu wejściowego lub ciąg wzorca jest nieprawidłowy.
  • to_timestamp: Ta funkcja kończy się niepowodzeniem z wyjątkiem, jeśli nie można przeanalizować ciągu wejściowego lub ciąg wzorca jest nieprawidłowy.
  • to_unix_timestamp: Ta funkcja kończy się niepowodzeniem z wyjątkiem, jeśli nie można przeanalizować ciągu wejściowego lub ciąg wzorca jest nieprawidłowy.
  • unix_timestamp: Ta funkcja kończy się niepowodzeniem z wyjątkiem, jeśli nie można przeanalizować ciągu wejściowego lub ciąg wzorca jest nieprawidłowy.

Operatory SQL

Zachowanie niektórych operatorów SQL może być inne w trybie ANSI (spark.sql.ansi.enabled=true).

  • array_col[index]: ten operator zgłasza wyjątek w przypadku używania nieprawidłowych ArrayIndexOutOfBoundsException indeksów.
  • map_col[key]: ten operator zgłasza, NoSuchElementException czy klucz nie istnieje na mapie.
  • CAST(string_col AS TIMESTAMP): Ten operator kończy się niepowodzeniem z wyjątkiem, jeśli nie można przeanalizować ciągu wejściowego.
  • CAST(string_col AS DATE): Ten operator kończy się niepowodzeniem z wyjątkiem, jeśli nie można przeanalizować ciągu wejściowego.

Przydatne funkcje dla trybu ANSI

Gdy tryb ANSI jest włączony, zgłasza wyjątki dla nieprawidłowych operacji. Następujące funkcje SQL umożliwiają pomijanie takich wyjątków.

  • try_cast: identyczny z CAST, z tą różnicą, że zwraca NULL wynik zamiast zgłaszać wyjątek w przypadku błędu czasu wykonywania.
  • try_add: identyczny z operatorem +add , z tą różnicą, że zwraca NULL wynik zamiast zgłaszać wyjątek w przepełnieniu wartości całkowitej.
  • try_divide: identyczny z operatorem /dzielenia , z tą różnicą, że zwraca NULL wynik zamiast zgłaszać wyjątek podczas dzielenia 0.

Słowa kluczowe SQL

Jeśli spark.sql.ansi.enabled wartość ma wartość true, usługa Spark SQL będzie używać analizatora trybu ANSI. W tym trybie usługa Spark SQL ma dwa rodzaje słów kluczowych:

  • Zastrzeżone słowa kluczowe: słowa kluczowe zarezerwowane i nie mogą być używane jako identyfikatory dla tabeli, widoku, kolumny, funkcji, aliasu itp.
  • Słowa kluczowe inne niż zastrzeżone: słowa kluczowe, które mają specjalne znaczenie tylko w określonych kontekstach i mogą być używane jako identyfikatory w innych kontekstach. Na przykład EXPLAIN SELECT ... jest to polecenie, ale funkcja EXPLAIN może służyć jako identyfikatory w innych miejscach.

Gdy tryb ANSI jest wyłączony, usługa Spark SQL ma dwa rodzaje słów kluczowych:

  • Słowa kluczowe nieobstrzeżone: ta sama definicja co ta, gdy tryb ANSI jest włączony.
  • Słowa kluczowe typu strict-non-reserved: ścisła wersja słów kluczowych innych niż zastrzeżone, których nie można używać jako aliasu tabeli.

Domyślnie spark.sql.ansi.enabled jest to fałsz.

Poniżej znajduje się lista wszystkich słów kluczowych w usłudze Spark SQL.

Słowo kluczowe Tryb ANSI usługi Spark SQL Tryb domyślny spark SQL SQL-2016
ADD non-reserved non-reserved non-reserved
PO non-reserved non-reserved non-reserved
ALL Zastrzeżone non-reserved Zastrzeżone
ZMIENIANIE non-reserved non-reserved Zastrzeżone
ZAWSZE non-reserved non-reserved non-reserved
ANALIZA non-reserved non-reserved non-reserved
ORAZ Zastrzeżone non-reserved Zastrzeżone
ANTY non-reserved strict-non-reserved non-reserved
DOWOLNE Zastrzeżone non-reserved Zastrzeżone
ARCHIWUM non-reserved non-reserved non-reserved
TABLICY non-reserved non-reserved Zastrzeżone
AS Zastrzeżone non-reserved Zastrzeżone
ASC non-reserved non-reserved non-reserved
AT non-reserved non-reserved Zastrzeżone
AUTORYZACJI Zastrzeżone non-reserved Zastrzeżone
BETWEEN non-reserved non-reserved Zastrzeżone
ZARÓWNO Zastrzeżone non-reserved Zastrzeżone
WIADRO non-reserved non-reserved non-reserved
WIADRA non-reserved non-reserved non-reserved
BY non-reserved non-reserved Zastrzeżone
PAMIĘCI PODRĘCZNEJ non-reserved non-reserved non-reserved
KASKADOWO non-reserved non-reserved non-reserved
CASE Zastrzeżone non-reserved Zastrzeżone
CAST Zastrzeżone non-reserved Zastrzeżone
ZMIENIĆ non-reserved non-reserved non-reserved
SPRAWDZIĆ Zastrzeżone non-reserved Zastrzeżone
WYCZYŚĆ non-reserved non-reserved non-reserved
KLASTRA non-reserved non-reserved non-reserved
CLUSTERED non-reserved non-reserved non-reserved
CODEGEN non-reserved non-reserved non-reserved
COLLATE Zastrzeżone non-reserved Zastrzeżone
COLLECTION non-reserved non-reserved non-reserved
KOLUMNA Zastrzeżone non-reserved Zastrzeżone
KOLUMNY non-reserved non-reserved non-reserved
KOMENTARZ non-reserved non-reserved non-reserved
ZATWIERDZANIE non-reserved non-reserved Zastrzeżone
KOMPAKTOWY non-reserved non-reserved non-reserved
KOMPAKTOWANIE non-reserved non-reserved non-reserved
WYSTĄPIENIA OBLICZENIOWE non-reserved non-reserved non-reserved
ZŁĄCZYĆ non-reserved non-reserved non-reserved
OGRANICZENIE Zastrzeżone non-reserved Zastrzeżone
KOSZT non-reserved non-reserved non-reserved
CREATE Zastrzeżone non-reserved Zastrzeżone
KRZYŻ Zastrzeżone strict-non-reserved Zastrzeżone
MODUŁ non-reserved non-reserved Zastrzeżone
BIEŻĄCEGO non-reserved non-reserved Zastrzeżone
CURRENT_DATE Zastrzeżone non-reserved Zastrzeżone
CURRENT_TIME Zastrzeżone non-reserved Zastrzeżone
CURRENT_TIMESTAMP Zastrzeżone non-reserved Zastrzeżone
CURRENT_USER Zastrzeżone non-reserved Zastrzeżone
DANE non-reserved non-reserved non-reserved
BAZA DANYCH non-reserved non-reserved non-reserved
BAZY DANYCH non-reserved non-reserved non-reserved
DAY non-reserved non-reserved non-reserved
WŁAŚCIWOŚCI DB non-reserved non-reserved non-reserved
ZDEFINIOWANE non-reserved non-reserved non-reserved
DELETE non-reserved non-reserved Zastrzeżone
ROZDZIELANY non-reserved non-reserved non-reserved
DESC non-reserved non-reserved non-reserved
OPISAĆ non-reserved non-reserved Zastrzeżone
DFS non-reserved non-reserved non-reserved
KATALOGÓW non-reserved non-reserved non-reserved
KATALOG non-reserved non-reserved non-reserved
ODRĘBNE Zastrzeżone non-reserved Zastrzeżone
ROZPOWSZECHNIAĆ non-reserved non-reserved non-reserved
DIV non-reserved non-reserved nie jest słowem kluczowym
DROP non-reserved non-reserved Zastrzeżone
ELSE Zastrzeżone non-reserved Zastrzeżone
KONIEC Zastrzeżone non-reserved Zastrzeżone
UCIEC Zastrzeżone non-reserved Zastrzeżone
UCIEKŁ non-reserved non-reserved non-reserved
EXCEPT Zastrzeżone strict-non-reserved Zastrzeżone
EXCHANGE non-reserved non-reserved non-reserved
EXISTS non-reserved non-reserved Zastrzeżone
EXPLAIN non-reserved non-reserved non-reserved
EKSPORTU non-reserved non-reserved non-reserved
EXTENDED non-reserved non-reserved non-reserved
ZEWNĘTRZNYCH non-reserved non-reserved Zastrzeżone
WYODRĘBNIĆ non-reserved non-reserved Zastrzeżone
FAŁSZ Zastrzeżone non-reserved Zastrzeżone
POBRANIA Zastrzeżone non-reserved Zastrzeżone
POLA non-reserved non-reserved non-reserved
FILTRUJ Zastrzeżone non-reserved Zastrzeżone
FORMAT PLIKU non-reserved non-reserved non-reserved
FIRST non-reserved non-reserved non-reserved
FN non-reserved non-reserved non-reserved
NASTĘPUJĄCE non-reserved non-reserved non-reserved
FOR Zastrzeżone non-reserved Zastrzeżone
ZAGRANICZNYCH Zastrzeżone non-reserved Zastrzeżone
FORMACIE non-reserved non-reserved non-reserved
SFORMATOWANY non-reserved non-reserved non-reserved
FROM Zastrzeżone non-reserved Zastrzeżone
PEŁNE Zastrzeżone strict-non-reserved Zastrzeżone
FUNCTION non-reserved non-reserved Zastrzeżone
FUNKCJE non-reserved non-reserved non-reserved
GENEROWANE non-reserved non-reserved non-reserved
GLOBALNE non-reserved non-reserved Zastrzeżone
GRANT Zastrzeżone non-reserved Zastrzeżone
DOTACJE non-reserved non-reserved non-reserved
GRUPA Zastrzeżone non-reserved Zastrzeżone
GRUPOWANIE non-reserved non-reserved Zastrzeżone
HAVING Zastrzeżone non-reserved Zastrzeżone
GODZINY non-reserved non-reserved non-reserved
IF non-reserved non-reserved nie jest słowem kluczowym
IGNORE non-reserved non-reserved non-reserved
IMPORTU non-reserved non-reserved non-reserved
IN Zastrzeżone non-reserved Zastrzeżone
INDEKS non-reserved non-reserved non-reserved
INDEKSY non-reserved non-reserved non-reserved
WEWNĘTRZNY Zastrzeżone strict-non-reserved Zastrzeżone
INPATH non-reserved non-reserved non-reserved
INPUTFORMAT non-reserved non-reserved non-reserved
INSERT non-reserved non-reserved Zastrzeżone
INTERSECT Zastrzeżone strict-non-reserved Zastrzeżone
INTERWAŁ non-reserved non-reserved Zastrzeżone
INTO Zastrzeżone non-reserved Zastrzeżone
IS Zastrzeżone non-reserved Zastrzeżone
ELEMENTY non-reserved non-reserved non-reserved
JOIN Zastrzeżone strict-non-reserved Zastrzeżone
KEY non-reserved non-reserved non-reserved
KLUCZE non-reserved non-reserved non-reserved
LAST non-reserved non-reserved non-reserved
BOCZNE Zastrzeżone strict-non-reserved Zastrzeżone
LENIWY non-reserved non-reserved non-reserved
WIODĄCYCH Zastrzeżone non-reserved Zastrzeżone
LEFT Zastrzeżone strict-non-reserved Zastrzeżone
LIKE non-reserved non-reserved Zastrzeżone
ILIKE non-reserved non-reserved non-reserved
LIMIT non-reserved non-reserved non-reserved
LINIE non-reserved non-reserved non-reserved
LISTA non-reserved non-reserved non-reserved
OBCIĄŻENIA non-reserved non-reserved non-reserved
LOCAL non-reserved non-reserved Zastrzeżone
LOKALIZACJA non-reserved non-reserved non-reserved
BLOKADY non-reserved non-reserved non-reserved
BLOKAD non-reserved non-reserved non-reserved
LOGICZNE non-reserved non-reserved non-reserved
MACRO non-reserved non-reserved non-reserved
MAPĘ non-reserved non-reserved non-reserved
DOPASOWANE non-reserved non-reserved non-reserved
SCALANIA non-reserved non-reserved non-reserved
MINUTA non-reserved non-reserved non-reserved
MINUS non-reserved strict-non-reserved non-reserved
MONTH non-reserved non-reserved non-reserved
MSCK non-reserved non-reserved non-reserved
OBSZARU NAZW non-reserved non-reserved non-reserved
OBSZARY NAZW non-reserved non-reserved non-reserved
NATURALNE Zastrzeżone strict-non-reserved Zastrzeżone
NIE non-reserved non-reserved Zastrzeżone
NIE Zastrzeżone non-reserved Zastrzeżone
NULL Zastrzeżone non-reserved Zastrzeżone
NULL — Wartości non-reserved non-reserved non-reserved
OF non-reserved non-reserved Zastrzeżone
ON Zastrzeżone strict-non-reserved Zastrzeżone
TYLKO Zastrzeżone non-reserved Zastrzeżone
OPTION non-reserved non-reserved non-reserved
OPTIONS non-reserved non-reserved non-reserved
LUB Zastrzeżone non-reserved Zastrzeżone
ZAMÓWIENIA Zastrzeżone non-reserved Zastrzeżone
WYJŚCIE non-reserved non-reserved Zastrzeżone
ZEWNĘTRZNE Zastrzeżone non-reserved Zastrzeżone
FORMAT WYJŚCIOWY non-reserved non-reserved non-reserved
PONAD non-reserved non-reserved non-reserved
OVERLAPS Zastrzeżone non-reserved Zastrzeżone
NAKŁADKI non-reserved non-reserved non-reserved
ZASTĄPIĆ non-reserved non-reserved non-reserved
PARTYCJA non-reserved non-reserved Zastrzeżone
PARTYCJONOWANA non-reserved non-reserved non-reserved
PARTYCJE non-reserved non-reserved non-reserved
PROCENT non-reserved non-reserved non-reserved
PRZESTAWNE non-reserved non-reserved non-reserved
UMIESZCZENIE non-reserved non-reserved non-reserved
POZYCJI non-reserved non-reserved Zastrzeżone
POPRZEDNIM non-reserved non-reserved non-reserved
PODSTAWOWE Zastrzeżone non-reserved Zastrzeżone
PODMIOTÓW non-reserved non-reserved non-reserved
WŁAŚCIWOŚCI non-reserved non-reserved non-reserved
PURGE non-reserved non-reserved non-reserved
KWALIFIKUJĄ SIĘ Zastrzeżone non-reserved Zastrzeżone
ZAPYTANIE non-reserved non-reserved non-reserved
ZAKRES non-reserved non-reserved Zastrzeżone
ODBIORCY non-reserved non-reserved non-reserved
ADRESATÓW non-reserved non-reserved non-reserved
RECORDREADER non-reserved non-reserved non-reserved
AUTOR REKORDÓW non-reserved non-reserved non-reserved
ODZYSKAĆ non-reserved non-reserved non-reserved
ZMNIEJSZYĆ non-reserved non-reserved non-reserved
DOKUMENTACJA Zastrzeżone non-reserved Zastrzeżone
REFRESH non-reserved non-reserved non-reserved
REGEXP non-reserved non-reserved nie jest słowem kluczowym
USUŃ non-reserved non-reserved non-reserved
RENAME non-reserved non-reserved non-reserved
NAPRAWY non-reserved non-reserved non-reserved
REPLACE non-reserved non-reserved non-reserved
RESET non-reserved non-reserved non-reserved
SZACUNEK non-reserved non-reserved non-reserved
OGRANICZYĆ non-reserved non-reserved non-reserved
REVOKE non-reserved non-reserved Zastrzeżone
RIGHT Zastrzeżone strict-non-reserved Zastrzeżone
RLIKE non-reserved non-reserved non-reserved
ROLA non-reserved non-reserved non-reserved
RÓL non-reserved non-reserved non-reserved
WYCOFYWANIA non-reserved non-reserved Zastrzeżone
PAKIET ZBIORCZY non-reserved non-reserved Zastrzeżone
ROW non-reserved non-reserved Zastrzeżone
WIERSZE non-reserved non-reserved Zastrzeżone
SCHEMAT non-reserved non-reserved non-reserved
SCHEMATY non-reserved non-reserved nie jest słowem kluczowym
DRUGI non-reserved non-reserved non-reserved
SELECT Zastrzeżone non-reserved Zastrzeżone
PÓŁ non-reserved strict-non-reserved non-reserved
ODDZIELONE non-reserved non-reserved non-reserved
SERDE non-reserved non-reserved non-reserved
SERDEPROPERTIES non-reserved non-reserved non-reserved
SESSION_USER Zastrzeżone non-reserved Zastrzeżone
SET non-reserved non-reserved Zastrzeżone
USTAWIA non-reserved non-reserved non-reserved
UDOSTĘPNIJ non-reserved non-reserved non-reserved
UDZIAŁÓW non-reserved non-reserved non-reserved
POKAŻ non-reserved non-reserved non-reserved
WYPACZONE non-reserved non-reserved non-reserved
NIEKTÓRE Zastrzeżone non-reserved Zastrzeżone
SORTOWANIA non-reserved non-reserved non-reserved
SORTOWANE non-reserved non-reserved non-reserved
ROZPOCZNIJ non-reserved non-reserved Zastrzeżone
STATYSTYKI non-reserved non-reserved non-reserved
PRZECHOWYWANE non-reserved non-reserved non-reserved
STRATIFY non-reserved non-reserved non-reserved
STRUCT non-reserved non-reserved non-reserved
SUBSTR non-reserved non-reserved non-reserved
SUBSTRING non-reserved non-reserved non-reserved
SYNCHRONIZACJI non-reserved non-reserved non-reserved
TABELA Zastrzeżone non-reserved Zastrzeżone
TABELE non-reserved non-reserved non-reserved
TABLESAMPLE non-reserved non-reserved Zastrzeżone
TBLPROPERTIES non-reserved non-reserved non-reserved
Najwyższa temp non-reserved non-reserved nie jest słowem kluczowym
TYMCZASOWE non-reserved non-reserved non-reserved
ZAKOŃCZONE non-reserved non-reserved non-reserved
THEN Zastrzeżone non-reserved Zastrzeżone
TIME Zastrzeżone non-reserved Zastrzeżone
TO Zastrzeżone non-reserved Zastrzeżone
TOUCH non-reserved non-reserved non-reserved
KOŃCOWE Zastrzeżone non-reserved Zastrzeżone
TRANSAKCJA non-reserved non-reserved non-reserved
TRANSAKCJI non-reserved non-reserved non-reserved
PRZEKSZTAŁCIĆ non-reserved non-reserved non-reserved
TRIM non-reserved non-reserved non-reserved
PRAWDA non-reserved non-reserved Zastrzeżone
OBCIĄĆ non-reserved non-reserved Zastrzeżone
TRY_CAST non-reserved non-reserved non-reserved
TYP non-reserved non-reserved non-reserved
UNARCHIVE non-reserved non-reserved non-reserved
NIEOGRANICZONY non-reserved non-reserved non-reserved
UNCACHE non-reserved non-reserved non-reserved
UNION Zastrzeżone strict-non-reserved Zastrzeżone
UNIKATOWY Zastrzeżone non-reserved Zastrzeżone
NIEZNANY Zastrzeżone non-reserved Zastrzeżone
ODBLOKOWAĆ non-reserved non-reserved non-reserved
UNSET non-reserved non-reserved non-reserved
UPDATE non-reserved non-reserved Zastrzeżone
USE non-reserved non-reserved non-reserved
UŻYTKOWNIK Zastrzeżone non-reserved Zastrzeżone
USING Zastrzeżone strict-non-reserved Zastrzeżone
WARTOŚCI non-reserved non-reserved Zastrzeżone
WIDOK non-reserved non-reserved non-reserved
WIDOKI non-reserved non-reserved non-reserved
Kiedy… Zastrzeżone non-reserved Zastrzeżone
WHERE Zastrzeżone non-reserved Zastrzeżone
OKNO non-reserved non-reserved Zastrzeżone
WITH Zastrzeżone non-reserved Zastrzeżone
YEAR non-reserved non-reserved non-reserved
STREFY non-reserved non-reserved non-reserved