Beispiel #1
0
    def test_column_types(self):
        materialize("events", "myprop")

        expr = "replaceRegexpAll(JSONExtractRaw(properties, 'myprop'), '^\"|\"$', '')"
        self.assertEqual(("MATERIALIZED", expr),
                         self._get_column_types("mat_myprop"))

        backfill_materialized_columns("events", ["myprop"], timedelta(days=50))
        self.assertEqual(("DEFAULT", expr),
                         self._get_column_types("mat_myprop"))

        mark_all_materialized()
        self.assertEqual(("MATERIALIZED", expr),
                         self._get_column_types("mat_myprop"))
Beispiel #2
0
    def test_column_types(self):
        materialize("events", "myprop")

        # :KLUDGE: ClickHouse replaces our trim(BOTH '"' FROM properties) with this
        expr = "replaceRegexpAll(JSONExtractRaw(properties, 'myprop'), concat('^[', regexpQuoteMeta('\"'), ']*|[', regexpQuoteMeta('\"'), ']*$'), '')"
        self.assertEqual(("MATERIALIZED", expr),
                         self._get_column_types("events", "mat_myprop"))

        backfill_materialized_columns("events", ["myprop"], timedelta(days=50))
        self.assertEqual(("DEFAULT", expr),
                         self._get_column_types("events", "mat_myprop"))

        mark_all_materialized()
        self.assertEqual(("MATERIALIZED", expr),
                         self._get_column_types("events", "mat_myprop"))
Beispiel #3
0
def clickhouse_mark_all_materialized():
    if recompute_materialized_columns_enabled():
        from ee.tasks.materialized_columns import mark_all_materialized

        mark_all_materialized()
Beispiel #4
0
def clickhouse_mark_all_materialized():
    if is_clickhouse_enabled() and settings.EE_AVAILABLE:
        from ee.tasks.materialized_columns import mark_all_materialized

        mark_all_materialized()