sqlglot.dialects.doris
1from __future__ import annotations 2 3from sqlglot.dialects.mysql import MySQL 4from sqlglot.generators.doris import DorisGenerator 5from sqlglot.parsers.doris import DorisParser 6 7 8class Doris(MySQL): 9 DATE_FORMAT = "'yyyy-MM-dd'" 10 DATEINT_FORMAT = "'yyyyMMdd'" 11 TIME_FORMAT = "'yyyy-MM-dd HH:mm:ss'" 12 13 Parser = DorisParser 14 15 Generator = DorisGenerator
9class Doris(MySQL): 10 DATE_FORMAT = "'yyyy-MM-dd'" 11 DATEINT_FORMAT = "'yyyyMMdd'" 12 TIME_FORMAT = "'yyyy-MM-dd HH:mm:ss'" 13 14 Parser = DorisParser 15 16 Generator = DorisGenerator
Parser =
<class 'sqlglot.parsers.doris.DorisParser'>
Generator =
<class 'sqlglot.generators.doris.DorisGenerator'>
VALID_INTERVAL_UNITS: set[str] =
{'QTRS', 'TZH', 'HR', 'DAYS', 'DAY_SECOND', 'DAY_MICROSECOND', 'US', 'NSEC', 'MICROSECS', 'WK', 'NSECOND', 'MSECONDS', 'WOY', 'MINUTE', 'WEEKDAY', 'MILLISEC', 'MILLISECS', 'MONS', 'MONTHS', 'NSECONDS', 'USECS', 'Y', 'YEAR', 'DAY_MINUTE', 'DAYOFWEEK', 'SECONDS', 'QTR', 'YYYY', 'MILLISECONDS', 'DECADE', 'MM', 'MSECS', 'HOUR', 'DAYOFWEEK_ISO', 'MICROSEC', 'MINUTE_MICROSECOND', 'CENTS', 'MS', 'DAYOFWEEKISO', 'MICROSECONDS', 'MILLISECOND', 'USECONDS', 'SECS', 'EPOCH_NANOSECONDS', 'SECOND_MICROSECOND', 'QUARTER', 'USEC', 'HH', 'YRS', 'WEEK', 'HOUR_MICROSECOND', 'EPOCH_MICROSECOND', 'DECADES', 'WEEKOFYEAR', 'WY', 'NANOSECOND', 'DOW', 'SECOND', 'SEC', 'DAY_HOUR', 'MIL', 'CENTURY', 'HRS', 'DAYOFYEAR', 'YY', 'NANOSEC', 'NANOSECS', 'MINUTE_SECOND', 'YEAR_MONTH', 'M', 'WEEKOFYEARISO', 'YEARS', 'Q', 'MILLENNIUM', 'WEEKISO', 'DAY OF WEEK', 'WEEK_ISO', 'MILS', 'MINS', 'NS', 'W', 'EPOCH', 'D', 'DAYOFMONTH', 'DAY', 'MILLISECON', 'CENTURIES', 'S', 'QUARTERS', 'WEEKDAY_ISO', 'WEEKOFYEAR_ISO', 'DEC', 'DW_ISO', 'DY', 'C', 'MONTH', 'YR', 'DW', 'YYY', 'EPOCH_SECOND', 'MIN', 'DD', 'DOW_ISO', 'MI', 'EPOCH_MICROSECONDS', 'MSEC', 'DAY OF YEAR', 'TZM', 'MINUTES', 'MON', 'MSECOND', 'DOY', 'EPOCH_MILLISECONDS', 'MILLENIA', 'EPOCH_NANOSECOND', 'EPOCH_MILLISECOND', 'MICROSECOND', 'EPOCH_SECONDS', 'HOUR_SECOND', 'TIMEZONE_HOUR', 'H', 'HOURS', 'TIMEZONE_MINUTE', 'HOUR_MINUTE', 'CENT', 'DECS', 'USECOND'}
UNESCAPED_SEQUENCES: dict[str, str] =
{'\\a': '\x07', '\\b': '\x08', '\\f': '\x0c', '\\n': '\n', '\\r': '\r', '\\t': '\t', '\\v': '\x0b', '\\\\': '\\'}
Mapping of an escaped sequence (\n) to its unescaped version (
).
STRINGS_SUPPORT_ESCAPED_SEQUENCES: bool =
True
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 =
True
Whether byte string literals support escape sequences. Set by the metaclass based on the tokenizer's BYTE_STRING_ESCAPES.
parser_class =
<class 'sqlglot.parsers.doris.DorisParser'>
generator_class =
<class 'sqlglot.generators.doris.DorisGenerator'>
TIME_TRIE: dict =
{'%': {'M': {0: True}, 'c': {0: True}, 'e': {0: True}, 'h': {0: True}, 'i': {0: True}, 's': {0: True}, 'u': {0: True}, 'k': {0: True}, 'l': {0: True}, 'T': {0: True}, 'W': {0: True}}}
FORMAT_TRIE: dict =
{'%': {'M': {0: True}, 'c': {0: True}, 'e': {0: True}, 'h': {0: True}, 'i': {0: True}, 's': {0: True}, 'u': {0: True}, 'k': {0: True}, 'l': {0: True}, 'T': {0: True}, 'W': {0: True}}}
INVERSE_TIME_MAPPING: dict[str, str] =
{'%B': '%M', '%-m': '%c', '%-d': '%e', '%I': '%h', '%M': '%i', '%S': '%s', '%W': '%u', '%-H': '%k', '%-I': '%l', '%H:%M:%S': '%T', '%A': '%W'}
INVERSE_TIME_TRIE: dict =
{'%': {'B': {0: True}, '-': {'m': {0: True}, 'd': {0: True}, 'H': {0: True}, 'I': {0: True}}, 'I': {0: True}, 'M': {0: True}, 'S': {0: True}, 'W': {0: True}, 'H': {':': {'%': {'M': {':': {'%': {'S': {0: True}}}}}}}, 'A': {0: True}}}
ESCAPED_SEQUENCES: dict[str, str] =
{'\x07': '\\a', '\x08': '\\b', '\x0c': '\\f', '\n': '\\n', '\r': '\\r', '\t': '\\t', '\x0b': '\\v', '\\': '\\\\'}