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