Edit on GitHub

sqlglot expressions properties.

  1"""sqlglot expressions properties."""
  2
  3from __future__ import annotations
  4
  5import typing as t
  6from enum import auto
  7
  8from sqlglot.expressions.core import ColumnConstraintKind, Expression, Literal, convert
  9from sqlglot.helper import AutoName
 10
 11
 12class Property(Expression):
 13    arg_types = {"this": True, "value": True}
 14
 15
 16class GrantPrivilege(Expression):
 17    arg_types = {"this": True, "expressions": False}
 18
 19
 20class GrantPrincipal(Expression):
 21    arg_types = {"this": True, "kind": False}
 22
 23
 24class AllowedValuesProperty(Expression):
 25    arg_types = {"expressions": True}
 26
 27
 28class AggregateKeyProperty(Property):
 29    arg_types = {"expressions": True}
 30
 31
 32class AlgorithmProperty(Property):
 33    arg_types = {"this": True}
 34
 35
 36class ApiProperty(Property):
 37    arg_types = {}
 38
 39
 40class ApplicationProperty(Property):
 41    arg_types = {}
 42
 43
 44class AutoIncrementProperty(Property):
 45    arg_types = {"this": True}
 46
 47
 48class AutoRefreshProperty(Property):
 49    arg_types = {
 50        "this": False,
 51        "cadence": False,
 52        "offset": False,
 53        "randomize": False,
 54        "expressions": False,
 55        "settings": False,
 56        "append": False,
 57    }
 58
 59
 60class BackupProperty(Property):
 61    arg_types = {"this": True}
 62
 63
 64class BuildProperty(Property):
 65    arg_types = {"this": True}
 66
 67
 68class BlockCompressionProperty(Property):
 69    arg_types = {
 70        "autotemp": False,
 71        "always": False,
 72        "default": False,
 73        "manual": False,
 74        "never": False,
 75    }
 76
 77
 78class CalledOnNullInputProperty(Property):
 79    arg_types = {}
 80
 81
 82class CatalogProperty(Property):
 83    arg_types = {}
 84
 85
 86class CharacterSetProperty(Property):
 87    arg_types = {"this": True, "default": True}
 88
 89
 90class ChecksumProperty(Property):
 91    arg_types = {"on": False, "default": False}
 92
 93
 94class ClusterProperty(Property):
 95    arg_types = {"this": False, "expressions": False}
 96
 97
 98class CollateProperty(Property):
 99    arg_types = {"this": True, "default": False}
100
101
102class ComputeProperty(Property):
103    arg_types = {}
104
105
106class CopyGrantsProperty(Property):
107    arg_types = {}
108
109
110class CopyTagsProperty(Property):
111    arg_types = {}
112
113
114class DataBlocksizeProperty(Property):
115    arg_types = {
116        "size": False,
117        "units": False,
118        "minimum": False,
119        "maximum": False,
120        "default": False,
121    }
122
123
124class DataDeletionProperty(Property):
125    arg_types = {"on": True, "filter_column": False, "retention_period": False}
126
127
128class DatabaseProperty(Property):
129    arg_types = {}
130
131
132class DefinerProperty(Property):
133    arg_types = {"this": True}
134    _hash_raw_args = True
135
136
137class DistKeyProperty(Property):
138    arg_types = {"this": True}
139
140
141class DistributedByProperty(Property):
142    arg_types = {"expressions": False, "kind": True, "buckets": False, "order": False}
143
144
145class DistStyleProperty(Property):
146    arg_types = {"this": True}
147
148
149class DuplicateKeyProperty(Property):
150    arg_types = {"expressions": True}
151
152
153class EngineProperty(Property):
154    arg_types = {"this": True}
155
156
157class UuidProperty(Property):
158    arg_types = {"this": True}
159
160
161class HeapProperty(Property):
162    arg_types = {}
163
164
165class HybridProperty(Property):
166    arg_types = {}
167
168
169class HandlerProperty(Property):
170    arg_types = {"this": True}
171
172
173class ParameterStyleProperty(Property):
174    arg_types = {"this": True}
175
176
177class ToTableProperty(Property):
178    arg_types = {"this": True}
179
180
181class ExecuteAsProperty(Property):
182    arg_types = {"this": True}
183
184
185class ExternalProperty(Property):
186    arg_types = {"this": False}
187
188
189class FallbackProperty(Property):
190    arg_types = {"no": True, "protection": False}
191
192
193class FileFormatProperty(Property):
194    arg_types = {"this": False, "expressions": False, "hive_format": False}
195
196
197class CredentialsProperty(Property):
198    arg_types = {"expressions": True}
199
200
201class FreespaceProperty(Property):
202    arg_types = {"this": True, "percent": False}
203
204
205class GlobalProperty(Property):
206    arg_types = {}
207
208
209class IcebergProperty(Property):
210    arg_types = {}
211
212
213class IgnoreGrantsProperty(Property):
214    arg_types = {}
215
216
217class InheritsProperty(Property):
218    arg_types = {"expressions": True}
219
220
221class InputModelProperty(Property):
222    arg_types = {"this": True}
223
224
225class OutputModelProperty(Property):
226    arg_types = {"this": True}
227
228
229class InteractiveProperty(Property):
230    arg_types = {}
231
232
233class IsolatedLoadingProperty(Property):
234    arg_types = {"no": False, "concurrent": False, "target": False}
235
236
237class JournalProperty(Property):
238    arg_types = {
239        "no": False,
240        "dual": False,
241        "before": False,
242        "local": False,
243        "after": False,
244    }
245
246
247class LanguageProperty(Property):
248    arg_types = {"this": True}
249
250
251class EnviromentProperty(Property):
252    arg_types = {"expressions": True}
253
254
255class ClusteredByProperty(Property):
256    arg_types = {"expressions": True, "sorted_by": False, "buckets": True}
257
258
259class DictProperty(Property):
260    arg_types = {"this": True, "kind": True, "settings": False}
261
262
263class DictSubProperty(Property):
264    pass
265
266
267class DictRange(Property):
268    arg_types = {"this": True, "min": True, "max": True}
269
270
271class DynamicProperty(Property):
272    arg_types = {}
273
274
275class OnCluster(Property):
276    arg_types = {"this": True}
277
278
279class EmptyProperty(Property):
280    arg_types = {}
281
282
283class LikeProperty(Property):
284    arg_types = {"this": True, "expressions": False}
285
286
287class LocationProperty(Property):
288    arg_types = {"this": True}
289
290
291class LockProperty(Property):
292    arg_types = {"this": True}
293
294
295class LockingProperty(Property):
296    arg_types = {
297        "this": False,
298        "kind": True,
299        "for_or_in": False,
300        "lock_type": True,
301        "override": False,
302    }
303
304
305class LogProperty(Property):
306    arg_types = {"no": True}
307
308
309class MaskingProperty(Property):
310    arg_types = {}
311
312
313class MaterializedProperty(Property):
314    arg_types = {"this": False}
315
316
317class MergeBlockRatioProperty(Property):
318    arg_types = {"this": False, "no": False, "default": False, "percent": False}
319
320
321class ModuleProperty(Property):
322    arg_types = {"this": True, "expressions": False}
323
324
325class NetworkProperty(Property):
326    arg_types = {}
327
328
329class NoPrimaryIndexProperty(Property):
330    arg_types = {}
331
332
333class OnProperty(Property):
334    arg_types = {"this": True}
335
336
337class OnCommitProperty(Property):
338    arg_types = {"delete": False}
339
340
341class OptionsProperty(Property):
342    arg_types = {"expressions": True}
343
344
345class PartitionedByProperty(Property):
346    arg_types = {"this": True}
347
348
349class PartitionedByBucket(Property):
350    arg_types = {"this": True, "expression": True}
351
352
353class PartitionByTruncate(Property):
354    arg_types = {"this": True, "expression": True}
355
356
357class PartitionByRangeProperty(Property):
358    arg_types = {"partition_expressions": True, "create_expressions": True}
359
360
361class PartitionByRangePropertyDynamic(Expression):
362    arg_types = {"this": False, "start": True, "end": True, "every": True}
363
364
365class RollupProperty(Property):
366    arg_types = {"expressions": True}
367
368
369class RollupIndex(Expression):
370    arg_types = {"this": True, "expressions": True, "from_index": False, "properties": False}
371
372
373class RowAccessProperty(Property):
374    arg_types = {"this": False, "expressions": False}
375
376
377class PartitionByListProperty(Property):
378    arg_types = {"partition_expressions": True, "create_expressions": True}
379
380
381class PartitionList(Expression):
382    arg_types = {"this": True, "expressions": True}
383
384
385class RefreshTriggerProperty(Property):
386    arg_types = {
387        "method": False,
388        "kind": False,
389        "every": False,
390        "unit": False,
391        "starts": False,
392    }
393
394
395class UniqueKeyProperty(Property):
396    arg_types = {"expressions": True}
397
398
399class PartitionBoundSpec(Expression):
400    # this -> IN / MODULUS, expression -> REMAINDER, from_expressions -> FROM (...), to_expressions -> TO (...)
401    arg_types = {
402        "this": False,
403        "expression": False,
404        "from_expressions": False,
405        "to_expressions": False,
406    }
407
408
409class PartitionedOfProperty(Property):
410    # this -> parent_table (schema), expression -> FOR VALUES ... / DEFAULT
411    arg_types = {"this": True, "expression": True}
412
413
414class PhysicalProperty(Property):
415    arg_types = {"this": True, "value": False}
416
417
418class StreamingTableProperty(Property):
419    arg_types = {}
420
421
422class RemoteWithConnectionModelProperty(Property):
423    arg_types = {"this": True}
424
425
426class ReturnsProperty(Property):
427    arg_types = {"this": False, "is_table": False, "table": False, "null": False}
428
429
430class StrictProperty(Property):
431    arg_types = {}
432
433
434class WithoutRowidProperty(Property):
435    arg_types = {}
436
437
438class RowFormatProperty(Property):
439    arg_types = {"this": True}
440
441
442class RowFormatDelimitedProperty(Property):
443    # https://cwiki.apache.org/confluence/display/hive/languagemanual+dml
444    arg_types = {
445        "fields": False,
446        "escaped": False,
447        "collection_items": False,
448        "map_keys": False,
449        "lines": False,
450        "null": False,
451        "serde": False,
452    }
453
454
455class RowFormatSerdeProperty(Property):
456    arg_types = {"this": True, "serde_properties": False}
457
458
459class QueryTransform(Expression):
460    arg_types = {
461        "expressions": True,
462        "command_script": True,
463        "schema": False,
464        "row_format_before": False,
465        "record_writer": False,
466        "row_format_after": False,
467        "record_reader": False,
468    }
469
470
471class SampleProperty(Property):
472    arg_types = {"this": True}
473
474
475class SchemaCommentProperty(Property):
476    arg_types = {"this": True}
477
478
479class SemanticView(Expression):
480    arg_types = {
481        "this": True,
482        "metrics": False,
483        "dimensions": False,
484        "facts": False,
485        "where": False,
486    }
487
488
489class SerdeProperties(Property):
490    arg_types = {"expressions": True, "with_": False}
491
492
493class SetProperty(Property):
494    arg_types = {"multi": True}
495
496
497class SharingProperty(Property):
498    arg_types = {"this": False}
499
500
501class SetConfigProperty(Property):
502    arg_types = {"this": True}
503
504
505class SettingsProperty(Property):
506    arg_types = {"expressions": True}
507
508
509class SortKeyProperty(Property):
510    arg_types = {"this": True, "compound": False}
511
512
513class SqlReadWriteProperty(Property):
514    arg_types = {"this": True}
515
516
517class SqlSecurityProperty(Property):
518    arg_types = {"this": True}
519
520
521class StabilityProperty(Property):
522    arg_types = {"this": True}
523
524
525class StorageHandlerProperty(Property):
526    arg_types = {"this": True}
527
528
529class StorageProperty(Property):
530    arg_types = {"expressions": True}
531
532
533class UsingProperty(Property):
534    # kind: JAR, FILE, or ARCHIVE; this: the resource path (string literal)
535    arg_types = {"this": True, "kind": True}
536
537
538class TemporaryProperty(Property):
539    arg_types = {"this": False, "scoped": False}
540
541
542class VirtualProperty(Property):
543    arg_types = {}
544
545
546class SecureProperty(Property):
547    arg_types = {}
548
549
550class SecurityIntegrationProperty(Property):
551    arg_types = {}
552
553
554class Tags(Property, ColumnConstraintKind):
555    arg_types = {"expressions": True}
556
557
558class TableSpaceProperty(Property):
559    arg_types = {"this": True}
560
561
562class PropertiesLocation(AutoName):
563    POST_CREATE = auto()
564    POST_NAME = auto()
565    POST_SCHEMA = auto()
566    POST_WITH = auto()
567    POST_ALIAS = auto()
568    POST_EXPRESSION = auto()
569    POST_INDEX = auto()
570    UNSUPPORTED = auto()
571
572
573class TransformModelProperty(Property):
574    arg_types = {"expressions": True}
575
576
577class TransientProperty(Property):
578    arg_types = {"this": False}
579
580
581class UnloggedProperty(Property):
582    arg_types = {}
583
584
585class UsingTemplateProperty(Property):
586    arg_types = {"this": True}
587
588
589class ViewAttributeProperty(Property):
590    arg_types = {"this": True}
591
592
593class VolatileProperty(Property):
594    arg_types = {"this": False}
595
596
597class WithDataProperty(Property):
598    arg_types = {"no": True, "statistics": False}
599
600
601class WithJournalTableProperty(Property):
602    arg_types = {"this": True}
603
604
605class WithSchemaBindingProperty(Property):
606    arg_types = {"this": True}
607
608
609class WithSystemVersioningProperty(Property):
610    arg_types = {
611        "on": False,
612        "this": False,
613        "data_consistency": False,
614        "retention_period": False,
615        "with_": True,
616    }
617
618
619class WithProcedureOptions(Property):
620    arg_types = {"expressions": True}
621
622
623class EncodeProperty(Property):
624    arg_types = {"this": True, "properties": False, "key": False}
625
626
627class IncludeProperty(Property):
628    arg_types = {"this": True, "alias": False, "column_def": False}
629
630
631class ForceProperty(Property):
632    arg_types = {}
633
634
635class Properties(Expression):
636    arg_types = {"expressions": True}
637
638    NAME_TO_PROPERTY: t.ClassVar[dict[str, type[Property]]] = {
639        "ALGORITHM": AlgorithmProperty,
640        "AUTO_INCREMENT": AutoIncrementProperty,
641        "CHARACTER SET": CharacterSetProperty,
642        "CLUSTERED_BY": ClusteredByProperty,
643        "COLLATE": CollateProperty,
644        "COMMENT": SchemaCommentProperty,
645        "CREDENTIALS": CredentialsProperty,
646        "DEFINER": DefinerProperty,
647        "DISTKEY": DistKeyProperty,
648        "DISTRIBUTED_BY": DistributedByProperty,
649        "DISTSTYLE": DistStyleProperty,
650        "ENGINE": EngineProperty,
651        "EXECUTE AS": ExecuteAsProperty,
652        "FORMAT": FileFormatProperty,
653        "LANGUAGE": LanguageProperty,
654        "LOCATION": LocationProperty,
655        "LOCK": LockProperty,
656        "PARTITIONED_BY": PartitionedByProperty,
657        "RETURNS": ReturnsProperty,
658        "ROW_FORMAT": RowFormatProperty,
659        "SORTKEY": SortKeyProperty,
660        "ENCODE": EncodeProperty,
661        "INCLUDE": IncludeProperty,
662    }
663
664    PROPERTY_TO_NAME: t.ClassVar[dict[type[Property], str]] = {
665        v: k for k, v in NAME_TO_PROPERTY.items()
666    }
667
668    # CREATE property locations
669    # Form: schema specified
670    #   create [POST_CREATE]
671    #     table a [POST_NAME]
672    #     (b int) [POST_SCHEMA]
673    #     with ([POST_WITH])
674    #     index (b) [POST_INDEX]
675    #
676    # Form: alias selection
677    #   create [POST_CREATE]
678    #     table a [POST_NAME]
679    #     as [POST_ALIAS] (select * from b) [POST_EXPRESSION]
680    #     index (c) [POST_INDEX]
681    Location: t.ClassVar[type[PropertiesLocation]] = PropertiesLocation
682
683    @classmethod
684    def from_dict(cls, properties_dict: dict) -> Properties:
685        expressions = []
686        for key, value in properties_dict.items():
687            property_cls = cls.NAME_TO_PROPERTY.get(key.upper())
688            if property_cls:
689                expressions.append(property_cls(this=convert(value)))
690            else:
691                expressions.append(Property(this=Literal.string(key), value=convert(value)))
692
693        return cls(expressions=expressions)
class Property(sqlglot.expressions.core.Expression):
13class Property(Expression):
14    arg_types = {"this": True, "value": True}
arg_types = {'this': True, 'value': True}
key: ClassVar[str] = 'property'
required_args: 't.ClassVar[set[str]]' = {'this', 'value'}
class GrantPrivilege(sqlglot.expressions.core.Expression):
17class GrantPrivilege(Expression):
18    arg_types = {"this": True, "expressions": False}
arg_types = {'this': True, 'expressions': False}
key: ClassVar[str] = 'grantprivilege'
required_args: 't.ClassVar[set[str]]' = {'this'}
class GrantPrincipal(sqlglot.expressions.core.Expression):
21class GrantPrincipal(Expression):
22    arg_types = {"this": True, "kind": False}
arg_types = {'this': True, 'kind': False}
key: ClassVar[str] = 'grantprincipal'
required_args: 't.ClassVar[set[str]]' = {'this'}
class AllowedValuesProperty(sqlglot.expressions.core.Expression):
25class AllowedValuesProperty(Expression):
26    arg_types = {"expressions": True}
arg_types = {'expressions': True}
key: ClassVar[str] = 'allowedvaluesproperty'
required_args: 't.ClassVar[set[str]]' = {'expressions'}
class AggregateKeyProperty(Property):
29class AggregateKeyProperty(Property):
30    arg_types = {"expressions": True}
arg_types = {'expressions': True}
key: ClassVar[str] = 'aggregatekeyproperty'
required_args: 't.ClassVar[set[str]]' = {'expressions'}
class AlgorithmProperty(Property):
33class AlgorithmProperty(Property):
34    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'algorithmproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class ApiProperty(Property):
37class ApiProperty(Property):
38    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'apiproperty'
required_args: 't.ClassVar[set[str]]' = set()
class ApplicationProperty(Property):
41class ApplicationProperty(Property):
42    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'applicationproperty'
required_args: 't.ClassVar[set[str]]' = set()
class AutoIncrementProperty(Property):
45class AutoIncrementProperty(Property):
46    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'autoincrementproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class AutoRefreshProperty(Property):
49class AutoRefreshProperty(Property):
50    arg_types = {
51        "this": False,
52        "cadence": False,
53        "offset": False,
54        "randomize": False,
55        "expressions": False,
56        "settings": False,
57        "append": False,
58    }
arg_types = {'this': False, 'cadence': False, 'offset': False, 'randomize': False, 'expressions': False, 'settings': False, 'append': False}
key: ClassVar[str] = 'autorefreshproperty'
required_args: 't.ClassVar[set[str]]' = set()
class BackupProperty(Property):
61class BackupProperty(Property):
62    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'backupproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class BuildProperty(Property):
65class BuildProperty(Property):
66    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'buildproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class BlockCompressionProperty(Property):
69class BlockCompressionProperty(Property):
70    arg_types = {
71        "autotemp": False,
72        "always": False,
73        "default": False,
74        "manual": False,
75        "never": False,
76    }
arg_types = {'autotemp': False, 'always': False, 'default': False, 'manual': False, 'never': False}
key: ClassVar[str] = 'blockcompressionproperty'
required_args: 't.ClassVar[set[str]]' = set()
class CalledOnNullInputProperty(Property):
79class CalledOnNullInputProperty(Property):
80    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'calledonnullinputproperty'
required_args: 't.ClassVar[set[str]]' = set()
class CatalogProperty(Property):
83class CatalogProperty(Property):
84    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'catalogproperty'
required_args: 't.ClassVar[set[str]]' = set()
class CharacterSetProperty(Property):
87class CharacterSetProperty(Property):
88    arg_types = {"this": True, "default": True}
arg_types = {'this': True, 'default': True}
key: ClassVar[str] = 'charactersetproperty'
required_args: 't.ClassVar[set[str]]' = {'this', 'default'}
class ChecksumProperty(Property):
91class ChecksumProperty(Property):
92    arg_types = {"on": False, "default": False}
arg_types = {'on': False, 'default': False}
key: ClassVar[str] = 'checksumproperty'
required_args: 't.ClassVar[set[str]]' = set()
class ClusterProperty(Property):
95class ClusterProperty(Property):
96    arg_types = {"this": False, "expressions": False}
arg_types = {'this': False, 'expressions': False}
key: ClassVar[str] = 'clusterproperty'
required_args: 't.ClassVar[set[str]]' = set()
class CollateProperty(Property):
 99class CollateProperty(Property):
100    arg_types = {"this": True, "default": False}
arg_types = {'this': True, 'default': False}
key: ClassVar[str] = 'collateproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class ComputeProperty(Property):
103class ComputeProperty(Property):
104    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'computeproperty'
required_args: 't.ClassVar[set[str]]' = set()
class CopyGrantsProperty(Property):
107class CopyGrantsProperty(Property):
108    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'copygrantsproperty'
required_args: 't.ClassVar[set[str]]' = set()
class CopyTagsProperty(Property):
111class CopyTagsProperty(Property):
112    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'copytagsproperty'
required_args: 't.ClassVar[set[str]]' = set()
class DataBlocksizeProperty(Property):
115class DataBlocksizeProperty(Property):
116    arg_types = {
117        "size": False,
118        "units": False,
119        "minimum": False,
120        "maximum": False,
121        "default": False,
122    }
arg_types = {'size': False, 'units': False, 'minimum': False, 'maximum': False, 'default': False}
key: ClassVar[str] = 'datablocksizeproperty'
required_args: 't.ClassVar[set[str]]' = set()
class DataDeletionProperty(Property):
125class DataDeletionProperty(Property):
126    arg_types = {"on": True, "filter_column": False, "retention_period": False}
arg_types = {'on': True, 'filter_column': False, 'retention_period': False}
key: ClassVar[str] = 'datadeletionproperty'
required_args: 't.ClassVar[set[str]]' = {'on'}
class DatabaseProperty(Property):
129class DatabaseProperty(Property):
130    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'databaseproperty'
required_args: 't.ClassVar[set[str]]' = set()
class DefinerProperty(Property):
133class DefinerProperty(Property):
134    arg_types = {"this": True}
135    _hash_raw_args = True
arg_types = {'this': True}
key: ClassVar[str] = 'definerproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class DistKeyProperty(Property):
138class DistKeyProperty(Property):
139    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'distkeyproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class DistributedByProperty(Property):
142class DistributedByProperty(Property):
143    arg_types = {"expressions": False, "kind": True, "buckets": False, "order": False}
arg_types = {'expressions': False, 'kind': True, 'buckets': False, 'order': False}
key: ClassVar[str] = 'distributedbyproperty'
required_args: 't.ClassVar[set[str]]' = {'kind'}
class DistStyleProperty(Property):
146class DistStyleProperty(Property):
147    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'diststyleproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class DuplicateKeyProperty(Property):
150class DuplicateKeyProperty(Property):
151    arg_types = {"expressions": True}
arg_types = {'expressions': True}
key: ClassVar[str] = 'duplicatekeyproperty'
required_args: 't.ClassVar[set[str]]' = {'expressions'}
class EngineProperty(Property):
154class EngineProperty(Property):
155    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'engineproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class UuidProperty(Property):
158class UuidProperty(Property):
159    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'uuidproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class HeapProperty(Property):
162class HeapProperty(Property):
163    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'heapproperty'
required_args: 't.ClassVar[set[str]]' = set()
class HybridProperty(Property):
166class HybridProperty(Property):
167    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'hybridproperty'
required_args: 't.ClassVar[set[str]]' = set()
class HandlerProperty(Property):
170class HandlerProperty(Property):
171    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'handlerproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class ParameterStyleProperty(Property):
174class ParameterStyleProperty(Property):
175    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'parameterstyleproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class ToTableProperty(Property):
178class ToTableProperty(Property):
179    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'totableproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class ExecuteAsProperty(Property):
182class ExecuteAsProperty(Property):
183    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'executeasproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class ExternalProperty(Property):
186class ExternalProperty(Property):
187    arg_types = {"this": False}
arg_types = {'this': False}
key: ClassVar[str] = 'externalproperty'
required_args: 't.ClassVar[set[str]]' = set()
class FallbackProperty(Property):
190class FallbackProperty(Property):
191    arg_types = {"no": True, "protection": False}
arg_types = {'no': True, 'protection': False}
key: ClassVar[str] = 'fallbackproperty'
required_args: 't.ClassVar[set[str]]' = {'no'}
class FileFormatProperty(Property):
194class FileFormatProperty(Property):
195    arg_types = {"this": False, "expressions": False, "hive_format": False}
arg_types = {'this': False, 'expressions': False, 'hive_format': False}
key: ClassVar[str] = 'fileformatproperty'
required_args: 't.ClassVar[set[str]]' = set()
class CredentialsProperty(Property):
198class CredentialsProperty(Property):
199    arg_types = {"expressions": True}
arg_types = {'expressions': True}
key: ClassVar[str] = 'credentialsproperty'
required_args: 't.ClassVar[set[str]]' = {'expressions'}
class FreespaceProperty(Property):
202class FreespaceProperty(Property):
203    arg_types = {"this": True, "percent": False}
arg_types = {'this': True, 'percent': False}
key: ClassVar[str] = 'freespaceproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class GlobalProperty(Property):
206class GlobalProperty(Property):
207    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'globalproperty'
required_args: 't.ClassVar[set[str]]' = set()
class IcebergProperty(Property):
210class IcebergProperty(Property):
211    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'icebergproperty'
required_args: 't.ClassVar[set[str]]' = set()
class IgnoreGrantsProperty(Property):
214class IgnoreGrantsProperty(Property):
215    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'ignoregrantsproperty'
required_args: 't.ClassVar[set[str]]' = set()
class InheritsProperty(Property):
218class InheritsProperty(Property):
219    arg_types = {"expressions": True}
arg_types = {'expressions': True}
key: ClassVar[str] = 'inheritsproperty'
required_args: 't.ClassVar[set[str]]' = {'expressions'}
class InputModelProperty(Property):
222class InputModelProperty(Property):
223    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'inputmodelproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class OutputModelProperty(Property):
226class OutputModelProperty(Property):
227    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'outputmodelproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class InteractiveProperty(Property):
230class InteractiveProperty(Property):
231    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'interactiveproperty'
required_args: 't.ClassVar[set[str]]' = set()
class IsolatedLoadingProperty(Property):
234class IsolatedLoadingProperty(Property):
235    arg_types = {"no": False, "concurrent": False, "target": False}
arg_types = {'no': False, 'concurrent': False, 'target': False}
key: ClassVar[str] = 'isolatedloadingproperty'
required_args: 't.ClassVar[set[str]]' = set()
class JournalProperty(Property):
238class JournalProperty(Property):
239    arg_types = {
240        "no": False,
241        "dual": False,
242        "before": False,
243        "local": False,
244        "after": False,
245    }
arg_types = {'no': False, 'dual': False, 'before': False, 'local': False, 'after': False}
key: ClassVar[str] = 'journalproperty'
required_args: 't.ClassVar[set[str]]' = set()
class LanguageProperty(Property):
248class LanguageProperty(Property):
249    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'languageproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class EnviromentProperty(Property):
252class EnviromentProperty(Property):
253    arg_types = {"expressions": True}
arg_types = {'expressions': True}
key: ClassVar[str] = 'enviromentproperty'
required_args: 't.ClassVar[set[str]]' = {'expressions'}
class ClusteredByProperty(Property):
256class ClusteredByProperty(Property):
257    arg_types = {"expressions": True, "sorted_by": False, "buckets": True}
arg_types = {'expressions': True, 'sorted_by': False, 'buckets': True}
key: ClassVar[str] = 'clusteredbyproperty'
required_args: 't.ClassVar[set[str]]' = {'expressions', 'buckets'}
class DictProperty(Property):
260class DictProperty(Property):
261    arg_types = {"this": True, "kind": True, "settings": False}
arg_types = {'this': True, 'kind': True, 'settings': False}
key: ClassVar[str] = 'dictproperty'
required_args: 't.ClassVar[set[str]]' = {'kind', 'this'}
class DictSubProperty(Property):
264class DictSubProperty(Property):
265    pass
key: ClassVar[str] = 'dictsubproperty'
required_args: 't.ClassVar[set[str]]' = {'this', 'value'}
class DictRange(Property):
268class DictRange(Property):
269    arg_types = {"this": True, "min": True, "max": True}
arg_types = {'this': True, 'min': True, 'max': True}
key: ClassVar[str] = 'dictrange'
required_args: 't.ClassVar[set[str]]' = {'this', 'max', 'min'}
class DynamicProperty(Property):
272class DynamicProperty(Property):
273    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'dynamicproperty'
required_args: 't.ClassVar[set[str]]' = set()
class OnCluster(Property):
276class OnCluster(Property):
277    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'oncluster'
required_args: 't.ClassVar[set[str]]' = {'this'}
class EmptyProperty(Property):
280class EmptyProperty(Property):
281    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'emptyproperty'
required_args: 't.ClassVar[set[str]]' = set()
class LikeProperty(Property):
284class LikeProperty(Property):
285    arg_types = {"this": True, "expressions": False}
arg_types = {'this': True, 'expressions': False}
key: ClassVar[str] = 'likeproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class LocationProperty(Property):
288class LocationProperty(Property):
289    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'locationproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class LockProperty(Property):
292class LockProperty(Property):
293    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'lockproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class LockingProperty(Property):
296class LockingProperty(Property):
297    arg_types = {
298        "this": False,
299        "kind": True,
300        "for_or_in": False,
301        "lock_type": True,
302        "override": False,
303    }
arg_types = {'this': False, 'kind': True, 'for_or_in': False, 'lock_type': True, 'override': False}
key: ClassVar[str] = 'lockingproperty'
required_args: 't.ClassVar[set[str]]' = {'kind', 'lock_type'}
class LogProperty(Property):
306class LogProperty(Property):
307    arg_types = {"no": True}
arg_types = {'no': True}
key: ClassVar[str] = 'logproperty'
required_args: 't.ClassVar[set[str]]' = {'no'}
class MaskingProperty(Property):
310class MaskingProperty(Property):
311    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'maskingproperty'
required_args: 't.ClassVar[set[str]]' = set()
class MaterializedProperty(Property):
314class MaterializedProperty(Property):
315    arg_types = {"this": False}
arg_types = {'this': False}
key: ClassVar[str] = 'materializedproperty'
required_args: 't.ClassVar[set[str]]' = set()
class MergeBlockRatioProperty(Property):
318class MergeBlockRatioProperty(Property):
319    arg_types = {"this": False, "no": False, "default": False, "percent": False}
arg_types = {'this': False, 'no': False, 'default': False, 'percent': False}
key: ClassVar[str] = 'mergeblockratioproperty'
required_args: 't.ClassVar[set[str]]' = set()
class ModuleProperty(Property):
322class ModuleProperty(Property):
323    arg_types = {"this": True, "expressions": False}
arg_types = {'this': True, 'expressions': False}
key: ClassVar[str] = 'moduleproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class NetworkProperty(Property):
326class NetworkProperty(Property):
327    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'networkproperty'
required_args: 't.ClassVar[set[str]]' = set()
class NoPrimaryIndexProperty(Property):
330class NoPrimaryIndexProperty(Property):
331    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'noprimaryindexproperty'
required_args: 't.ClassVar[set[str]]' = set()
class OnProperty(Property):
334class OnProperty(Property):
335    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'onproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class OnCommitProperty(Property):
338class OnCommitProperty(Property):
339    arg_types = {"delete": False}
arg_types = {'delete': False}
key: ClassVar[str] = 'oncommitproperty'
required_args: 't.ClassVar[set[str]]' = set()
class OptionsProperty(Property):
342class OptionsProperty(Property):
343    arg_types = {"expressions": True}
arg_types = {'expressions': True}
key: ClassVar[str] = 'optionsproperty'
required_args: 't.ClassVar[set[str]]' = {'expressions'}
class PartitionedByProperty(Property):
346class PartitionedByProperty(Property):
347    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'partitionedbyproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class PartitionedByBucket(Property):
350class PartitionedByBucket(Property):
351    arg_types = {"this": True, "expression": True}
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'partitionedbybucket'
required_args: 't.ClassVar[set[str]]' = {'this', 'expression'}
class PartitionByTruncate(Property):
354class PartitionByTruncate(Property):
355    arg_types = {"this": True, "expression": True}
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'partitionbytruncate'
required_args: 't.ClassVar[set[str]]' = {'this', 'expression'}
class PartitionByRangeProperty(Property):
358class PartitionByRangeProperty(Property):
359    arg_types = {"partition_expressions": True, "create_expressions": True}
arg_types = {'partition_expressions': True, 'create_expressions': True}
key: ClassVar[str] = 'partitionbyrangeproperty'
required_args: 't.ClassVar[set[str]]' = {'create_expressions', 'partition_expressions'}
class PartitionByRangePropertyDynamic(sqlglot.expressions.core.Expression):
362class PartitionByRangePropertyDynamic(Expression):
363    arg_types = {"this": False, "start": True, "end": True, "every": True}
arg_types = {'this': False, 'start': True, 'end': True, 'every': True}
key: ClassVar[str] = 'partitionbyrangepropertydynamic'
required_args: 't.ClassVar[set[str]]' = {'start', 'every', 'end'}
class RollupProperty(Property):
366class RollupProperty(Property):
367    arg_types = {"expressions": True}
arg_types = {'expressions': True}
key: ClassVar[str] = 'rollupproperty'
required_args: 't.ClassVar[set[str]]' = {'expressions'}
class RollupIndex(sqlglot.expressions.core.Expression):
370class RollupIndex(Expression):
371    arg_types = {"this": True, "expressions": True, "from_index": False, "properties": False}
arg_types = {'this': True, 'expressions': True, 'from_index': False, 'properties': False}
key: ClassVar[str] = 'rollupindex'
required_args: 't.ClassVar[set[str]]' = {'expressions', 'this'}
class RowAccessProperty(Property):
374class RowAccessProperty(Property):
375    arg_types = {"this": False, "expressions": False}
arg_types = {'this': False, 'expressions': False}
key: ClassVar[str] = 'rowaccessproperty'
required_args: 't.ClassVar[set[str]]' = set()
class PartitionByListProperty(Property):
378class PartitionByListProperty(Property):
379    arg_types = {"partition_expressions": True, "create_expressions": True}
arg_types = {'partition_expressions': True, 'create_expressions': True}
key: ClassVar[str] = 'partitionbylistproperty'
required_args: 't.ClassVar[set[str]]' = {'create_expressions', 'partition_expressions'}
class PartitionList(sqlglot.expressions.core.Expression):
382class PartitionList(Expression):
383    arg_types = {"this": True, "expressions": True}
arg_types = {'this': True, 'expressions': True}
key: ClassVar[str] = 'partitionlist'
required_args: 't.ClassVar[set[str]]' = {'expressions', 'this'}
class RefreshTriggerProperty(Property):
386class RefreshTriggerProperty(Property):
387    arg_types = {
388        "method": False,
389        "kind": False,
390        "every": False,
391        "unit": False,
392        "starts": False,
393    }
arg_types = {'method': False, 'kind': False, 'every': False, 'unit': False, 'starts': False}
key: ClassVar[str] = 'refreshtriggerproperty'
required_args: 't.ClassVar[set[str]]' = set()
class UniqueKeyProperty(Property):
396class UniqueKeyProperty(Property):
397    arg_types = {"expressions": True}
arg_types = {'expressions': True}
key: ClassVar[str] = 'uniquekeyproperty'
required_args: 't.ClassVar[set[str]]' = {'expressions'}
class PartitionBoundSpec(sqlglot.expressions.core.Expression):
400class PartitionBoundSpec(Expression):
401    # this -> IN / MODULUS, expression -> REMAINDER, from_expressions -> FROM (...), to_expressions -> TO (...)
402    arg_types = {
403        "this": False,
404        "expression": False,
405        "from_expressions": False,
406        "to_expressions": False,
407    }
arg_types = {'this': False, 'expression': False, 'from_expressions': False, 'to_expressions': False}
key: ClassVar[str] = 'partitionboundspec'
required_args: 't.ClassVar[set[str]]' = set()
class PartitionedOfProperty(Property):
410class PartitionedOfProperty(Property):
411    # this -> parent_table (schema), expression -> FOR VALUES ... / DEFAULT
412    arg_types = {"this": True, "expression": True}
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'partitionedofproperty'
required_args: 't.ClassVar[set[str]]' = {'this', 'expression'}
class PhysicalProperty(Property):
415class PhysicalProperty(Property):
416    arg_types = {"this": True, "value": False}
arg_types = {'this': True, 'value': False}
key: ClassVar[str] = 'physicalproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class StreamingTableProperty(Property):
419class StreamingTableProperty(Property):
420    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'streamingtableproperty'
required_args: 't.ClassVar[set[str]]' = set()
class RemoteWithConnectionModelProperty(Property):
423class RemoteWithConnectionModelProperty(Property):
424    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'remotewithconnectionmodelproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class ReturnsProperty(Property):
427class ReturnsProperty(Property):
428    arg_types = {"this": False, "is_table": False, "table": False, "null": False}
arg_types = {'this': False, 'is_table': False, 'table': False, 'null': False}
key: ClassVar[str] = 'returnsproperty'
required_args: 't.ClassVar[set[str]]' = set()
class StrictProperty(Property):
431class StrictProperty(Property):
432    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'strictproperty'
required_args: 't.ClassVar[set[str]]' = set()
class WithoutRowidProperty(Property):
435class WithoutRowidProperty(Property):
436    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'withoutrowidproperty'
required_args: 't.ClassVar[set[str]]' = set()
class RowFormatProperty(Property):
439class RowFormatProperty(Property):
440    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'rowformatproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class RowFormatDelimitedProperty(Property):
443class RowFormatDelimitedProperty(Property):
444    # https://cwiki.apache.org/confluence/display/hive/languagemanual+dml
445    arg_types = {
446        "fields": False,
447        "escaped": False,
448        "collection_items": False,
449        "map_keys": False,
450        "lines": False,
451        "null": False,
452        "serde": False,
453    }
arg_types = {'fields': False, 'escaped': False, 'collection_items': False, 'map_keys': False, 'lines': False, 'null': False, 'serde': False}
key: ClassVar[str] = 'rowformatdelimitedproperty'
required_args: 't.ClassVar[set[str]]' = set()
class RowFormatSerdeProperty(Property):
456class RowFormatSerdeProperty(Property):
457    arg_types = {"this": True, "serde_properties": False}
arg_types = {'this': True, 'serde_properties': False}
key: ClassVar[str] = 'rowformatserdeproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class QueryTransform(sqlglot.expressions.core.Expression):
460class QueryTransform(Expression):
461    arg_types = {
462        "expressions": True,
463        "command_script": True,
464        "schema": False,
465        "row_format_before": False,
466        "record_writer": False,
467        "row_format_after": False,
468        "record_reader": False,
469    }
arg_types = {'expressions': True, 'command_script': True, 'schema': False, 'row_format_before': False, 'record_writer': False, 'row_format_after': False, 'record_reader': False}
key: ClassVar[str] = 'querytransform'
required_args: 't.ClassVar[set[str]]' = {'expressions', 'command_script'}
class SampleProperty(Property):
472class SampleProperty(Property):
473    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'sampleproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class SchemaCommentProperty(Property):
476class SchemaCommentProperty(Property):
477    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'schemacommentproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class SemanticView(sqlglot.expressions.core.Expression):
480class SemanticView(Expression):
481    arg_types = {
482        "this": True,
483        "metrics": False,
484        "dimensions": False,
485        "facts": False,
486        "where": False,
487    }
arg_types = {'this': True, 'metrics': False, 'dimensions': False, 'facts': False, 'where': False}
key: ClassVar[str] = 'semanticview'
required_args: 't.ClassVar[set[str]]' = {'this'}
class SerdeProperties(Property):
490class SerdeProperties(Property):
491    arg_types = {"expressions": True, "with_": False}
arg_types = {'expressions': True, 'with_': False}
key: ClassVar[str] = 'serdeproperties'
required_args: 't.ClassVar[set[str]]' = {'expressions'}
class SetProperty(Property):
494class SetProperty(Property):
495    arg_types = {"multi": True}
arg_types = {'multi': True}
key: ClassVar[str] = 'setproperty'
required_args: 't.ClassVar[set[str]]' = {'multi'}
class SharingProperty(Property):
498class SharingProperty(Property):
499    arg_types = {"this": False}
arg_types = {'this': False}
key: ClassVar[str] = 'sharingproperty'
required_args: 't.ClassVar[set[str]]' = set()
class SetConfigProperty(Property):
502class SetConfigProperty(Property):
503    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'setconfigproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class SettingsProperty(Property):
506class SettingsProperty(Property):
507    arg_types = {"expressions": True}
arg_types = {'expressions': True}
key: ClassVar[str] = 'settingsproperty'
required_args: 't.ClassVar[set[str]]' = {'expressions'}
class SortKeyProperty(Property):
510class SortKeyProperty(Property):
511    arg_types = {"this": True, "compound": False}
arg_types = {'this': True, 'compound': False}
key: ClassVar[str] = 'sortkeyproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class SqlReadWriteProperty(Property):
514class SqlReadWriteProperty(Property):
515    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'sqlreadwriteproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class SqlSecurityProperty(Property):
518class SqlSecurityProperty(Property):
519    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'sqlsecurityproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class StabilityProperty(Property):
522class StabilityProperty(Property):
523    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'stabilityproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class StorageHandlerProperty(Property):
526class StorageHandlerProperty(Property):
527    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'storagehandlerproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class StorageProperty(Property):
530class StorageProperty(Property):
531    arg_types = {"expressions": True}
arg_types = {'expressions': True}
key: ClassVar[str] = 'storageproperty'
required_args: 't.ClassVar[set[str]]' = {'expressions'}
class UsingProperty(Property):
534class UsingProperty(Property):
535    # kind: JAR, FILE, or ARCHIVE; this: the resource path (string literal)
536    arg_types = {"this": True, "kind": True}
arg_types = {'this': True, 'kind': True}
key: ClassVar[str] = 'usingproperty'
required_args: 't.ClassVar[set[str]]' = {'kind', 'this'}
class TemporaryProperty(Property):
539class TemporaryProperty(Property):
540    arg_types = {"this": False, "scoped": False}
arg_types = {'this': False, 'scoped': False}
key: ClassVar[str] = 'temporaryproperty'
required_args: 't.ClassVar[set[str]]' = set()
class VirtualProperty(Property):
543class VirtualProperty(Property):
544    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'virtualproperty'
required_args: 't.ClassVar[set[str]]' = set()
class SecureProperty(Property):
547class SecureProperty(Property):
548    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'secureproperty'
required_args: 't.ClassVar[set[str]]' = set()
class SecurityIntegrationProperty(Property):
551class SecurityIntegrationProperty(Property):
552    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'securityintegrationproperty'
required_args: 't.ClassVar[set[str]]' = set()
555class Tags(Property, ColumnConstraintKind):
556    arg_types = {"expressions": True}
arg_types = {'expressions': True}
key: ClassVar[str] = 'tags'
required_args: 't.ClassVar[set[str]]' = {'expressions'}
class TableSpaceProperty(Property):
559class TableSpaceProperty(Property):
560    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'tablespaceproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class PropertiesLocation(sqlglot.helper.AutoName):
563class PropertiesLocation(AutoName):
564    POST_CREATE = auto()
565    POST_NAME = auto()
566    POST_SCHEMA = auto()
567    POST_WITH = auto()
568    POST_ALIAS = auto()
569    POST_EXPRESSION = auto()
570    POST_INDEX = auto()
571    UNSUPPORTED = auto()

