-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
158 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
ydb/library/yql/providers/generic/connector/tests/datasource/postgresql/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM ghcr.io/ydb-platform/fq-connector-go_greenplum:6.25.3@sha256:0627a657b179ff73949fec05201f3e164b92639281eff248cd07669ce7247eec | ||
|
||
# For the sake of simplicity of tests, we force Greenplum to use the same port that it uses within MDB | ||
RUN find /data -type f -exec sed -i 's/5432/6432/' "{}" +; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Docker image built from this Dockerfile is pushed as `ghcr.io/ydb-platform/fq-connector-go_greenplum:6.25.3-6432@sha256:9e862b05719b289b447562fbce6c003916a764a549f924a4175eecd7e7891a0b`. No need to rebuild them every time. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
psql -p 6432 -v ON_ERROR_STOP=1 --username gpadmin --dbname template1 <<-EOSQL | ||
CREATE TABLE simple_table (number INT); | ||
INSERT INTO simple_table VALUES ((3)), ((14)), ((15)); | ||
CREATE TABLE join_table (id INT, data bytea); | ||
INSERT INTO join_table VALUES (1, 'gp10'), (2, 'gp20'), (3, 'gp30'); | ||
EOSQL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import logging | ||
import pytest | ||
|
||
import ydb.public.api.protos.draft.fq_pb2 as fq | ||
import ydb.public.api.protos.ydb_value_pb2 as ydb | ||
from ydb.tests.tools.fq_runner.kikimr_utils import yq_v2 | ||
|
||
from ydb.tests.tools.fq_runner.fq_client import FederatedQueryClient | ||
from ydb.tests.fq.generic.utils.settings import Settings | ||
|
||
|
||
class TestGreenplum: | ||
@yq_v2 | ||
@pytest.mark.parametrize("fq_client", [{"folder_id": "my_folder"}], indirect=True) | ||
def test_simple(self, fq_client: FederatedQueryClient, settings: Settings): | ||
table_name = "simple_table" | ||
conn_name = f"conn_{table_name}" | ||
query_name = f"query_{table_name}" | ||
|
||
fq_client.create_greenplum_connection( | ||
name=conn_name, | ||
database_name=settings.greenplum.dbname, | ||
database_id="greenplum_cluster_id", | ||
login=settings.greenplum.username, | ||
password=settings.greenplum.password, | ||
) | ||
|
||
sql = Rf""" | ||
SELECT * | ||
FROM {conn_name}.{table_name} ORDER BY number; | ||
""" | ||
|
||
query_id = fq_client.create_query(query_name, sql, type=fq.QueryContent.QueryType.ANALYTICS).result.query_id | ||
fq_client.wait_query_status(query_id, fq.QueryMeta.COMPLETED) | ||
|
||
data = fq_client.get_result_data(query_id) | ||
result_set = data.result.result_set | ||
logging.debug(str(result_set)) | ||
assert len(result_set.columns) == 1 | ||
assert result_set.columns[0].name == "number" | ||
assert result_set.columns[0].type == ydb.Type( | ||
optional_type=ydb.OptionalType(item=ydb.Type(type_id=ydb.Type.INT32)) | ||
) | ||
assert len(result_set.rows) == 3 | ||
assert result_set.rows[0].items[0].int32_value == 3 | ||
assert result_set.rows[1].items[0].int32_value == 14 | ||
assert result_set.rows[2].items[0].int32_value == 15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters