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