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