Skip to content

Commit c4e8103

Browse files
Enable delta.feature.allowColumnDefaults for all tables (#343)
* Enable `delta.feature.allowColumnDefaults` for all tables * Code style Signed-off-by: Levko Kravets <[email protected]> --------- Signed-off-by: Levko Kravets <[email protected]> Co-authored-by: Levko Kravets <[email protected]>
1 parent a6212b6 commit c4e8103

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/databricks/sqlalchemy/_ddl.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ def __init__(self, dialect):
1616

1717
class DatabricksDDLCompiler(compiler.DDLCompiler):
1818
def post_create_table(self, table):
19-
post = " USING DELTA"
19+
post = [" USING DELTA"]
2020
if table.comment:
2121
comment = self.sql_compiler.render_literal_value(
2222
table.comment, sqltypes.String()
2323
)
24-
post += " COMMENT " + comment
25-
return post
24+
post.append("COMMENT " + comment)
25+
26+
post.append("TBLPROPERTIES('delta.feature.allowColumnDefaults' = 'enabled')")
27+
return "\n".join(post)
2628

2729
def visit_unique_constraint(self, constraint, **kw):
2830
logger.warning("Databricks does not support unique constraints")

0 commit comments

Comments
 (0)