Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit04e30af

Browse files
committed
get_column_config added for debugging
1 parentbdea73a commit04e30af

File tree

1 file changed

+36
-5
lines changed
  • src/databricks/sqlalchemy/dialect

1 file changed

+36
-5
lines changed

‎src/databricks/sqlalchemy/dialect/base.py‎

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,37 @@ class DatabricksDDLCompiler(compiler.DDLCompiler):
2020
defpost_create_table(self,table):
2121
return" USING DELTA"
2222

23+
defget_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+
ifdefaultisnotNone:
37+
colspec+=" DEFAULT "+default
38+
39+
ifcolumn.computedisnotNone:
40+
colspec+=" "+self.process(column.computed)
41+
42+
if (
43+
column.identityisnotNone
44+
andself.dialect.supports_identity_columns
45+
):
46+
colspec+=" "+self.process(column.identity)
47+
48+
ifnotcolumn.nullableand (
49+
notcolumn.identityornotself.dialect.supports_identity_columns
50+
):
51+
colspec+=" NOT NULL"
52+
returncolspec
53+
2354
defvisit_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):
114145
from_=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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp