Skip to content

Commit

Permalink
apply suggestions from review
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmax2004 committed Jan 15, 2024
1 parent a573b0c commit f01e0c0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 17 deletions.
4 changes: 2 additions & 2 deletions ydb/tests/fq/generic/clickhouse/init.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CREATE TABLE db.simple_table (number INT) ENGINE = Log();
INSERT INTO db.simple_table VALUES ((1)), ((2)), ((3));

CREATE TABLE db.join_table (id INT, data INT) ENGINE = Log();
INSERT INTO db.join_table VALUES (1, 10), (2, 20), (3, 30);
CREATE TABLE db.join_table (id INT, data String) ENGINE = Log();
INSERT INTO db.join_table VALUES (1, 'ch10'), (2, 'ch20'), (3, 'ch30');
4 changes: 2 additions & 2 deletions ydb/tests/fq/generic/postgresql/init.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CREATE TABLE simple_table (number INT);
INSERT INTO simple_table VALUES ((1)), ((2)), ((3));

CREATE TABLE join_table (id INT, data INT);
INSERT INTO join_table VALUES (1, 10), (2, 20), (3, 30);
CREATE TABLE join_table (id INT, data bytea);
INSERT INTO join_table VALUES (1, 'pg10'), (2, 'pg20'), (3, 'pg30');
12 changes: 6 additions & 6 deletions ydb/tests/fq/generic/test_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def test_simple(self, fq_client: FederatedQueryClient, settings: Settings):
assert result_set.columns[0].name == "data_pg"
assert result_set.columns[1].name == "data_ch"
assert len(result_set.rows) == 3
assert result_set.rows[0].items[0].int32_value == 10
assert result_set.rows[0].items[1].int32_value == 10
assert result_set.rows[1].items[0].int32_value == 20
assert result_set.rows[1].items[1].int32_value == 20
assert result_set.rows[2].items[0].int32_value == 30
assert result_set.rows[2].items[1].int32_value == 30
assert result_set.rows[0].items[0].bytes_value == b'pg10'
assert result_set.rows[0].items[1].bytes_value == b'ch10'
assert result_set.rows[1].items[0].bytes_value == b'pg20'
assert result_set.rows[1].items[1].bytes_value == b'ch20'
assert result_set.rows[2].items[0].bytes_value == b'pg30'
assert result_set.rows[2].items[1].bytes_value == b'ch30'
16 changes: 10 additions & 6 deletions ydb/tests/fq/generic/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ PY3TEST()
STYLE_PYTHON()
NO_CHECK_IMPORTS()

SIZE(LARGE)

TAG(
ya:external
ya:force_sandbox
Expand All @@ -24,6 +22,16 @@ INCLUDE(${ARCADIA_ROOT}/ydb/tests/tools/token_accessor_mock/recipe.inc)
INCLUDE(${ARCADIA_ROOT}/ydb/tests/tools/fq_runner/ydb_runner_with_datastreams.inc)
INCLUDE(${ARCADIA_ROOT}/library/recipes/docker_compose/recipe.inc)

# Including of docker_compose/recipe.inc automatically converts these tests into LARGE,
# which makes it impossible to run them during precommit checks on Github CI.
# Next several lines forces these tests to be MEDIUM. To see discussion, visit YDBOPS-8928.

IF (OPENSOURCE)
SIZE(MEDIUM)
SET(TEST_TAGS_VALUE)
SET(TEST_REQUIREMENTS_VALUE)
ENDIF()

PEERDIR(
ydb/tests/fq/generic/utils

Expand All @@ -37,10 +45,6 @@ PEERDIR(
contrib/python/pytest
)

DEPENDS(
contrib/python/moto/bin
)

TEST_SRCS(
conftest.py
test_clickhouse.py
Expand Down
4 changes: 3 additions & 1 deletion ydb/tests/tools/fq_runner/kikimr_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class ConnectorExtension(ExtensionPoint):

def __init__(self, host, port, use_ssl):
ConnectorExtension.__init__.__annotations__ = {
'host' : str,
'host': str,
'port': int,
'use_ssl': bool,
'return': None
Expand Down Expand Up @@ -295,7 +295,9 @@ def is_applicable(self, request):

def apply_to_kikimr(self, request, kikimr):
kikimr.compute_plane.qs_config['mdb_transform_host'] = False
kikimr.compute_plane.qs_config['generic']['mdb_gateway'] = self.endpoint

kikimr.compute_plane.fq_config['common']['mdb_transform_host'] = False
kikimr.compute_plane.fq_config['common']['mdb_gateway'] = self.endpoint # v2
kikimr.compute_plane.fq_config['gateways']['generic']['mdb_gateway'] = self.endpoint # v1

Expand Down

0 comments on commit f01e0c0

Please sign in to comment.