Skip to content

Commit

Permalink
Chore: remove unused tableformat property
Browse files Browse the repository at this point in the history
  • Loading branch information
tobymao committed May 18, 2023
1 parent 6e0b81a commit 95b29a1
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 10 deletions.
1 change: 0 additions & 1 deletion sqlglot/dialects/presto.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ class Generator(generator.Generator):
exp.StrToUnix: lambda self, e: f"TO_UNIXTIME(DATE_PARSE({self.sql(e, 'this')}, {self.format_time(e)}))",
exp.StructExtract: struct_extract_sql,
exp.Table: transforms.preprocess([_unnest_sequence]),
exp.TableFormatProperty: lambda self, e: f"TABLE_FORMAT='{e.name.upper()}'",
exp.TimestampTrunc: timestamptrunc_sql,
exp.TimeStrToDate: timestrtotime_sql,
exp.TimeStrToTime: timestrtotime_sql,
Expand Down
5 changes: 0 additions & 5 deletions sqlglot/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1956,10 +1956,6 @@ class StabilityProperty(Property):
arg_types = {"this": True}


class TableFormatProperty(Property):
arg_types = {"this": True}


class TemporaryProperty(Property):
arg_types = {"global_": True}

Expand Down Expand Up @@ -2001,7 +1997,6 @@ class Properties(Expression):
"RETURNS": ReturnsProperty,
"ROW_FORMAT": RowFormatProperty,
"SORTKEY": SortKeyProperty,
"TABLE_FORMAT": TableFormatProperty,
}

PROPERTY_TO_NAME = {v: k for k, v in NAME_TO_PROPERTY.items()}
Expand Down
1 change: 0 additions & 1 deletion sqlglot/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ class Generator:
exp.SortKeyProperty: exp.Properties.Location.POST_SCHEMA,
exp.SqlSecurityProperty: exp.Properties.Location.POST_CREATE,
exp.StabilityProperty: exp.Properties.Location.POST_SCHEMA,
exp.TableFormatProperty: exp.Properties.Location.POST_WITH,
exp.TemporaryProperty: exp.Properties.Location.POST_CREATE,
exp.TransientProperty: exp.Properties.Location.POST_CREATE,
exp.MergeTreeTTL: exp.Properties.Location.POST_SCHEMA,
Expand Down
1 change: 0 additions & 1 deletion sqlglot/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,6 @@ class Parser(metaclass=_Parser):
exp.StabilityProperty, this=exp.Literal.string("STABLE")
),
"STORED": lambda self: self._parse_stored(),
"TABLE_FORMAT": lambda self: self._parse_property_assignment(exp.TableFormatProperty),
"TBLPROPERTIES": lambda self: self._parse_wrapped_csv(self._parse_property),
"TEMP": lambda self: self._parse_temporary(global_=False),
"TEMPORARY": lambda self: self._parse_temporary(global_=False),
Expand Down
2 changes: 0 additions & 2 deletions tests/test_expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,6 @@ def test_properties_from_dict(self):
"FORMAT": "parquet",
"PARTITIONED_BY": (exp.to_identifier("a"), exp.to_identifier("b")),
"custom": 1,
"TABLE_FORMAT": exp.to_identifier("test_format"),
"ENGINE": None,
"COLLATE": True,
}
Expand All @@ -624,7 +623,6 @@ def test_properties_from_dict(self):
this=exp.Tuple(expressions=[exp.to_identifier("a"), exp.to_identifier("b")])
),
exp.Property(this=exp.Literal.string("custom"), value=exp.Literal.number(1)),
exp.TableFormatProperty(this=exp.to_identifier("test_format")),
exp.EngineProperty(this=exp.null()),
exp.CollateProperty(this=exp.true()),
]
Expand Down

0 comments on commit 95b29a1

Please sign in to comment.