Skip to content

Commit fb3ec66

Browse files
tkiliasckunki
andauthored
#351: Added test for UDF with builtin Script-Language Container and fixed it for Docker-DB 8.18.1 (#352)
Co-authored-by: KK <[email protected]>
1 parent 890ed76 commit fb3ec66

File tree

8 files changed

+70
-6
lines changed

8 files changed

+70
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ Pipfile.lock
88
.build_output/
99
dist/
1010
.vagrant
11+
TAGS

doc/changes/changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Changes
22

3+
* [1.7.1](changes_1.7.1.md)
34
* [1.7.0](changes_1.7.0.md)
45
* [1.6.0](changes_1.6.0.md)
56
* [1.5.0](changes_1.5.0.md)
@@ -27,6 +28,7 @@
2728
---
2829
hidden:
2930
---
31+
changes_1.7.1
3032
changes_1.7.0
3133
changes_1.6.0
3234
changes_1.5.0

doc/changes/changes_1.7.1.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Integration-Test-Docker-Environment 1.7.1, released 2023-06-19
2+
3+
## Summary
4+
5+
This release fixes the not working UDFs in Exasol Docker-DB 8.18.1.
6+
7+
### Supported Exasol Versions
8+
9+
* **7.0**: up to 7.0.20, **except 7.0.5**
10+
* **7.1**: up to 7.1.17
11+
* **8**: 8.18.1
12+
13+
If you need further versions, please open an issue.
14+
15+
## Internal
16+
17+
## Changes
18+
19+
* #351: Added test for UDF with builtin Script-Language Container and fixed it for Docker-DB 8.18.1

docker_db_config_template/8.18.1/EXAConf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@
171171
BuiltinScriptLanguageName = slc-6.0.0-c4-5-standard-EXASOL-8.0.0/ScriptLanguages-standard-EXASOL-8.0.0-slc-v6.0.0-PB5EHDLN
172172
AutoStart = True
173173
{% if additional_db_parameters %}
174-
Params = {{ additional_db_parameters }}
174+
Params = -sandboxCHROOT=/opt/exasol/cos-8.29.2/sbin/nsexec_chroot {{ additional_db_parameters }}
175+
{% else %}
176+
Params = -sandboxCHROOT=/opt/exasol/cos-8.29.2/sbin/nsexec_chroot
175177
{% endif %}
176178

177179
# JDBC driver configuration

exasol_integration_test_docker_environment/docker_db_config/8.18.1/EXAConf

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

poetry.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ packages = [
44
{ include = "exasol_integration_test_docker_environment" },
55
{ include = "pytest_itde" }
66
]
7-
version = "1.7.0"
7+
version = "1.7.1"
88
description = "Integration Test Docker Environment for Exasol"
99

1010
license = "MIT"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import pyexasol
2+
3+
from inspect import cleandoc
4+
from time import sleep
5+
6+
from exasol_integration_test_docker_environment.lib.test_environment.db_version import DbVersion
7+
8+
9+
def test_udf_execution(api_database):
10+
def wait_until_container_is_unpacked():
11+
sleep(5 * 60)
12+
13+
def udf_sql(schema: str) -> str:
14+
return cleandoc(
15+
f"""
16+
--/
17+
CREATE OR REPLACE PYTHON3 SCALAR SCRIPT
18+
{schema}.python3_test_udf(count INT)
19+
EMITS (outp INT) AS
20+
import os
21+
22+
def run(ctx):
23+
for i in range(ctx.count):
24+
ctx.emit(i)
25+
/
26+
"""
27+
)
28+
29+
with api_database() as db:
30+
dbinfo = db.environment_info.database_info
31+
dsn = f"{dbinfo.host}:{dbinfo.db_port}"
32+
connection = pyexasol.connect(dsn=dsn, user="sys", password="exasol")
33+
if DbVersion.from_db_version_str(db.docker_db_image_version).major == 7:
34+
wait_until_container_is_unpacked()
35+
connection.execute("CREATE SCHEMA IF NOT EXISTS S")
36+
connection.execute(udf_sql(schema="S"))
37+
result = connection.execute("SELECT S.python3_test_udf(10)").fetchall()
38+
assert result == [(i,) for i in range(10)]

0 commit comments

Comments
 (0)