sqlglot.dialects.drill API documentation

Edit on GitHub

# sqlglot.dialects.drill

View Source

      1from __future__ import annotations
      2
      3import typing as t
      4
      5from sqlglot import exp, generator, parser, tokens, transforms
      6from sqlglot.dialects.dialect import (
      7    Dialect,
      8    create_with_partitions_sql,
      9    datestrtodate_sql,
     10    format_time_lambda,
     11    no_trycast_sql,
     12    rename_func,
     13    str_position_sql,
     14    timestrtotime_sql,
     15    ts_or_ds_to_date_sql,
     16)
     17
     18
     19def _date_add_sql(kind: str) -> t.Callable[[generator.Generator, exp.DateAdd | exp.DateSub], str]:
     20    def func(self: generator.Generator, expression: exp.DateAdd | exp.DateSub) -> str:
     21        this = self.sql(expression, "this")
     22        unit = exp.var(expression.text("unit").upper() or "DAY")
     23        return (
     24            f"DATE_{kind}({this}, {self.sql(exp.Interval(this=expression.expression, unit=unit))})"
     25        )
     26
     27    return func
     28
     29
     30def _str_to_date(self: generator.Generator, expression: exp.StrToDate) -> str:
     31    this = self.sql(expression, "this")
     32    time_format = self.format_time(expression)
     33    if time_format == Drill.DATE_FORMAT:
     34        return f"CAST({this} AS DATE)"
     35    return f"TO_DATE({this}, {time_format})"
     36
     37
     38class Drill(Dialect):
     39    NORMALIZE_FUNCTIONS: bool | str = False
     40    NULL_ORDERING = "nulls_are_last"
     41    DATE_FORMAT = "'yyyy-MM-dd'"
     42    DATEINT_FORMAT = "'yyyyMMdd'"
     43    TIME_FORMAT = "'yyyy-MM-dd HH:mm:ss'"
     44
     45    TIME_MAPPING = {
     46        "y": "%Y",
     47        "Y": "%Y",
     48        "YYYY": "%Y",
     49        "yyyy": "%Y",
     50        "YY": "%y",
     51        "yy": "%y",
     52        "MMMM": "%B",
     53        "MMM": "%b",
     54        "MM": "%m",
     55        "M": "%-m",
     56        "dd": "%d",
     57        "d": "%-d",
     58        "HH": "%H",
     59        "H": "%-H",
     60        "hh": "%I",
     61        "h": "%-I",
     62        "mm": "%M",
     63        "m": "%-M",
     64        "ss": "%S",
     65        "s": "%-S",
     66        "SSSSSS": "%f",
     67        "a": "%p",
     68        "DD": "%j",
     69        "D": "%-j",
     70        "E": "%a",
     71        "EE": "%a",
     72        "EEE": "%a",
     73        "EEEE": "%A",
     74        "''T''": "T",
     75    }
     76
     77    class Tokenizer(tokens.Tokenizer):
     78        QUOTES = ["'"]
     79        IDENTIFIERS = ["`"]
     80        STRING_ESCAPES = ["\\"]
     81        ENCODE = "utf-8"
     82
     83    class Parser(parser.Parser):
     84        STRICT_CAST = False
     85        CONCAT_NULL_OUTPUTS_STRING = True
     86
     87        FUNCTIONS = {
     88            **parser.Parser.FUNCTIONS,
     89            "DATE_FORMAT": format_time_lambda(exp.TimeToStr, "drill"),
     90            "TO_TIMESTAMP": exp.TimeStrToTime.from_arg_list,
     91            "TO_CHAR": format_time_lambda(exp.TimeToStr, "drill"),
     92        }
     93
     94        LOG_DEFAULTS_TO_LN = True
     95
     96    class Generator(generator.Generator):
     97        JOIN_HINTS = False
     98        TABLE_HINTS = False
     99
    100        TYPE_MAPPING = {
    101            **generator.Generator.TYPE_MAPPING,
    102            exp.DataType.Type.INT: "INTEGER",
    103            exp.DataType.Type.SMALLINT: "INTEGER",
    104            exp.DataType.Type.TINYINT: "INTEGER",
    105            exp.DataType.Type.BINARY: "VARBINARY",
    106            exp.DataType.Type.TEXT: "VARCHAR",
    107            exp.DataType.Type.NCHAR: "VARCHAR",
    108            exp.DataType.Type.TIMESTAMPLTZ: "TIMESTAMP",
    109            exp.DataType.Type.TIMESTAMPTZ: "TIMESTAMP",
    110            exp.DataType.Type.DATETIME: "TIMESTAMP",
    111        }
    112
    113        PROPERTIES_LOCATION = {
    114            **generator.Generator.PROPERTIES_LOCATION,
    115            exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
    116            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
    117        }
    118
    119        TRANSFORMS = {
    120            **generator.Generator.TRANSFORMS,
    121            exp.CurrentTimestamp: lambda *_: "CURRENT_TIMESTAMP",
    122            exp.ArrayContains: rename_func("REPEATED_CONTAINS"),
    123            exp.ArraySize: rename_func("REPEATED_COUNT"),
    124            exp.Create: create_with_partitions_sql,
    125            exp.DateAdd: _date_add_sql("ADD"),
    126            exp.DateStrToDate: datestrtodate_sql,
    127            exp.DateSub: _date_add_sql("SUB"),
    128            exp.DateToDi: lambda self, e: f"CAST(TO_DATE({self.sql(e, 'this')}, {Drill.DATEINT_FORMAT}) AS INT)",
    129            exp.DiToDate: lambda self, e: f"TO_DATE(CAST({self.sql(e, 'this')} AS VARCHAR), {Drill.DATEINT_FORMAT})",
    130            exp.If: lambda self, e: f"`IF`({self.format_args(e.this, e.args.get('true'), e.args.get('false'))})",
    131            exp.ILike: lambda self, e: f" {self.sql(e, 'this')} `ILIKE` {self.sql(e, 'expression')}",
    132            exp.Levenshtein: rename_func("LEVENSHTEIN_DISTANCE"),
    133            exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
    134            exp.RegexpLike: rename_func("REGEXP_MATCHES"),
    135            exp.StrPosition: str_position_sql,
    136            exp.StrToDate: _str_to_date,
    137            exp.Pow: rename_func("POW"),
    138            exp.Select: transforms.preprocess([transforms.eliminate_distinct_on]),
    139            exp.StrToTime: lambda self, e: f"TO_TIMESTAMP({self.sql(e, 'this')}, {self.format_time(e)})",
    140            exp.TimeStrToDate: lambda self, e: f"CAST({self.sql(e, 'this')} AS DATE)",
    141            exp.TimeStrToTime: timestrtotime_sql,
    142            exp.TimeStrToUnix: rename_func("UNIX_TIMESTAMP"),
    143            exp.TimeToStr: lambda self, e: f"TO_CHAR({self.sql(e, 'this')}, {self.format_time(e)})",
    144            exp.TimeToUnix: rename_func("UNIX_TIMESTAMP"),
    145            exp.ToChar: lambda self, e: self.function_fallback_sql(e),
    146            exp.TryCast: no_trycast_sql,
    147            exp.TsOrDsAdd: lambda self, e: f"DATE_ADD(CAST({self.sql(e, 'this')} AS DATE), {self.sql(exp.Interval(this=e.expression, unit=exp.var('DAY')))})",
    148            exp.TsOrDsToDate: ts_or_ds_to_date_sql("drill"),
    149            exp.TsOrDiToDi: lambda self, e: f"CAST(SUBSTR(REPLACE(CAST({self.sql(e, 'this')} AS VARCHAR), '-', ''), 1, 8) AS INT)",
    150        }
    151
    152        def normalize_func(self, name: str) -> str:
    153            return name if exp.SAFE_IDENTIFIER_RE.match(name) else f"`{name}`"

class Drill(sqlglot.dialects.dialect.Dialect): View Source

     39class Drill(Dialect):
     40    NORMALIZE_FUNCTIONS: bool | str = False
     41    NULL_ORDERING = "nulls_are_last"
     42    DATE_FORMAT = "'yyyy-MM-dd'"
     43    DATEINT_FORMAT = "'yyyyMMdd'"
     44    TIME_FORMAT = "'yyyy-MM-dd HH:mm:ss'"
     45
     46    TIME_MAPPING = {
     47        "y": "%Y",
     48        "Y": "%Y",
     49        "YYYY": "%Y",
     50        "yyyy": "%Y",
     51        "YY": "%y",
     52        "yy": "%y",
     53        "MMMM": "%B",
     54        "MMM": "%b",
     55        "MM": "%m",
     56        "M": "%-m",
     57        "dd": "%d",
     58        "d": "%-d",
     59        "HH": "%H",
     60        "H": "%-H",
     61        "hh": "%I",
     62        "h": "%-I",
     63        "mm": "%M",
     64        "m": "%-M",
     65        "ss": "%S",
     66        "s": "%-S",
     67        "SSSSSS": "%f",
     68        "a": "%p",
     69        "DD": "%j",
     70        "D": "%-j",
     71        "E": "%a",
     72        "EE": "%a",
     73        "EEE": "%a",
     74        "EEEE": "%A",
     75        "''T''": "T",
     76    }
     77
     78    class Tokenizer(tokens.Tokenizer):
     79        QUOTES = ["'"]
     80        IDENTIFIERS = ["`"]
     81        STRING_ESCAPES = ["\\"]
     82        ENCODE = "utf-8"
     83
     84    class Parser(parser.Parser):
     85        STRICT_CAST = False
     86        CONCAT_NULL_OUTPUTS_STRING = True
     87
     88        FUNCTIONS = {
     89            **parser.Parser.FUNCTIONS,
     90            "DATE_FORMAT": format_time_lambda(exp.TimeToStr, "drill"),
     91            "TO_TIMESTAMP": exp.TimeStrToTime.from_arg_list,
     92            "TO_CHAR": format_time_lambda(exp.TimeToStr, "drill"),
     93        }
     94
     95        LOG_DEFAULTS_TO_LN = True
     96
     97    class Generator(generator.Generator):
     98        JOIN_HINTS = False
     99        TABLE_HINTS = False
    100
    101        TYPE_MAPPING = {
    102            **generator.Generator.TYPE_MAPPING,
    103            exp.DataType.Type.INT: "INTEGER",
    104            exp.DataType.Type.SMALLINT: "INTEGER",
    105            exp.DataType.Type.TINYINT: "INTEGER",
    106            exp.DataType.Type.BINARY: "VARBINARY",
    107            exp.DataType.Type.TEXT: "VARCHAR",
    108            exp.DataType.Type.NCHAR: "VARCHAR",
    109            exp.DataType.Type.TIMESTAMPLTZ: "TIMESTAMP",
    110            exp.DataType.Type.TIMESTAMPTZ: "TIMESTAMP",
    111            exp.DataType.Type.DATETIME: "TIMESTAMP",
    112        }
    113
    114        PROPERTIES_LOCATION = {
    115            **generator.Generator.PROPERTIES_LOCATION,
    116            exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
    117            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
    118        }
    119
    120        TRANSFORMS = {
    121            **generator.Generator.TRANSFORMS,
    122            exp.CurrentTimestamp: lambda *_: "CURRENT_TIMESTAMP",
    123            exp.ArrayContains: rename_func("REPEATED_CONTAINS"),
    124            exp.ArraySize: rename_func("REPEATED_COUNT"),
    125            exp.Create: create_with_partitions_sql,
    126            exp.DateAdd: _date_add_sql("ADD"),
    127            exp.DateStrToDate: datestrtodate_sql,
    128            exp.DateSub: _date_add_sql("SUB"),
    129            exp.DateToDi: lambda self, e: f"CAST(TO_DATE({self.sql(e, 'this')}, {Drill.DATEINT_FORMAT}) AS INT)",
    130            exp.DiToDate: lambda self, e: f"TO_DATE(CAST({self.sql(e, 'this')} AS VARCHAR), {Drill.DATEINT_FORMAT})",
    131            exp.If: lambda self, e: f"`IF`({self.format_args(e.this, e.args.get('true'), e.args.get('false'))})",
    132            exp.ILike: lambda self, e: f" {self.sql(e, 'this')} `ILIKE` {self.sql(e, 'expression')}",
    133            exp.Levenshtein: rename_func("LEVENSHTEIN_DISTANCE"),
    134            exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
    135            exp.RegexpLike: rename_func("REGEXP_MATCHES"),
    136            exp.StrPosition: str_position_sql,
    137            exp.StrToDate: _str_to_date,
    138            exp.Pow: rename_func("POW"),
    139            exp.Select: transforms.preprocess([transforms.eliminate_distinct_on]),
    140            exp.StrToTime: lambda self, e: f"TO_TIMESTAMP({self.sql(e, 'this')}, {self.format_time(e)})",
    141            exp.TimeStrToDate: lambda self, e: f"CAST({self.sql(e, 'this')} AS DATE)",
    142            exp.TimeStrToTime: timestrtotime_sql,
    143            exp.TimeStrToUnix: rename_func("UNIX_TIMESTAMP"),
    144            exp.TimeToStr: lambda self, e: f"TO_CHAR({self.sql(e, 'this')}, {self.format_time(e)})",
    145            exp.TimeToUnix: rename_func("UNIX_TIMESTAMP"),
    146            exp.ToChar: lambda self, e: self.function_fallback_sql(e),
    147            exp.TryCast: no_trycast_sql,
    148            exp.TsOrDsAdd: lambda self, e: f"DATE_ADD(CAST({self.sql(e, 'this')} AS DATE), {self.sql(exp.Interval(this=e.expression, unit=exp.var('DAY')))})",
    149            exp.TsOrDsToDate: ts_or_ds_to_date_sql("drill"),
    150            exp.TsOrDiToDi: lambda self, e: f"CAST(SUBSTR(REPLACE(CAST({self.sql(e, 'this')} AS VARCHAR), '-', ''), 1, 8) AS INT)",
    151        }
    152
    153        def normalize_func(self, name: str) -> str:
    154            return name if exp.SAFE_IDENTIFIER_RE.match(name) else f"`{name}`"

