Fix Vertica column fetch query (#11424)

* Fix vertica column fetch query

* fix timestamp datatype
This commit is contained in:
Mayur Singal 2023-05-04 13:37:00 +05:30 committed by GitHub
parent 186eb252d7
commit 3f65c8ab0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View File

@ -145,16 +145,12 @@ def _get_column_info( # pylint: disable=too-many-locals,too-many-branches,too-m
args = () args = ()
elif attype in ("timestamptz", "timetz"): elif attype in ("timestamptz", "timetz"):
kwargs["timezone"] = True kwargs["timezone"] = True
if charlen:
kwargs["precision"] = int(charlen)
args = () args = ()
elif attype in ( elif attype in (
"timestamp", "timestamp",
"time", "time",
): ):
kwargs["timezone"] = False kwargs["timezone"] = False
if charlen:
kwargs["precision"] = int(charlen)
args = () args = ()
elif attype.startswith("interval"): elif attype.startswith("interval"):
field_match = re.match(r"interval (.+)", attype, re.I) field_match = re.match(r"interval (.+)", attype, re.I)

View File

@ -35,7 +35,8 @@ VERTICA_GET_COLUMNS = textwrap.dedent(
FROM v_catalog.columns col FROM v_catalog.columns col
LEFT JOIN v_catalog.comments com LEFT JOIN v_catalog.comments com
ON com.object_type = 'COLUMN' ON com.object_type = 'COLUMN'
AND com.object_name LIKE CONCAT(CONCAT(col.table_name, '_%.'), col.column_name) AND com.object_id = col.table_id
AND com.child_object = col.column_name
WHERE lower(table_name) = '{table}' WHERE lower(table_name) = '{table}'
AND {schema_condition} AND {schema_condition}
UNION ALL UNION ALL