# -*- coding: utf-8 -*-
"""Constants for PyAthena SQLAlchemy dialect."""

from __future__ import annotations

from typing import Set

# https://docs.aws.amazon.com/athena/latest/ug/reserved-words.html#list-of-ddl-reserved-words
DDL_RESERVED_WORDS: Set[str] = {
    "all",
    "alter",
    "and",
    "array",
    "as",
    "authorization",
    "between",
    "bigint",
    "binary",
    "boolean",
    "both",
    "by",
    "case",
    "cashe",
    "cast",
    "char",
    "column",
    "commit",
    "conf",
    "constraint",
    "create",
    "cross",
    "cube",
    "current",
    "current_date",
    "current_timestamp",
    "cursor",
    "database",
    "date",
    "dayofweek",
    "decimal",
    "delete",
    "describe",
    "distinct",
    "double",
    "drop",
    "else",
    "end",
    "exchange",
    "exists",
    "extended",
    "external",
    "extract",
    "false",
    "fetch",
    "float",
    "floor",
    "following",
    "for",
    "foreign",
    "from",
    "full",
    "function",
    "grant",
    "group",
    "grouping",
    "having",
    "if",
    "import",
    "in",
    "inner",
    "insert",
    "int",
    "integer",
    "intersect",
    "interval",
    "into",
    "is",
    "join",
    "lateral",
    "left",
    "less",
    "like",
    "local",
    "macro",
    "map",
    "more",
    "none",
    "not",
    "null",
    "numeric",
    "of",
    "on",
    "only",
    "or",
    "order",
    "out",
    "outer",
    "over",
    "partialscan",
    "partition",
    "percent",
    "preceding",
    "precision",
    "preserve",
    "primary",
    "procedure",
    "range",
    "reads",
    "reduce",
    "references",
    "regexp",
    "revoke",
    "right",
    "rlike",
    "rollback",
    "rollup",
    "row",
    "rows",
    "select",
    "set",
    "smallint",
    "start",
    "table",
    "tablesample",
    "then",
    "time",
    "timestamp",
    "to",
    "transform",
    "trigger",
    "true",
    "truncate",
    "unbounded",
    "union",
    "uniquejoin",
    "update",
    "user",
    "using",
    "utc_timestamp",
    "values",
    "varchar",
    "views",
    "when",
    "where",
    "window",
    "with",
}

# https://docs.aws.amazon.com/athena/latest/ug/reserved-words.html#list-of-reserved-words-sql-select
SELECT_STATEMENT_RESERVED_WORDS: Set[str] = {
    "all",
    "and",
    "any",
    "array",
    "as",
    "asc",
    "at",
    "bernoulli",
    "between",
    "both",
    "by",
    "call",
    "cascade",
    "case",
    "cast",
    "column",
    "constraint",
    "contains",
    "corresponding",
    "create",
    "cross",
    "cube",
    "current",
    "current_catalog",
    "current_date",
    "current_path",
    "current_role",
    "current_schema",
    "current_time",
    "current_timestamp",
    "current_user",
    "deallocate",
    "delete",
    "desc",
    "describe",
    "distinct",
    "drop",
    "element",
    "else",
    "end",
    "escape",
    "every",
    "except",
    "exec",
    "execute",
    "exists",
    "extract",
    "false",
    "first",
    "for",
    "from",
    "full",
    "group",
    "grouping",
    "having",
    "in",
    "inner",
    "insert",
    "intersect",
    "into",
    "is",
    "join",
    "last",
    "lateral",
    "leading",
    "left",
    "like",
    "localtime",
    "localtimestamp",
    "natural",
    "normalize",
    "not",
    "null",
    "nullif",
    "on",
    "only",
    "or",
    "order",
    "ordinality",
    "outer",
    "overlaps",
    "partition",
    "position",
    "prepare",
    "range",
    "recursive",
    "right",
    "rollup",
    "row",
    "rows",
    "select",
    "some",
    "system",
    "table",
    "tablesample",
    "then",
    "trailing",
    "true",
    "uescape",
    "unbounded",
    "union",
    "unnest",
    "using",
    "values",
    "when",
    "where",
    "window",
    "with",
}

RESERVED_WORDS: Set[str] = set(DDL_RESERVED_WORDS | SELECT_STATEMENT_RESERVED_WORDS)
