Skip to content

Commit ca52826

Browse files
authored
YDB FQ: tests for JsonDocument support (#11558)
1 parent 48e742f commit ca52826

File tree

13 files changed

+66
-10
lines changed

13 files changed

+66
-10
lines changed

ydb/library/yql/providers/generic/connector/tests/datasource/clickhouse/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ services:
1515
- ./init:/docker-entrypoint-initdb.d
1616
fq-connector-go:
1717
container_name: fq-tests-ch-fq-connector-go
18-
image: ghcr.io/ydb-platform/fq-connector-go:v0.5.11-rc.6@sha256:15d3cf4ca55c11dbee4661c039eca8248e1eff0796630d325d3028a8d7af372a
18+
image: ghcr.io/ydb-platform/fq-connector-go:v0.5.12-rc.2@sha256:84bb0b19f16f354b8a9ef7a020ee80f3ba7dc28db92f7007f235241153025b8a
1919
ports:
2020
- 2130
2121
volumes:

ydb/library/yql/providers/generic/connector/tests/datasource/ms_sql_server/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
fq-connector-go:
33
container_name: fq-tests-mssql-fq-connector-go
4-
image: ghcr.io/ydb-platform/fq-connector-go:v0.5.11-rc.6@sha256:15d3cf4ca55c11dbee4661c039eca8248e1eff0796630d325d3028a8d7af372a
4+
image: ghcr.io/ydb-platform/fq-connector-go:v0.5.12-rc.2@sha256:84bb0b19f16f354b8a9ef7a020ee80f3ba7dc28db92f7007f235241153025b8a
55
ports:
66
- 2130
77
volumes:

ydb/library/yql/providers/generic/connector/tests/datasource/mysql/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
fq-connector-go:
33
container_name: fq-tests-mysql-fq-connector-go
4-
image: ghcr.io/ydb-platform/fq-connector-go:v0.5.11-rc.6@sha256:15d3cf4ca55c11dbee4661c039eca8248e1eff0796630d325d3028a8d7af372a
4+
image: ghcr.io/ydb-platform/fq-connector-go:v0.5.12-rc.2@sha256:84bb0b19f16f354b8a9ef7a020ee80f3ba7dc28db92f7007f235241153025b8a
55
ports:
66
- 2130
77
volumes:

ydb/library/yql/providers/generic/connector/tests/datasource/oracle/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
fq-connector-go:
33
container_name: fq-tests-oracle-fq-connector-go
4-
image: ghcr.io/ydb-platform/fq-connector-go:v0.5.11-rc.6@sha256:15d3cf4ca55c11dbee4661c039eca8248e1eff0796630d325d3028a8d7af372a
4+
image: ghcr.io/ydb-platform/fq-connector-go:v0.5.12-rc.2@sha256:84bb0b19f16f354b8a9ef7a020ee80f3ba7dc28db92f7007f235241153025b8a
55
ports:
66
- 2130
77
volumes:

ydb/library/yql/providers/generic/connector/tests/datasource/postgresql/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
fq-connector-go:
33
container_name: fq-tests-pg-fq-connector-go
4-
image: ghcr.io/ydb-platform/fq-connector-go:v0.5.11-rc.6@sha256:15d3cf4ca55c11dbee4661c039eca8248e1eff0796630d325d3028a8d7af372a
4+
image: ghcr.io/ydb-platform/fq-connector-go:v0.5.12-rc.2@sha256:84bb0b19f16f354b8a9ef7a020ee80f3ba7dc28db92f7007f235241153025b8a
55
ports:
66
- 2130
77
volumes:

ydb/library/yql/providers/generic/connector/tests/datasource/ydb/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ services:
88
dnsmasq;
99
/opt/ydb/bin/fq-connector-go server -c /opt/ydb/cfg/fq-connector-go.yaml"
1010
container_name: fq-tests-ydb-fq-connector-go
11-
image: ghcr.io/ydb-platform/fq-connector-go:v0.5.11-rc.6@sha256:15d3cf4ca55c11dbee4661c039eca8248e1eff0796630d325d3028a8d7af372a
11+
image: ghcr.io/ydb-platform/fq-connector-go:v0.5.12-rc.2@sha256:84bb0b19f16f354b8a9ef7a020ee80f3ba7dc28db92f7007f235241153025b8a
1212
ports:
1313
- 2130
1414
volumes:

ydb/library/yql/providers/generic/connector/tests/datasource/ydb/init/01_basic.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,18 @@ set -ex
168168
COMMIT;
169169
'
170170

171+
# YQ-3494
172+
/ydb -p ${PROFILE} yql -s "
173+
CREATE TABLE json_document (
174+
col_00_id INT32 NOT NULL,
175+
col_01_data JsonDocument NOT NULL,
176+
PRIMARY KEY (col_00_id)
177+
);
178+
COMMIT;
179+
INSERT INTO json_document (col_00_id, col_01_data) VALUES
180+
(1, JsonDocument('{\"key1\": \"value1\"}')),
181+
(2, JsonDocument('{\"key2\": \"value2\"}'));
182+
COMMIT;
183+
"
184+
171185
echo $(date +"%T.%6N") "SUCCESS"

ydb/library/yql/providers/generic/connector/tests/datasource/ydb/select_positive.py

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ def _unsupported_types(self) -> Sequence[TestCase]:
469469
),
470470
Column(
471471
name='col_01_interval',
472-
ydb_type=makeYdbTypeFromTypeID(Type.BOOL),
472+
ydb_type=makeYdbTypeFromTypeID(Type.INTERVAL),
473473
data_source_type=DataSourceType(ydb=types_ydb.Interval()),
474474
),
475475
),
@@ -557,6 +557,42 @@ def _json(self) -> Sequence[TestCase]:
557557
),
558558
]
559559