##### Inherited Members

sqlglot.dialects.dialect.Dialect
  get_or_raise
  format_time
  normalize_identifier
  case_sensitive
  can_identify
  quote_identifier
  parse
  parse_into
  generate
  transpile
  tokenize
  parser
  generator

class Drill.Tokenizer(sqlglot.tokens.Tokenizer): View Source

    78    class Tokenizer(tokens.Tokenizer):
    79        QUOTES = ["'"]
    80        IDENTIFIERS = ["`"]
    81        STRING_ESCAPES = ["\\"]
    82        ENCODE = "utf-8"

##### Inherited Members

sqlglot.tokens.Tokenizer
  reset
  tokenize
  peek

class Drill.Parser(sqlglot.parser.Parser): View Source

    84    class Parser(parser.Parser):
    85        STRICT_CAST = False
    86        CONCAT_NULL_OUTPUTS_STRING = True
    87
    88        FUNCTIONS = {
    89            **parser.Parser.FUNCTIONS,
    90            "DATE_FORMAT": format_time_lambda(exp.TimeToStr, "drill"),
    91            "TO_TIMESTAMP": exp.TimeStrToTime.from_arg_list,
    92            "TO_CHAR": format_time_lambda(exp.TimeToStr, "drill"),
    93        }
    94
    95        LOG_DEFAULTS_TO_LN = True

Parser consumes a list of tokens produced by the Tokenizer and produces a parsed syntax tree.

###### Arguments:

- error_level: The desired error level. Default: ErrorLevel.IMMEDIATE
- error_message_context: Determines the amount of context to capture from a query string when displaying the error message (in number of characters). Default: 100
- max_errors: Maximum number of error messages to include in a raised ParseError. This is only relevant if error_level is ErrorLevel.RAISE. Default: 3

##### Inherited Members

sqlglot.parser.Parser
  Parser
  reset
  parse
  parse_into
  check_errors
  raise_error
  expression
  validate_expression

class Drill.Generator(sqlglot.generator.Generator): View Source

     97    class Generator(generator.Generator):
     98        JOIN_HINTS = False
     99        TABLE_HINTS = False
    100
    101        TYPE_MAPPING = {
    102            **generator.Generator.TYPE_MAPPING,
    103            exp.DataType.Type.INT: "INTEGER",
    104            exp.DataType.Type.SMALLINT: "INTEGER",
    105            exp.DataType.Type.TINYINT: "INTEGER",
    106            exp.DataType.Type.BINARY: "VARBINARY",
    107            exp.DataType.Type.TEXT: "VARCHAR",
    108            exp.DataType.Type.NCHAR: "VARCHAR",
    109            exp.DataType.Type.TIMESTAMPLTZ: "TIMESTAMP",
    110            exp.DataType.Type.TIMESTAMPTZ: "TIMESTAMP",
    111            exp.DataType.Type.DATETIME: "TIMESTAMP",
    112        }
    113
    114        PROPERTIES_LOCATION = {
    115            **generator.Generator.PROPERTIES_LOCATION,
    116            exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
    117            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
    118        }
    119
    120        TRANSFORMS = {
    121            **generator.Generator.TRANSFORMS,
    122            exp.CurrentTimestamp: lambda *_: "CURRENT_TIMESTAMP",
    123            exp.ArrayContains: rename_func("REPEATED_CONTAINS"),
    124            exp.ArraySize: rename_func("REPEATED_COUNT"),
    125            exp.Create: create_with_partitions_sql,
    126            exp.DateAdd: _date_add_sql("ADD"),
    127            exp.DateStrToDate: datestrtodate_sql,
    128            exp.DateSub: _date_add_sql("SUB"),
    129            exp.DateToDi: lambda self, e: f"CAST(TO_DATE({self.sql(e, 'this')}, {Drill.DATEINT_FORMAT}) AS INT)",
    130            exp.DiToDate: lambda self, e: f"TO_DATE(CAST({self.sql(e, 'this')} AS VARCHAR), {Drill.DATEINT_FORMAT})",
    131            exp.If: lambda self, e: f"`IF`({self.format_args(e.this, e.args.get('true'), e.args.get('false'))})",
    132            exp.ILike: lambda self, e: f" {self.sql(e, 'this')} `ILIKE` {self.sql(e, 'expression')}",
    133            exp.Levenshtein: rename_func("LEVENSHTEIN_DISTANCE"),
    134            exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
    135            exp.RegexpLike: rename_func("REGEXP_MATCHES"),
    136            exp.StrPosition: str_position_sql,
    137            exp.StrToDate: _str_to_date,
    138            exp.Pow: rename_func("POW"),
    139            exp.Select: transforms.preprocess([transforms.eliminate_distinct_on]),
    140            exp.StrToTime: lambda self, e: f"TO_TIMESTAMP({self.sql(e, 'this')}, {self.format_time(e)})",
    141            exp.TimeStrToDate: lambda self, e: f"CAST({self.sql(e, 'this')} AS DATE)",
    142            exp.TimeStrToTime: timestrtotime_sql,
    143            exp.TimeStrToUnix: rename_func("UNIX_TIMESTAMP"),
    144            exp.TimeToStr: lambda self, e: f"TO_CHAR({self.sql(e, 'this')}, {self.format_time(e)})",
    145            exp.TimeToUnix: rename_func("UNIX_TIMESTAMP"),
    146            exp.ToChar: lambda self, e: self.function_fallback_sql(e),
    147            exp.TryCast: no_trycast_sql,
    148            exp.TsOrDsAdd: lambda self, e: f"DATE_ADD(CAST({self.sql(e, 'this')} AS DATE), {self.sql(exp.Interval(this=e.expression, unit=exp.var('DAY')))})",
    149            exp.TsOrDsToDate: ts_or_ds_to_date_sql("drill"),
    150            exp.TsOrDiToDi: lambda self, e: f"CAST(SUBSTR(REPLACE(CAST({self.sql(e, 'this')} AS VARCHAR), '-', ''), 1, 8) AS INT)",
    151        }
    152
    153        def normalize_func(self, name: str) -> str:
    154            return name if exp.SAFE_IDENTIFIER_RE.match(name) else f"`{name}`"

Generator converts a given syntax tree to the corresponding SQL string.

###### Arguments:

- pretty: Whether or not to format the produced SQL string. Default: False.
- identify: Determines when an identifier should be quoted. Possible values are: False (default): Never quote, except in cases where it's mandatory by the dialect. True or 'always': Always quote. 'safe': Only quote identifiers that are case insensitive.
- normalize: Whether or not to normalize identifiers to lowercase. Default: False.
- pad: Determines the pad size in a formatted string. Default: 2.
- indent: Determines the indentation size in a formatted string. Default: 2.
- normalize_functions: Whether or not to normalize all function names. Possible values are: "upper" or True (default): Convert names to uppercase. "lower": Convert names to lowercase. False: Disables function name normalization.
- unsupported_level: Determines the generator's behavior when it encounters unsupported expressions. Default ErrorLevel.WARN.
- max_unsupported: Maximum number of unsupported messages to include in a raised UnsupportedError. This is only relevant if unsupported_level is ErrorLevel.RAISE. Default: 3
- leading_comma: Determines whether or not the comma is leading or trailing in select expressions. This is only relevant when generating in pretty mode. Default: False
- max_text_width: The max number of characters in a segment before creating new lines in pretty mode. The default is on the smaller end because the length only represents a segment and not the true line length. Default: 80
- comments: Whether or not to preserve comments in the output SQL code. Default: True

