[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:
janlink 2025-08-13 02:23:33 +02:00 committed by GitHub
parent fb3c1fbeb3
commit 5395808681
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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>"