Skip to content

Commit

Permalink
antlr changes to include table properties
Browse files Browse the repository at this point in the history
  • Loading branch information
sriram251-code committed Dec 24, 2024
1 parent 21da02a commit 8b7bb16
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,8 @@ def format_time(self, expression: exp.Expression, inverse_time_mapping=None, inv
def create_sql(self, expression: exp.Create) -> str:
expression.args["indexes"] = None # Removing indexes from create statement
create_sql = super().create_sql(expression)
for from_ in expression.find_all(
exp.DefaultColumnConstraint
): # Generate table properties if DDL contain default values
create_sql = create_sql + " TBLPROPERTIES ('delta.feature.allowColumnDefaults' = 'supported')"
break
if expression.find(exp.DefaultColumnConstraint):
create_sql += " TBLPROPERTIES ('delta.feature.allowColumnDefaults' = 'supported')"
return create_sql

def join_sql(self, expression: exp.Join) -> str:
Expand Down

0 comments on commit 8b7bb16

Please sign in to comment.