560+
def _json_document(self) -> TestCase:
561+
schema = Schema(
562+
columns=ColumnList(
563+
Column(
564+
name='col_00_id',
565+
ydb_type=makeYdbTypeFromTypeID(Type.INT32),
566+
data_source_type=DataSourceType(ydb=types_ydb.Int32().to_non_nullable()),
567+
),
568+
Column(
569+
name='col_01_data',
570+
ydb_type=makeYdbTypeFromTypeID(Type.JSON_DOCUMENT),
571+
data_source_type=DataSourceType(ydb=types_ydb.JsonDocument()),
572+
),
573+
),
574+
)
575+
576+
data_out = [
577+
['{"key1": "value1"}'],
578+
['{"key2": "value2"}'],
579+
]
580+
581+
return [
582+
TestCase(
583+
name_='json_document',
584+
data_in=None,
585+
data_out_=data_out,
586+
select_where=None,
587+
select_what=SelectWhat(SelectWhat.Item(name='col_01_data')),
588+
data_source_kind=EDataSourceKind.YDB,
589+
pragmas=dict(),
590+
protocol=EProtocol.NATIVE,
591+
schema=schema,
592+
# check_output_schema=True,
593+
)
594+
]
595+
560596
def make_test_cases(self) -> Sequence[TestCase]:
561597
return list(
562598
itertools.chain(
@@ -567,5 +603,6 @@ def make_test_cases(self) -> Sequence[TestCase]:
567603
self._pushdown(),
568604
self._unsupported_types(),
569605
self._json(),
606+
self._json_document(),
570607
)
571608
)

ydb/library/yql/providers/generic/connector/tests/datasource/ydb/test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"unsupported_types",
3232
"json",
3333
"dummy_table",
34+
"json_document",
3435
],
3536
)
3637

ydb/library/yql/providers/generic/connector/tests/join/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ services:
1515
- ./init/clickhouse:/docker-entrypoint-initdb.d
1616
fq-connector-go:
1717
container_name: fq-tests-join-fq-connector-go
18-
image: ghcr.io/ydb-platform/fq-connector-go:v0.5.11-rc.6@sha256:15d3cf4ca55c11dbee4661c039eca8248e1eff0796630d325d3028a8d7af372a
18+
image: ghcr.io/ydb-platform/fq-connector-go:v0.5.12-rc.2@sha256:84bb0b19f16f354b8a9ef7a020ee80f3ba7dc28db92f7007f235241153025b8a
1919
ports:
2020
- 2130
2121
volumes:

0 commit comments

Comments
 (0)