An enumeration.

POST_CREATE = <PropertiesLocation.POST_CREATE: 'POST_CREATE'>
POST_NAME = <PropertiesLocation.POST_NAME: 'POST_NAME'>
POST_SCHEMA = <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>
POST_WITH = <PropertiesLocation.POST_WITH: 'POST_WITH'>
POST_ALIAS = <PropertiesLocation.POST_ALIAS: 'POST_ALIAS'>
POST_EXPRESSION = <PropertiesLocation.POST_EXPRESSION: 'POST_EXPRESSION'>
POST_INDEX = <PropertiesLocation.POST_INDEX: 'POST_INDEX'>
UNSUPPORTED = <PropertiesLocation.UNSUPPORTED: 'UNSUPPORTED'>
class TransformModelProperty(Property):
574class TransformModelProperty(Property):
575    arg_types = {"expressions": True}
arg_types = {'expressions': True}
key: ClassVar[str] = 'transformmodelproperty'
required_args: 't.ClassVar[set[str]]' = {'expressions'}
class TransientProperty(Property):
578class TransientProperty(Property):
579    arg_types = {"this": False}
arg_types = {'this': False}
key: ClassVar[str] = 'transientproperty'
required_args: 't.ClassVar[set[str]]' = set()
class UnloggedProperty(Property):
582class UnloggedProperty(Property):
583    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'unloggedproperty'
required_args: 't.ClassVar[set[str]]' = set()
class UsingTemplateProperty(Property):
586class UsingTemplateProperty(Property):
587    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'usingtemplateproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class ViewAttributeProperty(Property):
590class ViewAttributeProperty(Property):
591    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'viewattributeproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class VolatileProperty(Property):
594class VolatileProperty(Property):
595    arg_types = {"this": False}
arg_types = {'this': False}
key: ClassVar[str] = 'volatileproperty'
required_args: 't.ClassVar[set[str]]' = set()
class WithDataProperty(Property):
598class WithDataProperty(Property):
599    arg_types = {"no": True, "statistics": False}
arg_types = {'no': True, 'statistics': False}
key: ClassVar[str] = 'withdataproperty'
required_args: 't.ClassVar[set[str]]' = {'no'}
class WithJournalTableProperty(Property):
602class WithJournalTableProperty(Property):
603    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'withjournaltableproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class WithSchemaBindingProperty(Property):
606class WithSchemaBindingProperty(Property):
607    arg_types = {"this": True}
arg_types = {'this': True}
key: ClassVar[str] = 'withschemabindingproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class WithSystemVersioningProperty(Property):
610class WithSystemVersioningProperty(Property):
611    arg_types = {
612        "on": False,
613        "this": False,
614        "data_consistency": False,
615        "retention_period": False,
616        "with_": True,
617    }
arg_types = {'on': False, 'this': False, 'data_consistency': False, 'retention_period': False, 'with_': True}
key: ClassVar[str] = 'withsystemversioningproperty'
required_args: 't.ClassVar[set[str]]' = {'with_'}
class WithProcedureOptions(Property):
620class WithProcedureOptions(Property):
621    arg_types = {"expressions": True}
arg_types = {'expressions': True}
key: ClassVar[str] = 'withprocedureoptions'
required_args: 't.ClassVar[set[str]]' = {'expressions'}
class EncodeProperty(Property):
624class EncodeProperty(Property):
625    arg_types = {"this": True, "properties": False, "key": False}
arg_types = {'this': True, 'properties': False, 'key': False}
key: ClassVar[str] = 'encodeproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class IncludeProperty(Property):
628class IncludeProperty(Property):
629    arg_types = {"this": True, "alias": False, "column_def": False}
arg_types = {'this': True, 'alias': False, 'column_def': False}
key: ClassVar[str] = 'includeproperty'
required_args: 't.ClassVar[set[str]]' = {'this'}
class ForceProperty(Property):
632class ForceProperty(Property):
633    arg_types = {}
arg_types = {}
key: ClassVar[str] = 'forceproperty'
required_args: 't.ClassVar[set[str]]' = set()
class Properties(sqlglot.expressions.core.Expression):
636class Properties(Expression):
637    arg_types = {"expressions": True}
638
639    NAME_TO_PROPERTY: t.ClassVar[dict[str, type[Property]]] = {
640        "ALGORITHM": AlgorithmProperty,
641        "AUTO_INCREMENT": AutoIncrementProperty,
642        "CHARACTER SET": CharacterSetProperty,
643        "CLUSTERED_BY": ClusteredByProperty,
644        "COLLATE": CollateProperty,
645        "COMMENT": SchemaCommentProperty,
646        "CREDENTIALS": CredentialsProperty,
647        "DEFINER": DefinerProperty,
648        "DISTKEY": DistKeyProperty,
649        "DISTRIBUTED_BY": DistributedByProperty,
650        "DISTSTYLE": DistStyleProperty,
651        "ENGINE": EngineProperty,
652        "EXECUTE AS": ExecuteAsProperty,
653        "FORMAT": FileFormatProperty,
654        "LANGUAGE": LanguageProperty,
655        "LOCATION": LocationProperty,
656        "LOCK": LockProperty,
657        "PARTITIONED_BY": PartitionedByProperty,
658        "RETURNS": ReturnsProperty,
659        "ROW_FORMAT": RowFormatProperty,
660        "SORTKEY": SortKeyProperty,
661        "ENCODE": EncodeProperty,
662        "INCLUDE": IncludeProperty,
663    }
664
665    PROPERTY_TO_NAME: t.ClassVar[dict[type[Property], str]] = {
666        v: k for k, v in NAME_TO_PROPERTY.items()
667    }
668
669    # CREATE property locations
670    # Form: schema specified
671    #   create [POST_CREATE]
672    #     table a [POST_NAME]
673    #     (b int) [POST_SCHEMA]
674    #     with ([POST_WITH])
675    #     index (b) [POST_INDEX]
676    #
677    # Form: alias selection
678    #   create [POST_CREATE]
679    #     table a [POST_NAME]
680    #     as [POST_ALIAS] (select * from b) [POST_EXPRESSION]
681    #     index (c) [POST_INDEX]
682    Location: t.ClassVar[type[PropertiesLocation]] = PropertiesLocation
683
684    @classmethod
685    def from_dict(cls, properties_dict: dict) -> Properties:
686        expressions = []
687        for key, value in properties_dict.items():
688            property_cls = cls.NAME_TO_PROPERTY.get(key.upper())
689            if property_cls:
690                expressions.append(property_cls(this=convert(value)))
691            else:
692                expressions.append(Property(this=Literal.string(key), value=convert(value)))
693
694        return cls(expressions=expressions)
arg_types = {'expressions': True}
NAME_TO_PROPERTY: ClassVar[dict[str, type[Property]]] = {'ALGORITHM': <class 'AlgorithmProperty'>, 'AUTO_INCREMENT': <class 'AutoIncrementProperty'>, 'CHARACTER SET': <class 'CharacterSetProperty'>, 'CLUSTERED_BY': <class 'ClusteredByProperty'>, 'COLLATE': <class 'CollateProperty'>, 'COMMENT': <class 'SchemaCommentProperty'>, 'CREDENTIALS': <class 'CredentialsProperty'>, 'DEFINER': <class 'DefinerProperty'>, 'DISTKEY': <class 'DistKeyProperty'>, 'DISTRIBUTED_BY': <class 'DistributedByProperty'>, 'DISTSTYLE': <class 'DistStyleProperty'>, 'ENGINE': <class 'EngineProperty'>, 'EXECUTE AS': <class 'ExecuteAsProperty'>, 'FORMAT': <class 'FileFormatProperty'>, 'LANGUAGE': <class 'LanguageProperty'>, 'LOCATION': <class 'LocationProperty'>, 'LOCK': <class 'LockProperty'>, 'PARTITIONED_BY': <class 'PartitionedByProperty'>, 'RETURNS': <class 'ReturnsProperty'>, 'ROW_FORMAT': <class 'RowFormatProperty'>, 'SORTKEY': <class 'SortKeyProperty'>, 'ENCODE': <class 'EncodeProperty'>, 'INCLUDE': <class 'IncludeProperty'>}
PROPERTY_TO_NAME: ClassVar[dict[type[Property], str]] = {<class 'AlgorithmProperty'>: 'ALGORITHM', <class 'AutoIncrementProperty'>: 'AUTO_INCREMENT', <class 'CharacterSetProperty'>: 'CHARACTER SET', <class 'ClusteredByProperty'>: 'CLUSTERED_BY', <class 'CollateProperty'>: 'COLLATE', <class 'SchemaCommentProperty'>: 'COMMENT', <class 'CredentialsProperty'>: 'CREDENTIALS', <class 'DefinerProperty'>: 'DEFINER', <class 'DistKeyProperty'>: 'DISTKEY', <class 'DistributedByProperty'>: 'DISTRIBUTED_BY', <class 'DistStyleProperty'>: 'DISTSTYLE', <class 'EngineProperty'>: 'ENGINE', <class 'ExecuteAsProperty'>: 'EXECUTE AS', <class 'FileFormatProperty'>: 'FORMAT', <class 'LanguageProperty'>: 'LANGUAGE', <class 'LocationProperty'>: 'LOCATION', <class 'LockProperty'>: 'LOCK', <class 'PartitionedByProperty'>: 'PARTITIONED_BY', <class 'ReturnsProperty'>: 'RETURNS', <class 'RowFormatProperty'>: 'ROW_FORMAT', <class 'SortKeyProperty'>: 'SORTKEY', <class 'EncodeProperty'>: 'ENCODE', <class 'IncludeProperty'>: 'INCLUDE'}
Location: ClassVar[type[PropertiesLocation]] = <enum 'PropertiesLocation'>
@classmethod
def from_dict(cls, properties_dict: dict) -> Properties:
684    @classmethod
685    def from_dict(cls, properties_dict: dict) -> Properties:
686        expressions = []
687        for key, value in properties_dict.items():
688            property_cls = cls.NAME_TO_PROPERTY.get(key.upper())
689            if property_cls:
690                expressions.append(property_cls(this=convert(value)))
691            else:
692                expressions.append(Property(this=Literal.string(key), value=convert(value)))
693
694        return cls(expressions=expressions)
key: ClassVar[str] = 'properties'
required_args: 't.ClassVar[set[str]]' = {'expressions'}