Edit on GitHub

sqlglot.dialects.materialize

 1from __future__ import annotations
 2
 3from sqlglot.dialects.postgres import Postgres
 4from sqlglot.generators.materialize import MaterializeGenerator
 5from sqlglot.parsers.materialize import MaterializeParser
 6
 7
 8class Materialize(Postgres):
 9    Parser = MaterializeParser
10
11    Generator = MaterializeGenerator
class Materialize(sqlglot.dialects.postgres.Postgres):
 9class Materialize(Postgres):
10    Parser = MaterializeParser
11
12    Generator = MaterializeGenerator
SUPPORTS_COLUMN_JOIN_MARKS = False

Whether the old-style outer join (+) syntax is supported.

STRINGS_SUPPORT_ESCAPED_SEQUENCES: bool = False

Whether string literals support escape sequences (e.g. \n). Set by the metaclass based on the tokenizer's STRING_ESCAPES.

BYTE_STRINGS_SUPPORT_ESCAPED_SEQUENCES: bool = False

Whether byte string literals support escape sequences. Set by the metaclass based on the tokenizer's BYTE_STRING_ESCAPES.

INITCAP_SUPPORTS_CUSTOM_DELIMITERS = False
tokenizer_class = <class 'sqlglot.dialects.dialect.Tokenizer'>
jsonpath_tokenizer_class = <class 'sqlglot.dialects.dialect.JSONPathTokenizer'>
TIME_TRIE: dict = {'d': {0: True, 'd': {0: True, 'd': {0: True}}, 'a': {'y': {0: True}}, 'y': {0: True}}, 'D': {0: True, 'D': {0: True, 'D': {0: True}}}, 'F': {'M': {'D': {'D': {0: True, 'D': {0: True}}}, 'H': {'H': {'1': {'2': {0: True}}, '2': {'4': {0: True}}}}, 'M': {'I': {0: True}, 'M': {0: True}}, 'S': {'S': {0: True}}}}, 'H': {'H': {'1': {'2': {0: True}}, '2': {'4': {0: True}}}}, 'm': {'i': {0: True}, 'm': {0: True}}, 'M': {'I': {0: True}, 'M': {0: True}}, 'O': {'F': {0: True}}, 's': {'s': {0: True}}, 'S': {'S': {0: True}}, 'T': {'M': {'D': {'a': {'y': {0: True}}, 'y': {0: True}}, 'M': {'o': {'n': {0: True, 't': {'h': {0: True}}}}}}, 'Z': {0: True}}, 'U': {'S': {0: True}}, 'w': {'w': {0: True}}, 'W': {'W': {0: True}}, 'y': {'y': {0: True, 'y': {0: True, 'y': {0: True}}}}, 'Y': {'Y': {0: True, 'Y': {0: True, 'Y': {0: True}}}}}
FORMAT_TRIE: dict = {'d': {0: True, 'd': {0: True, 'd': {0: True}}, 'a': {'y': {0: True}}, 'y': {0: True}}, 'D': {0: True, 'D': {0: True, 'D': {0: True}}}, 'F': {'M': {'D': {'D': {0: True, 'D': {0: True}}}, 'H': {'H': {'1': {'2': {0: True}}, '2': {'4': {0: True}}}}, 'M': {'I': {0: True}, 'M': {0: True}}, 'S': {'S': {0: True}}}}, 'H': {'H': {'1': {'2': {0: True}}, '2': {'4': {0: True}}}}, 'm': {'i': {0: True}, 'm': {0: True}}, 'M': {'I': {0: True}, 'M': {0: True}}, 'O': {'F': {0: True}}, 's': {'s': {0: True}}, 'S': {'S': {0: True}}, 'T': {'M': {'D': {'a': {'y': {0: True}}, 'y': {0: True}}, 'M': {'o': {'n': {0: True, 't': {'h': {0: True}}}}}}, 'Z': {0: True}}, 'U': {'S': {0: True}}, 'w': {'w': {0: True}}, 'W': {'W': {0: True}}, 'y': {'y': {0: True, 'y': {0: True, 'y': {0: True}}}}, 'Y': {'Y': {0: True, 'Y': {0: True, 'Y': {0: True}}}}}
INVERSE_TIME_MAPPING: dict[str, str] = {'%u': 'D', '%d': 'DD', '%j': 'DDD', '%-d': 'FMDD', '%-j': 'FMDDD', '%-I': 'FMHH12', '%-H': 'FMHH24', '%-M': 'FMMI', '%-m': 'FMMM', '%-S': 'FMSS', '%I': 'HH12', '%H': 'HH24', '%M': 'MI', '%m': 'MM', '%z': 'OF', '%S': 'SS', '%A': 'TMDay', '%a': 'TMDy', '%b': 'TMMon', '%B': 'TMMonth', '%Aenlower': 'day', '%aenlower': 'dy', '%Z': 'TZ', '%f': 'US', '%U': 'WW', '%y': 'YY', '%Ythree': 'YYY', '%Y': 'YYYY', '%mstrict': 'MM', '%dstrict': 'DD'}
INVERSE_TIME_TRIE: dict = {'%': {'u': {0: True}, 'd': {0: True, 's': {'t': {'r': {'i': {'c': {'t': {0: True}}}}}}}, 'j': {0: True}, '-': {'d': {0: True}, 'j': {0: True}, 'I': {0: True}, 'H': {0: True}, 'M': {0: True}, 'm': {0: True}, 'S': {0: True}}, 'I': {0: True}, 'H': {0: True}, 'M': {0: True}, 'm': {0: True, 's': {'t': {'r': {'i': {'c': {'t': {0: True}}}}}}}, 'z': {0: True}, 'S': {0: True}, 'A': {0: True, 'e': {'n': {'l': {'o': {'w': {'e': {'r': {0: True}}}}}}}}, 'a': {0: True, 'e': {'n': {'l': {'o': {'w': {'e': {'r': {0: True}}}}}}}}, 'b': {0: True}, 'B': {0: True}, 'Z': {0: True}, 'f': {0: True}, 'U': {0: True}, 'y': {0: True}, 'Y': {'t': {'h': {'r': {'e': {'e': {0: True}}}}}, 0: True}}}
INVERSE_FORMAT_MAPPING: dict[str, str] = {'%mstrict': '%m', '%dstrict': '%d'}
INVERSE_FORMAT_TRIE: dict = {'%': {'m': {'s': {'t': {'r': {'i': {'c': {'t': {0: True}}}}}}}, 'd': {'s': {'t': {'r': {'i': {'c': {'t': {0: True}}}}}}}}}
INVERSE_CREATABLE_KIND_MAPPING: dict[str, str] = {}
ESCAPED_SEQUENCES: dict[str, str] = {'\x07': '\\a', '\x08': '\\b', '\x0c': '\\f', '\n': '\\n', '\r': '\\r', '\t': '\\t', '\x0b': '\\v', '\\': '\\\\'}
QUOTE_START = "'"
QUOTE_END = "'"
IDENTIFIER_START = '"'
IDENTIFIER_END = '"'
VALID_INTERVAL_UNITS: set[str] = {'MINUTE', 'Q', 'WEEKDAY', 'MS', 'MSEC', 'DECS', 'MSECONDS', 'DW', 'DAY OF YEAR', 'DAYOFWEEK_ISO', 'DD', 'MSECS', 'TIMEZONE_HOUR', 'WK', 'NSECONDS', 'SECONDS', 'QTR', 'QUARTERS', 'YEARS', 'DAYS', 'WEEKDAY_ISO', 'EPOCH_NANOSECONDS', 'WEEK', 'DECADE', 'MON', 'CENT', 'MILLISECONDS', 'NS', 'D', 'DAY', 'MILLISECON', 'WEEKOFYEAR_ISO', 'CENTURIES', 'NSEC', 'EPOCH_MILLISECOND', 'DAYOFWEEK', 'MONS', 'H', 'HOURS', 'SEC', 'HRS', 'MILLISECS', 'EPOCH', 'S', 'NSECOND', 'DECADES', 'MINUTES', 'EPOCH_MILLISECONDS', 'CENTURY', 'TZH', 'WOY', 'HH', 'SECS', 'USECOND', 'QTRS', 'DW_ISO', 'DEC', 'DAYOFYEAR', 'EPOCH_NANOSECOND', 'YEAR', 'MIL', 'MONTHS', 'MINS', 'MONTH', 'DOW_ISO', 'YRS', 'MICROSECONDS', 'M', 'EPOCH_SECONDS', 'HOUR', 'HR', 'MI', 'DAYOFMONTH', 'YYYY', 'DOY', 'TZM', 'MM', 'W', 'DOW', 'WEEKOFYEAR', 'EPOCH_SECOND', 'NANOSECS', 'US', 'MILLENIA', 'TIMEZONE_MINUTE', 'EPOCH_MICROSECOND', 'WEEK_ISO', 'WEEKOFYEARISO', 'DAY OF WEEK', 'MILLISECOND', 'MILLENNIUM', 'MILS', 'YY', 'MIN', 'USECONDS', 'MICROSECS', 'QUARTER', 'USEC', 'USECS', 'SECOND', 'NANOSECOND', 'C', 'CENTS', 'WEEKISO', 'MICROSEC', 'MICROSECOND', 'Y', 'YYY', 'MILLISEC', 'MSECOND', 'WY', 'DY', 'DAYOFWEEKISO', 'NANOSEC', 'EPOCH_MICROSECONDS', 'YR'}
BIT_START: str | None = "b'"
BIT_END: str | None = "'"
HEX_START: str | None = "x'"
HEX_END: str | None = "'"
BYTE_START: str | None = "e'"
BYTE_END: str | None = "'"
UNICODE_START: str | None = "U&'"
UNICODE_END: str | None = "'"