This document describes patterns for building materialized views over tables that
use Change Data Capture (CDC) via ReplacingMergeTree. The core challenge is
that MVs in ClickHouse are insert triggers, not recomputed views — so they see raw
CDC rows before deduplication, and naive aggregations will be wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Tullio | |
| using Dagger | |
| using Dagger: DArray, chunks, Thunk, ArrayDomain | |
| struct Zero end | |
| Base.zero(::Type{Thunk}) = delayed(()->Zero())() | |
| Base.zero(::Type{Union{Zero, ArrayDomain}}) = Zero() | |
| Base.:(+)(z::Zero, x) = x | |
| Base.:(+)(x, z::Zero) = x | |
| Base.:(+)(z::Zero, x::Zero) = z |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| immutable IRef{T} | |
| value::T | |
| IRef() = new() | |
| IRef(value) = new(value) | |
| end | |
| immutable Result{T,S} | |
| issuccess::Bool | |
| value::IRef{T} | |
| error::IRef{S} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Lazy | |
| function methoddoc(name, sign, doc) | |
| vbox( | |
| fontweight(bold, code(string(name) * "(" * join(map(string, sign.types), ", ") *")" )), | |
| doc | |
| ) | |
| end | |
| function showdoc(fn::Function, fndoc) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| function Sneaky (node) { | |
| var lightNode = Polymer.dom(node) | |
| this.lightNode = lightNode | |
| this.node = lightNode.node | |
| } | |
| Sneaky.prototype = Polymer.dom() | |
| Object.defineProperties(Sneaky.prototype, { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # An infinite number of mathematicians walk into a bar... | |
| using Color | |
| colors = distinguishable_colors(9) | |
| box(w, h, n) = | |
| empty |> fillcolor(colors[n % 9 + 1]) |> size(w, h) |
NewerOlder