Skip to content

Commit

Permalink
#351: Added test for UDF with builtin Script-Language Container and f…
Browse files Browse the repository at this point in the history
…ixed it for Docker-DB 8.18.1 (#352)

Co-authored-by: KK <[email protected]>
  • Loading branch information
tkilias and ckunki authored Jun 19, 2023
1 parent 890ed76 commit fb3ec66
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Pipfile.lock
.build_output/
dist/
.vagrant
TAGS
2 changes: 2 additions & 0 deletions doc/changes/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changes

* [1.7.1](changes_1.7.1.md)
* [1.7.0](changes_1.7.0.md)
* [1.6.0](changes_1.6.0.md)
* [1.5.0](changes_1.5.0.md)
Expand Down Expand Up @@ -27,6 +28,7 @@
---
hidden:
---
changes_1.7.1
changes_1.7.0
changes_1.6.0
changes_1.5.0
Expand Down
19 changes: 19 additions & 0 deletions doc/changes/changes_1.7.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Integration-Test-Docker-Environment 1.7.1, released 2023-06-19

## Summary

This release fixes the not working UDFs in Exasol Docker-DB 8.18.1.

### Supported Exasol Versions

* **7.0**: up to 7.0.20, **except 7.0.5**
* **7.1**: up to 7.1.17
* **8**: 8.18.1

If you need further versions, please open an issue.

## Internal

## Changes

* #351: Added test for UDF with builtin Script-Language Container and fixed it for Docker-DB 8.18.1
4 changes: 3 additions & 1 deletion docker_db_config_template/8.18.1/EXAConf
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@
BuiltinScriptLanguageName = slc-6.0.0-c4-5-standard-EXASOL-8.0.0/ScriptLanguages-standard-EXASOL-8.0.0-slc-v6.0.0-PB5EHDLN
AutoStart = True
{% if additional_db_parameters %}
Params = {{ additional_db_parameters }}
Params = -sandboxCHROOT=/opt/exasol/cos-8.29.2/sbin/nsexec_chroot {{ additional_db_parameters }}
{% else %}
Params = -sandboxCHROOT=/opt/exasol/cos-8.29.2/sbin/nsexec_chroot
{% endif %}

# JDBC driver configuration
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ packages = [
{ include = "exasol_integration_test_docker_environment" },
{ include = "pytest_itde" }
]
version = "1.7.0"
version = "1.7.1"
description = "Integration Test Docker Environment for Exasol"

license = "MIT"
Expand Down
38 changes: 38 additions & 0 deletions test/integration/test_udf_execution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import pyexasol

from inspect import cleandoc
from time import sleep

from exasol_integration_test_docker_environment.lib.test_environment.db_version import DbVersion


def test_udf_execution(api_database):
def wait_until_container_is_unpacked():
sleep(5 * 60)

def udf_sql(schema: str) -> str:
return cleandoc(
f"""
--/
CREATE OR REPLACE PYTHON3 SCALAR SCRIPT
{schema}.python3_test_udf(count INT)
EMITS (outp INT) AS
import os
def run(ctx):
for i in range(ctx.count):
ctx.emit(i)
/
"""
)

with api_database() as db:
dbinfo = db.environment_info.database_info
dsn = f"{dbinfo.host}:{dbinfo.db_port}"
connection = pyexasol.connect(dsn=dsn, user="sys", password="exasol")
if DbVersion.from_db_version_str(db.docker_db_image_version).major == 7:
wait_until_container_is_unpacked()
connection.execute("CREATE SCHEMA IF NOT EXISTS S")
connection.execute(udf_sql(schema="S"))
result = connection.execute("SELECT S.python3_test_udf(10)").fetchall()
assert result == [(i,) for i in range(10)]

0 comments on commit fb3ec66

Please sign in to comment.