[BugFix] starrocks-python-client: Correct DDL generation for ARRAY type in SQLAlchemy dialect (#61796)
Co-authored-by: Jan Link <link@gipmbh.de>
This commit is contained in:
parent
fb3c1fbeb3
commit
5395808681
|
|
@ -54,6 +54,10 @@ class PERCENTILE(sqltypes.Numeric):
|
|||
class ARRAY(TypeEngine):
|
||||
__visit_name__ = "ARRAY"
|
||||
|
||||
def __init__(self, item_type, **kwargs):
|
||||
self.item_type = item_type
|
||||
super().__init__(**kwargs)
|
||||
|
||||
@property
|
||||
def python_type(self) -> Optional[Type[List[Any]]]:
|
||||
return list
|
||||
|
|
|
|||
|
|
@ -110,7 +110,9 @@ class StarRocksTypeCompiler(MySQLTypeCompiler):
|
|||
return "LARGEINT"
|
||||
|
||||
def visit_ARRAY(self, type_, **kw):
|
||||
return "ARRAY<type>"
|
||||
"""Compiles the ARRAY type into the correct StarRocks syntax."""
|
||||
inner_type_sql = self.process(type_.item_type, **kw)
|
||||
return f"ARRAY<{inner_type_sql}>"
|
||||
|
||||
def visit_MAP(self, type_, **kw):
|
||||
return "MAP<keytype,valuetype>"
|
||||
|
|
|
|||
Loading…
Reference in New Issue