diff --git a/tests/test_engines.py b/tests/test_engines.py index 84e46d8..0258186 100644 --- a/tests/test_engines.py +++ b/tests/test_engines.py @@ -2,11 +2,7 @@ from __future__ import unicode_literals import unittest import datetime -from infi.clickhouse_orm.system_models import SystemPart -from infi.clickhouse_orm.database import Database, DatabaseException, ServerError -from infi.clickhouse_orm.models import Model, MergeModel, DistributedModel -from infi.clickhouse_orm.fields import * -from infi.clickhouse_orm.engines import * +from infi.clickhouse_orm import * import logging logging.getLogger("requests").setLevel(logging.WARNING) @@ -38,6 +34,11 @@ class EnginesTestCase(_EnginesHelperTestCase): engine = MergeTree('date', ('date', 'event_id', 'event_group', 'intHash32(event_id)'), sampling_expr='intHash32(event_id)') self._create_and_insert(TestModel) + def test_merge_tree_with_sampling__funcs(self): + class TestModel(SampleModel): + engine = MergeTree('date', ('date', 'event_id', 'event_group', F.intHash32(SampleModel.event_id)), sampling_expr=F.intHash32(SampleModel.event_id)) + self._create_and_insert(TestModel) + def test_merge_tree_with_granularity(self): class TestModel(SampleModel): engine = MergeTree('date', ('date', 'event_id', 'event_group'), index_granularity=4096)