-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#351: Added test for UDF with builtin Script-Language Container and f…
…ixed it for Docker-DB 8.18.1 (#352) Co-authored-by: KK <[email protected]>
- Loading branch information
Showing
8 changed files
with
70 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ Pipfile.lock | |
.build_output/ | ||
dist/ | ||
.vagrant | ||
TAGS |
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,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 |
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
4 changes: 3 additions & 1 deletion
4
exasol_integration_test_docker_environment/docker_db_config/8.18.1/EXAConf
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,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)] |