Skip to content

Commit

Permalink
Applied additional renamings
Browse files Browse the repository at this point in the history
* query.handler -> exasol/analytics/query_handler
* query_result -> exasol/analytics/query/handler/result
* exasol/analytics/deployment/ -> exasol.analytics.query_handler/deployment
* exasol/analytics/deploy.py -> exasol.analytics.query_handler/deployment/deploy.py
* exasol/analytics/slc.py -> exasol.analytics.query_handler/deployment/slc.py
  • Loading branch information
ckunki committed Nov 13, 2024
1 parent 8a848b2 commit 74bd145
Show file tree
Hide file tree
Showing 76 changed files with 183 additions and 191 deletions.
14 changes: 7 additions & 7 deletions doc/user_guide/example-udf-script/create.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ CREATE OR REPLACE PYTHON3_AAF SET SCRIPT "EXAMPLE_SCHEMA"."EXAMPLE_QUERY_HANDLER
EMITS (outputs VARCHAR(2000000)) AS

from typing import Union
from exasol.analytics.query.handler.udf.interface import UDFQueryHandler
from exasol.analytics.query_handler.udf.interface import UDFQueryHandler
from exasol.analytics.utils.dynamic_modules import create_module
from exasol.analytics.query.handler.context.query_handler_context import QueryHandlerContext
from exasol.analytics.query.result.query_result import QueryResult
from exasol.analytics.query.handler.result import Result, Continue, Finish
from exasol.analytics.query.handler.query.select import SelectQuery, SelectQueryWithColumnDefinition
from exasol.analytics.query.handler.context.proxy.bucketfs_location_proxy import BucketFSLocationProxy
from exasol.analytics.query_handler.context.query_handler_context import QueryHandlerContext
from exasol.analytics.query_handler.result.interface import QueryResult
from exasol.analytics.query_handler.result.impl import Result, Continue, Finish
from exasol.analytics.query_handler.query.select import SelectQuery, SelectQueryWithColumnDefinition
from exasol.analytics.query_handler.context.proxy.bucketfs_location_proxy import BucketFSLocationProxy
from exasol.analytics.schema import (
Column,
ColumnType,
Expand Down Expand Up @@ -78,7 +78,7 @@ class ExampleQueryHandlerFactory:

example_module.add_to_module(ExampleQueryHandlerFactory)

from exasol.analytics.query.handler.udf.runner.udf \
from exasol.analytics.query_handler.udf.runner.udf \
import QueryHandlerRunnerUDF

udf = QueryHandlerRunnerUDF(exa)
Expand Down
2 changes: 1 addition & 1 deletion doc/user_guide/proxies.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ An _Object Proxy_
* Provides a reference enabling using the object, i.e. its name incl. the database schema or the path in the BucketFS
* Ensures the object is removed when leaving the current scope, e.g. the Query Handler.

All Object Proxies are derived from class `exasol.analytics.query.handler.context.proxy.object_proxy.ObjectProxy`:
All Object Proxies are derived from class `exasol.analytics.query_handler.context.proxy.object_proxy.ObjectProxy`:
* `BucketFSLocationProxy` encapsulates a location in the BucketFS
* `DBObjectNameProxy` encapsulates a database object, e.g. a table

4 changes: 2 additions & 2 deletions doc/user_guide/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Running the AAF requires an SLC. The following command
* and registers it to the database.

```shell
python -m exasol.analytics.deploy language-container
python -m exasol.analytics.query_handler.deployment.deploy language-container
```

See the documentation in the Exasol Python Extension Common package for [options common to all Exasol extensions](https://github.com/exasol/python-extension-common/blob/0.8.0/doc/user_guide/user-guide).
Expand All @@ -91,7 +91,7 @@ Besides the BucketFS connection, the SLC, and the Python package AAF also requir
The following command deploys the additional scripts to the specified database schema `$AAF_DB_SCHEMA` using the same language alias `$LANGUAGE_ALIAS` as for uploading the SLC before:

```shell
python -m exasol.analytics.deploy scripts \
python -m exasol.analytics.query_handler.deployment.deploy scripts \
--dsn "$DB_HOST:$DB_PORT" \
--db-user "$DB_USER" \
--db-pass "$DB_PASSWORD" \
Expand Down
4 changes: 0 additions & 4 deletions exasol/analytics/query/handler/query/drop/interface.py

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from exasol.analytics.query.handler.context.connection_name import ConnectionName, ConnectionNameImpl
from exasol.analytics.query.handler.context.proxy.db_object_name_proxy import DBObjectNameProxy
from exasol.analytics.query.handler.query.drop.connection import DropConnectionQuery
from exasol.analytics.query.handler.query.interface import Query
from exasol.analytics.query_handler.context.connection_name import ConnectionName, ConnectionNameImpl
from exasol.analytics.query_handler.context.proxy.db_object_name_proxy import DBObjectNameProxy
from exasol.analytics.query_handler.query.drop.connection import DropConnectionQuery
from exasol.analytics.query_handler.query.interface import Query


class ConnectionNameProxy(DBObjectNameProxy[ConnectionName], ConnectionName):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

from exasol.analytics.query.handler.context.proxy.object_proxy import ObjectProxy
from exasol.analytics.query_handler.context.proxy.object_proxy import ObjectProxy
import exasol.bucketfs as bfs

LOGGER = logging.getLogger(__file__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from exasol.analytics.utils.repr_generation_for_object import generate_repr_for_object

from exasol.analytics.query.handler.context.proxy.object_proxy import ObjectProxy
from exasol.analytics.query.handler.query.interface import Query
from exasol.analytics.query_handler.context.proxy.object_proxy import ObjectProxy
from exasol.analytics.query_handler.query.interface import Query

NameType = TypeVar('NameType', bound=DBObjectName)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
SchemaName,
)

from exasol.analytics.query.handler.context.proxy.db_object_name_proxy import DBObjectNameProxy
from exasol.analytics.query_handler.context.proxy.db_object_name_proxy import DBObjectNameProxy

NameType = TypeVar('NameType', bound=DBObjectNameWithSchema)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from exasol.analytics.schema import UDFName


from exasol.analytics.query.handler.query.drop.interface import DropQuery
from exasol.analytics.query_handler.query.drop.interface import DropQuery


class DropUDFQuery(DropQuery):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from exasol.analytics.schema import TableLikeName


from exasol.analytics.query.handler.context.proxy.db_object_name_with_schema_proxy import DBObjectNameWithSchemaProxy
from exasol.analytics.query_handler.context.proxy.db_object_name_with_schema_proxy import DBObjectNameWithSchemaProxy

NameType = TypeVar('NameType', bound=TableLikeName)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from exasol.analytics.schema import TableName


from exasol.analytics.query.handler.context.proxy.table_like_name_proxy import TableLikeNameProxy
from exasol.analytics.query.handler.query.drop.table import DropTableQuery
from exasol.analytics.query.handler.query.interface import Query
from exasol.analytics.query_handler.context.proxy.table_like_name_proxy import TableLikeNameProxy
from exasol.analytics.query_handler.query.drop.table import DropTableQuery
from exasol.analytics.query_handler.query.interface import Query


class TableNameProxy(TableLikeNameProxy[TableName], TableName):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from exasol.analytics.schema import UDFName


from exasol.analytics.query.handler.context.proxy.db_object_name_with_schema_proxy import DBObjectNameWithSchemaProxy
from exasol.analytics.query.handler.context.proxy.drop_udf_query import DropUDFQuery
from exasol.analytics.query.handler.query.interface import Query
from exasol.analytics.query_handler.context.proxy.db_object_name_with_schema_proxy import DBObjectNameWithSchemaProxy
from exasol.analytics.query_handler.context.proxy.drop_udf_query import DropUDFQuery
from exasol.analytics.query_handler.query.interface import Query


class UDFNameProxy(DBObjectNameWithSchemaProxy[UDFName], UDFName):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from exasol.analytics.schema import ViewName


from exasol.analytics.query.handler.context.proxy.table_like_name_proxy import TableLikeNameProxy
from exasol.analytics.query.handler.query.drop.view import DropViewQuery
from exasol.analytics.query.handler.query.interface import Query
from exasol.analytics.query_handler.context.proxy.table_like_name_proxy import TableLikeNameProxy
from exasol.analytics.query_handler.query.drop.view import DropViewQuery
from exasol.analytics.query_handler.query.interface import Query


class ViewNameProxy(TableLikeNameProxy[ViewName], ViewName):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
ViewName,
)

from exasol.analytics.query.handler.context.connection_name import ConnectionName
from exasol.analytics.query.handler.context.proxy.bucketfs_location_proxy import BucketFSLocationProxy
from exasol.analytics.query_handler.context.connection_name import ConnectionName
from exasol.analytics.query_handler.context.proxy.bucketfs_location_proxy import BucketFSLocationProxy


class QueryHandlerContext(ABC):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import enum
from abc import abstractmethod, ABC

from exasol.analytics.query.handler.context.query_handler_context import QueryHandlerContext
from exasol.analytics.query.handler.context.proxy.object_proxy import ObjectProxy
from exasol.analytics.query_handler.context.query_handler_context import QueryHandlerContext
from exasol.analytics.query_handler.context.proxy.object_proxy import ObjectProxy


class Connection(ABC):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
ViewName,
)

from exasol.analytics.query.handler.context.connection_name_proxy import ConnectionNameProxy
from exasol.analytics.query.handler.context.connection_name import ConnectionName, ConnectionNameImpl
from exasol.analytics.query.handler.context.proxy.bucketfs_location_proxy import BucketFSLocationProxy
from exasol.analytics.query.handler.context.proxy.db_object_name_proxy import DBObjectNameProxy
from exasol.analytics.query.handler.context.proxy.object_proxy import ObjectProxy
from exasol.analytics.query.handler.context.proxy.table_name import TableNameProxy
from exasol.analytics.query.handler.context.proxy.udf_name import UDFNameProxy
from exasol.analytics.query.handler.context.proxy.view_name_proxy import ViewNameProxy
from exasol.analytics.query.handler.context.scope import ScopeQueryHandlerContext, Connection
from exasol.analytics.query.handler.query.interface import Query
from exasol.analytics.query_handler.context.connection_name_proxy import ConnectionNameProxy
from exasol.analytics.query_handler.context.connection_name import ConnectionName, ConnectionNameImpl
from exasol.analytics.query_handler.context.proxy.bucketfs_location_proxy import BucketFSLocationProxy
from exasol.analytics.query_handler.context.proxy.db_object_name_proxy import DBObjectNameProxy
from exasol.analytics.query_handler.context.proxy.object_proxy import ObjectProxy
from exasol.analytics.query_handler.context.proxy.table_name import TableNameProxy
from exasol.analytics.query_handler.context.proxy.udf_name import UDFNameProxy
from exasol.analytics.query_handler.context.proxy.view_name_proxy import ViewNameProxy
from exasol.analytics.query_handler.context.scope import ScopeQueryHandlerContext, Connection
from exasol.analytics.query_handler.query.interface import Query


class TemporaryObjectCounter:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import importlib_resources

from exasol.analytics.deployment import constants
from exasol.analytics.deployment.exasol_lua_script_generator import ExasolLuaScriptGenerator
from exasol.analytics.deployment.jinja_template_location import JinjaTemplateLocation
from exasol.analytics.deployment.lua_script_bundle import LuaScriptBundle, logger
from exasol.analytics.query_handler.deployment import constants
from exasol.analytics.query_handler.deployment.exasol_lua_script_generator import ExasolLuaScriptGenerator
from exasol.analytics.query_handler.deployment.jinja_template_location import JinjaTemplateLocation
from exasol.analytics.query_handler.deployment.lua_script_bundle import LuaScriptBundle, logger


def get_aaf_query_loop_lua_script_generator() -> ExasolLuaScriptGenerator:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
BASE_DIR = BASE_PACKAGE.replace(".", "/")
TEMPLATES_DIR = pathlib.Path("resources", "templates")
OUTPUTS_DIR = pathlib.Path("resources", "outputs")
SOURCE_DIR = files(f"{BASE_PACKAGE}.query.handler.udf.runner")
SOURCE_DIR = files(f"{BASE_PACKAGE}.query_handler.udf.runner")

UDF_CALL_TEMPLATES = {
"call_udf.py": "create_query_handler.jinja.sql"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import logging
import click
from exasol.analytics.slc import (
from exasol.analytics.query_handler.deployment.slc import (
SLC_FILE_NAME,
SLC_URL_FORMATTER,
)
from exasol.analytics.deployment import (
from exasol.analytics.query_handler.deployment import (
scripts_deployer_cli,
)
from exasol.python_extension_common.deployment.language_container_deployer_cli import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from jinja2 import Template

from exasol.analytics.deployment.lua_script_bundle import LuaScriptBundle
from exasol.analytics.query_handler.deployment.lua_script_bundle import LuaScriptBundle


class ExasolLuaScriptGenerator:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import logging

from exasol.analytics.deployment.aaf_exasol_lua_script_generator import \
save_aaf_query_loop_lua_script
from exasol.analytics.deployment.lua_script_bundle import \
LuaScriptBundle
from exasol.analytics.query_handler.deployment.aaf_exasol_lua_script_generator import save_aaf_query_loop_lua_script
from exasol.analytics.query_handler.deployment.lua_script_bundle import LuaScriptBundle


def generate_scripts():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

import pyexasol

from exasol.analytics.deployment import (
from exasol.analytics.query_handler.deployment import (
constants,
utils,
)
from exasol.analytics.deployment.aaf_exasol_lua_script_generator import \
save_aaf_query_loop_lua_script
from exasol.analytics.query_handler.deployment.aaf_exasol_lua_script_generator import save_aaf_query_loop_lua_script

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import click
from exasol.analytics.deployment import utils
from exasol.analytics.deployment.scripts_deployer import \
ScriptsDeployer
from exasol.analytics.slc import LANGUAGE_ALIAS
from exasol.analytics.query_handler.deployment import utils
from exasol.analytics.query_handler.deployment.scripts_deployer import ScriptsDeployer
from exasol.analytics.query_handler.deployment.slc import LANGUAGE_ALIAS

@click.command(name="scripts")
@click.option('--dsn', type=str, required=True)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from jinja2 import Environment, PackageLoader, select_autoescape

from exasol.analytics.deployment import constants
from exasol.analytics.query_handler.deployment import constants

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Dict, Any

from exasol.analytics.query.handler.query_handler import QueryHandler
from exasol.analytics.query_handler.query_handler import QueryHandler

JSONType = Dict[str, Any]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

from exasol.analytics.sql_executor.interface import SQLExecutor

from exasol.analytics.query.handler.context.scope import ScopeQueryHandlerContext
from exasol.analytics.query.handler.context.top_level_query_handler_context import TopLevelQueryHandlerContext, ConnectionLookup
from exasol.analytics.query.handler.query.interface import Query
from exasol.analytics.query.handler.query.select import SelectQueryWithColumnDefinition
from exasol.analytics.query.handler.query_handler import QueryHandler
from exasol.analytics.query.handler.result import Continue, Finish
from exasol.analytics.query.result.python_query_result import PythonQueryResult
from exasol.analytics.query.handler.udf.runner.state import QueryHandlerRunnerState
from exasol.analytics.query_handler.context.scope import ScopeQueryHandlerContext
from exasol.analytics.query_handler.context.top_level_query_handler_context import TopLevelQueryHandlerContext, ConnectionLookup
from exasol.analytics.query_handler.query.interface import Query
from exasol.analytics.query_handler.query.select import SelectQueryWithColumnDefinition
from exasol.analytics.query_handler.query_handler import QueryHandler
from exasol.analytics.query_handler.result.impl import Continue, Finish
from exasol.analytics.query_handler.result.python_query_result import PythonQueryResult
from exasol.analytics.query_handler.udf.runner.state import QueryHandlerRunnerState

LOGGER = logging.getLogger(__file__)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from exasol.analytics.query.handler.context.connection_name import ConnectionName
from exasol.analytics.query.handler.query.drop.interface import DropQuery
from exasol.analytics.query_handler.context.connection_name import ConnectionName
from exasol.analytics.query_handler.query.drop.interface import DropQuery


class DropConnectionQuery(DropQuery):
Expand Down
4 changes: 4 additions & 0 deletions exasol/analytics/query_handler/query/drop/interface.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from exasol.analytics.query_handler.query.interface import Query

class DropQuery(Query):
pass
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from exasol.analytics.schema import TableName


from exasol.analytics.query.handler.query.drop.interface import DropQuery
from exasol.analytics.query_handler.query.drop.interface import DropQuery


class DropTableQuery(DropQuery):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ViewName,
)

from exasol.analytics.query.handler.query.drop.interface import DropQuery
from exasol.analytics.query_handler.query.drop.interface import DropQuery


class DropViewQuery(DropQuery):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from exasol.analytics.schema import Column


from exasol.analytics.query.handler.query.interface import Query
from exasol.analytics.query_handler.query.interface import Query


class SelectQuery(Query):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from abc import ABC, abstractmethod
from typing import Any, Dict, TypeVar, Generic, Union

from exasol.analytics.query.result.query_result import QueryResult
from exasol.analytics.query.handler.context.scope import ScopeQueryHandlerContext
from exasol.analytics.query.handler.result import Result, Continue, Finish
from exasol.analytics.query_handler.result.interface import QueryResult
from exasol.analytics.query_handler.context.scope import ScopeQueryHandlerContext
from exasol.analytics.query_handler.result.impl import Result, Continue, Finish

ResultType = TypeVar("ResultType")
ParameterType = TypeVar("ParameterType")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from dataclasses import dataclass
from typing import List, Generic, TypeVar

from exasol.analytics.query.handler.query.interface import Query
from exasol.analytics.query.handler.query.select import SelectQueryWithColumnDefinition
from exasol.analytics.query_handler.query.interface import Query
from exasol.analytics.query_handler.query.select import SelectQueryWithColumnDefinition


@dataclass()
Expand Down
Loading

0 comments on commit 74bd145

Please sign in to comment.