@@ -20,6 +20,37 @@ class DatabricksDDLCompiler(compiler.DDLCompiler):
2020def post_create_table (self ,table ):
2121return " USING DELTA"
2222
23+ def get_column_specification (self ,column ,** kwargs ):
24+ colspec = (
25+ self .preparer .format_column (column )
26+ + " "
27+ + self .dialect .type_compiler .process (
28+ column .type ,type_expression = column
29+ )
30+ )
31+
32+ # TODO: debugging line
33+ print (colspec )
34+
35+ default = self .get_column_default_string (column )
36+ if default is not None :
37+ colspec += " DEFAULT " + default
38+
39+ if column .computed is not None :
40+ colspec += " " + self .process (column .computed )
41+
42+ if (
43+ column .identity is not None
44+ and self .dialect .supports_identity_columns
45+ ):
46+ colspec += " " + self .process (column .identity )
47+
48+ if not column .nullable and (
49+ not column .identity or not self .dialect .supports_identity_columns
50+ ):
51+ colspec += " NOT NULL"
52+ return colspec
53+
2354def visit_set_column_comment (self ,create ,** kw ):
2455"""
2556 Example syntax for adding column comment:
@@ -114,12 +145,12 @@ def visit_create_table(self, create, **kw):
114145from_ = ce ,
115146 )
116147
117- print (type (create_column ))
118- print (create_column )
119- print (type (column ))
120- print (column )
148+ # print(type(create_column))
149+ # print(create_column)
150+ # print(type(column))
151+ # print(column)
121152# print(dir(column))
122- print (column .kwargs )
153+ # print(column.kwargs)
123154
124155# Check column.kwargs
125156