Fix E2E Vertica & System Metric (#11525)

This commit is contained in:
Mayur Singal 2023-05-10 17:35:55 +05:30 committed by GitHub
parent cefce47ca4
commit f7a0d3f5f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 18 deletions

View File

@ -28,34 +28,37 @@ import textwrap
# v_catalog.comments with v_catalog.columns.
VERTICA_GET_COLUMNS = textwrap.dedent(
"""
WITH
column_projection as
(SELECT
column_name,
data_type,
column_default,
is_nullable,
table_name,
table_schema,
WITH column_projection as (
SELECT
column_id,
proj.projection_name
FROM v_catalog.columns col,
v_catalog.projections proj
where proj.projection_id in (select
where lower(table_name) = '{table}'
AND {schema_condition}
AND proj.projection_id in (
select
min(projection_id)
from v_catalog.projections sub_proj
where col.table_id=sub_proj.anchor_table_id
from v_catalog.projections sub_proj
where col.table_id=sub_proj.anchor_table_id
))
select
column_name,
data_type,
column_default,
is_nullable,
comment from column_projection col
LEFT JOIN v_catalog.comments com
ON com.object_type = 'COLUMN'
AND com.object_name = CONCAT(CONCAT(col.projection_name,'.'),col.column_name)
WHERE lower(table_name) = '{table}'
AND {schema_condition}
comment
from
v_catalog.columns col
LEFT JOIN column_projection proj ON proj.column_id = col.column_id
LEFT JOIN v_catalog.comments com ON com.object_type = 'COLUMN'
AND com.object_name = CONCAT(
CONCAT(proj.projection_name, '.'),
col.column_name
)
WHERE
lower(table_name) = '{table}'
AND {schema_condition}
UNION ALL
SELECT
column_name,

View File

@ -12,6 +12,7 @@
"""
Test database connectors with CLI
"""
import time
from abc import abstractmethod
from typing import List, Optional
from unittest import TestCase
@ -224,6 +225,9 @@ class CliDBBase(TestCase):
)
self.delete_table_rows()
self.update_table_row()
# Add 10 second delay for system
# tables to register the change
time.sleep(10)
result = self.run_command("profile")
sink_status, source_status = self.retrieve_statuses(result)
self.assert_for_system_metrics(source_status, sink_status)