moose-lib 0.6.139__tar.gz → 0.6.141__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of moose-lib might be problematic. Click here for more details.
- {moose_lib-0.6.139 → moose_lib-0.6.141}/PKG-INFO +1 -1
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/dmv2/olap_table.py +12 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/internal.py +7 -3
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib.egg-info/PKG-INFO +1 -1
- {moose_lib-0.6.139 → moose_lib-0.6.141}/README.md +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/__init__.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/blocks.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/clients/__init__.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/clients/redis_client.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/commons.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/config/__init__.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/config/config_file.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/config/runtime.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/data_models.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/dmv2/__init__.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/dmv2/_registry.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/dmv2/consumption.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/dmv2/ingest_api.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/dmv2/ingest_pipeline.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/dmv2/life_cycle.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/dmv2/materialized_view.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/dmv2/registry.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/dmv2/sql_resource.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/dmv2/stream.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/dmv2/types.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/dmv2/view.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/dmv2/web_app.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/dmv2/web_app_helpers.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/dmv2/workflow.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/dmv2_serializer.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/main.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/query_builder.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/query_param.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/streaming/__init__.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/streaming/streaming_function_runner.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/utilities/__init__.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib/utilities/sql.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib.egg-info/SOURCES.txt +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib.egg-info/dependency_links.txt +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib.egg-info/requires.txt +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/moose_lib.egg-info/top_level.txt +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/setup.cfg +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/setup.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/tests/__init__.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/tests/conftest.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/tests/test_moose.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/tests/test_olap_table_versioning.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/tests/test_query_builder.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/tests/test_redis_client.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/tests/test_s3queue_config.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/tests/test_simple_aggregate.py +0 -0
- {moose_lib-0.6.139 → moose_lib-0.6.141}/tests/test_web_app.py +0 -0
|
@@ -112,6 +112,8 @@ class OlapConfig(BaseModel):
|
|
|
112
112
|
`order_by_expression="(id, name)"` is equivalent to order_by_fields=["id", "name"], or
|
|
113
113
|
"tuple()" for no sorting.
|
|
114
114
|
partition_by: Optional PARTITION BY expression (single ClickHouse SQL expression).
|
|
115
|
+
sample_by_expression: Optional SAMPLE BY expression for data sampling (single ClickHouse SQL expression).
|
|
116
|
+
Used to enable efficient approximate query processing with SAMPLE clause.
|
|
115
117
|
engine: The ClickHouse table engine to use. Can be either a ClickHouseEngines enum value
|
|
116
118
|
(for backward compatibility) or an EngineConfig instance (recommended).
|
|
117
119
|
version: Optional version string for tracking configuration changes.
|
|
@@ -123,11 +125,21 @@ class OlapConfig(BaseModel):
|
|
|
123
125
|
order_by_fields: list[str] = []
|
|
124
126
|
order_by_expression: Optional[str] = None
|
|
125
127
|
partition_by: Optional[str] = None
|
|
128
|
+
sample_by_expression: Optional[str] = None
|
|
126
129
|
engine: Optional[Union[ClickHouseEngines, EngineConfig]] = None
|
|
127
130
|
version: Optional[str] = None
|
|
128
131
|
metadata: Optional[dict] = None
|
|
129
132
|
life_cycle: Optional[LifeCycle] = None
|
|
130
133
|
settings: Optional[dict[str, str]] = None
|
|
134
|
+
# Optional secondary/data-skipping indexes
|
|
135
|
+
class TableIndex(BaseModel):
|
|
136
|
+
name: str
|
|
137
|
+
expression: str
|
|
138
|
+
type: str
|
|
139
|
+
arguments: Optional[list[str]] = None
|
|
140
|
+
granularity: int
|
|
141
|
+
|
|
142
|
+
indexes: list[TableIndex] = []
|
|
131
143
|
|
|
132
144
|
def model_post_init(self, __context):
|
|
133
145
|
has_fields = bool(self.order_by_fields)
|
|
@@ -21,8 +21,7 @@ from moose_lib.dmv2 import (
|
|
|
21
21
|
get_workflows,
|
|
22
22
|
get_web_apps,
|
|
23
23
|
OlapTable,
|
|
24
|
-
|
|
25
|
-
MaterializedView,
|
|
24
|
+
OlapConfig,
|
|
26
25
|
SqlResource
|
|
27
26
|
)
|
|
28
27
|
from moose_lib.dmv2.stream import KafkaSchemaConfig
|
|
@@ -151,6 +150,7 @@ class TableConfig(BaseModel):
|
|
|
151
150
|
columns: List of columns with their types and attributes.
|
|
152
151
|
order_by: List of columns used for the ORDER BY clause.
|
|
153
152
|
partition_by: The column name used for the PARTITION BY clause.
|
|
153
|
+
sample_by_expression: Optional SAMPLE BY expression for data sampling.
|
|
154
154
|
engine_config: Engine configuration with type-safe, engine-specific parameters.
|
|
155
155
|
version: Optional version string of the table configuration.
|
|
156
156
|
metadata: Optional metadata for the table.
|
|
@@ -163,11 +163,13 @@ class TableConfig(BaseModel):
|
|
|
163
163
|
columns: List[Column]
|
|
164
164
|
order_by: List[str] | str
|
|
165
165
|
partition_by: Optional[str]
|
|
166
|
+
sample_by_expression: Optional[str] = None
|
|
166
167
|
engine_config: Optional[EngineConfigDict] = Field(None, discriminator='engine')
|
|
167
168
|
version: Optional[str] = None
|
|
168
169
|
metadata: Optional[dict] = None
|
|
169
170
|
life_cycle: Optional[str] = None
|
|
170
|
-
table_settings: Optional[
|
|
171
|
+
table_settings: Optional[dict[str, str]] = None
|
|
172
|
+
indexes: list[OlapConfig.TableIndex] = []
|
|
171
173
|
|
|
172
174
|
|
|
173
175
|
class TopicConfig(BaseModel):
|
|
@@ -601,12 +603,14 @@ def to_infra_map() -> dict:
|
|
|
601
603
|
columns=table._column_list,
|
|
602
604
|
order_by=order_by_value,
|
|
603
605
|
partition_by=table.config.partition_by,
|
|
606
|
+
sample_by_expression=table.config.sample_by_expression,
|
|
604
607
|
engine_config=engine_config,
|
|
605
608
|
version=table.config.version,
|
|
606
609
|
metadata=getattr(table, "metadata", None),
|
|
607
610
|
life_cycle=table.config.life_cycle.value if table.config.life_cycle else None,
|
|
608
611
|
# Map 'settings' to 'table_settings' for internal use
|
|
609
612
|
table_settings=table_settings if table_settings else None,
|
|
613
|
+
indexes=table.config.indexes,
|
|
610
614
|
)
|
|
611
615
|
|
|
612
616
|
for name, stream in get_streams().items():
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|