Skip to content

Instantly share code, notes, and snippets.

@tkaemming
Created July 19, 2019 18:57
Show Gist options
  • Select an option

  • Save tkaemming/951bb0715fb7683ce243a1994b90dbea to your computer and use it in GitHub Desktop.

Select an option

Save tkaemming/951bb0715fb7683ce243a1994b90dbea to your computer and use it in GitHub Desktop.

Revisions

  1. tkaemming created this gist Jul 19, 2019.
    37 changes: 37 additions & 0 deletions calls.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    CREATE TABLE calls (

    -- Kafka Message Details
    timestamp DateTime,
    partition UInt8,
    offset UInt64,

    -- Call Signature
    service String,
    method String,
    arguments Nested (
    name String,
    value String
    ),

    -- Call Results
    results Nested (
    backend String,
    started Nullable(UInt64), -- millisecond timestamp
    finished Nullable(UInt64), -- millisecond timestamp
    status Enum8(
    'success' = 0,
    'failure' = 1
    ),
    exception_type Nullable(String),
    similarity Nullable(Float32) -- [0.0, 1.0] (not similar to exact same) compared to baseline (first) result
    )

    -- Additional Tags
    tags Nested (
    name String,
    value String
    )

    ) ENGINE = MergeTree
    PARTITION BY toDate(timestamp)
    ORDER BY (service, method, timestamp)