fix: doris_conn cannot get table comment to store vectordb (#2490)

Co-authored-by: Zhihe.Liu <zhihe.liu@majorbio.com>
This commit is contained in:
TenYearOldJAVA 2025-03-21 10:54:02 +08:00 committed by GitHub
parent 52e41bccc9
commit 3ce3be65b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -201,6 +201,21 @@ class DorisConnector(RDBMSConnector):
tables = cursor.fetchall()
return [(table[0], table[1]) for table in tables]
def get_table_comment(self, table_name=None):
"""Get table comment."""
cursor = self.get_session().execute(
text(
f"SELECT TABLE_COMMENT "
f"FROM information_schema.tables "
f"where TABLE_NAME={table_name} and TABLE_SCHEMA=database()"
)
)
table_comment = cursor.fetchone()
if table_comment:
return {"text": str(table_comment[0])}
else:
return {"text": None}
def get_database_names(self):
"""Get database names."""
with self.session_scope() as session: