Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#190 enabled to generate a dynamic module for custom udf #202

Merged

Conversation

ckunki
Copy link
Contributor

@ckunki ckunki commented Oct 21, 2024

Closes #190

ahsimb
ahsimb previously approved these changes Oct 24, 2024

AAF contains some generated files that are committed to git, including:
* The amalgated Lua script [create_query_loop.sql](https://github.com/exasol/advanced-analytics-framework/blob/main/exasol_advanced_analytics_framework/resources/outputs/create_query_loop.sql)
* The examples in the user guide
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this still true

Copy link
Contributor Author

@ckunki ckunki Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - I removed the main instructions but forgot to update the bullet list.

See next push fixing the bullet list, too.

"parameter": "bla-bla",
"udf": {
"schema": "EXAMPLE_SCHEMA",
"name": "MY_QUERY_HANDLER_UDF"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we already run with the word example, should we use it everywhere (half a joke)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, during my experiments, I switched from MY_SCHEMA to MY_EXAMPLE to avoid false positive test results due to my test database being already partially initialized.

Should I replace the name MY_QUERY_HANDLER_UDF by EXAMPLE_QUERY_HANDLER_UDF?

--language-alias "$LANGUAGE_ALIAS"
```

The name of the database schema must match the schema when executing the script.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is unclear

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See next push.

code to add classes and functions to the module.
"""
mod = sys.modules.get(name)
if mod is None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, we actually should fail, when the module exists

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See next push.

from exasol_advanced_analytics_framework.udf_framework.query_handler_runner_udf \
import QueryHandlerRunnerUDF
```shell
ALTER SESSION SET SCRIPT_LANGUAGES='R=builtin_r JAVA=builtin_java PYTHON3=builtin_python3 PYTHON3_AAF=localzmq+protobuf:///bfsdefault/default/temp/exasol_advanced_analytics_framework_container_release?lang=python#/buckets/bfsdefault/default/temp/exasol_advanced_analytics_framework_container_release/exaudf/exaudfclient_py3';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I applied your proposal, @tkilias.
How about the assumptions?
Maybe we first try to identify all assumptions?

Thinking about it: maybe we can omit the ALTER SESSION statement, as all this is already done by the AAF deploy command?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See next push without ALTER SESSION command.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

- Renamed MY_QUERY_HANDLER_UDF to EXAMPLE_QUERY_HANDLER_UDF
- Renamed BFS_CON to EXAMPLE_BFS_CON
- Removed section "Activating the AAF SLC by Setting a Language Alias"
@ckunki ckunki merged commit 489e238 into main Oct 25, 2024
23 checks passed
@ckunki ckunki deleted the refactoring/#190-Enabled_to_generate_a_dynamic_module_for_custom_UDF branch October 25, 2024 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate dynamic module for custom UDF
4 participants