def normalize_func(self, name: str) -> str: View Source

    153        def normalize_func(self, name: str) -> str:
    154            return name if exp.SAFE_IDENTIFIER_RE.match(name) else f"`{name}`"

@classmethod
def can_identify(text: str, identify: str | bool = 'safe') -> bool: View Source

    247    @classmethod
    248    def can_identify(cls, text: str, identify: str | bool = "safe") -> bool:
    249        """Checks if text can be identified given an identify option.
    250
    251        Args:
    252            text: The text to check.
    253            identify:
    254                "always" or `True`: Always returns true.
    255                "safe": True if the identifier is case-insensitive.
    256
    257        Returns:
    258            Whether or not the given text can be identified.
    259        """
    260        if identify is True or identify == "always":
    261            return True
    262
    263        if identify == "safe":
    264            return not cls.case_sensitive(text)
    265
    266        return False

Checks if text can be identified given an identify option.

###### Arguments:

- text: The text to check.
- identify: "always" or `True`: Always returns true. "safe": True if the identifier is case-insensitive.

###### Returns:

> Whether or not the given text can be identified.

##### Inherited Members

sqlglot.generator.Generator
  Generator
  generate
  unsupported
  sep
  seg
  pad_comment
  maybe_comment
  wrap
  no_identify
  indent
  sql
  uncache_sql
  cache_sql
  characterset_sql
  column_sql
  columnposition_sql
  columndef_sql
  columnconstraint_sql
  autoincrementcolumnconstraint_sql
  compresscolumnconstraint_sql
  generatedasidentitycolumnconstraint_sql
  notnullcolumnconstraint_sql
  primarykeycolumnconstraint_sql
  uniquecolumnconstraint_sql
  createable_sql
  create_sql
  clone_sql
  describe_sql
  prepend_ctes
  with_sql
  cte_sql
  tablealias_sql
  bitstring_sql
  hexstring_sql
  bytestring_sql
  rawstring_sql
  datatypesize_sql
  datatype_sql
  directory_sql
  delete_sql
  drop_sql
  except_sql
  except_op
  fetch_sql
  filter_sql
  hint_sql
  index_sql
  identifier_sql
  inputoutputformat_sql
  national_sql
  partition_sql
  properties_sql
  root_properties
  properties
  with_properties
  locate_properties
  property_sql
  likeproperty_sql
  fallbackproperty_sql
  journalproperty_sql
  freespaceproperty_sql
  checksumproperty_sql
  mergeblockratioproperty_sql
  datablocksizeproperty_sql
  blockcompressionproperty_sql
  isolatedloadingproperty_sql
  lockingproperty_sql
  withdataproperty_sql
  insert_sql
  intersect_sql
  intersect_op
  introducer_sql
  pseudotype_sql
  onconflict_sql
  returning_sql
  rowformatdelimitedproperty_sql
  table_sql
  tablesample_sql
  pivot_sql
  tuple_sql
  update_sql
  values_sql
  var_sql
  into_sql
  from_sql
  group_sql
  having_sql
  join_sql
  lambda_sql
  lateral_sql
  limit_sql
  offset_sql
  setitem_sql
  set_sql
  pragma_sql
  lock_sql
  literal_sql
  escape_str
  loaddata_sql
  null_sql
  boolean_sql
  order_sql
  cluster_sql
  distribute_sql
  sort_sql
  ordered_sql
  matchrecognize_sql
  query_modifiers
  offset_limit_modifiers
  after_having_modifiers
  after_limit_modifiers
  select_sql
  schema_sql
  schema_columns_sql
  star_sql
  parameter_sql
  sessionparameter_sql
  placeholder_sql
  subquery_sql
  qualify_sql
  union_sql
  union_op
  unnest_sql
  where_sql
  window_sql
  partition_by_sql
  windowspec_sql
  withingroup_sql
  between_sql
  bracket_sql
  all_sql
  any_sql
  exists_sql
  case_sql
  constraint_sql
  nextvaluefor_sql
  extract_sql
  trim_sql
  safeconcat_sql
  check_sql
  foreignkey_sql
  primarykey_sql
  if_sql
  matchagainst_sql
  jsonkeyvalue_sql
  jsonobject_sql
  openjsoncolumndef_sql
  openjson_sql
  in_sql
  in_unnest_op
  interval_sql
  return_sql
  reference_sql
  anonymous_sql
  paren_sql
  neg_sql
  not_sql
  alias_sql
  aliases_sql
  attimezone_sql
  add_sql
  and_sql
  connector_sql
  bitwiseand_sql
  bitwiseleftshift_sql
  bitwisenot_sql
  bitwiseor_sql
  bitwiserightshift_sql
  bitwisexor_sql
  cast_sql
  currentdate_sql
  collate_sql
  command_sql
  comment_sql
  mergetreettlaction_sql
  mergetreettl_sql
  transaction_sql
  commit_sql
  rollback_sql
  altercolumn_sql
  renametable_sql
  altertable_sql
  droppartition_sql
  addconstraint_sql
  distinct_sql
  ignorenulls_sql
  respectnulls_sql
  intdiv_sql
  dpipe_sql
  safedpipe_sql
  div_sql
  overlaps_sql
  distance_sql
  dot_sql
  eq_sql
  escape_sql
  glob_sql
  gt_sql
  gte_sql
  ilike_sql
  ilikeany_sql
  is_sql
  like_sql
  likeany_sql
  similarto_sql
  lt_sql
  lte_sql
  mod_sql
  mul_sql
  neq_sql
  nullsafeeq_sql
  nullsafeneq_sql
  or_sql
  slice_sql
  sub_sql
  trycast_sql
  use_sql
  binary
  function_fallback_sql
  func
  format_args
  text_width
  format_time
  expressions
  op_expressions
  naked_property
  set_operation
  tag_sql
  token_sql
  userdefinedfunction_sql
  joinhint_sql
  kwarg_sql
  when_sql
  merge_sql
  tochar_sql
  dictproperty_sql
  dictrange_sql
  dictsubproperty_sql
  oncluster_sql