mirror of
https://github.com/hanzoai/otel-collector.git
synced 2026-11-03 02:20:04 +00:00
- Go module: github.com/SigNoz/signoz-otel-collector → github.com/hanzoai/otel-collector - All signoz-prefixed packages → o11y-prefixed - Docker: signoz/* → ghcr.io/hanzoai/otel-collector - ClickHouse exporter → Hanzo Datastore - Env vars: SIGNOZ_* → HANZO_* - Directory renames for all processor/receiver/exporter packages
41 lines
771 B
Go
41 lines
771 B
Go
package schemamigrator
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestTableEngine(t *testing.T) {
|
|
testCases := []struct {
|
|
name string
|
|
op TableEngine
|
|
wantSQL string
|
|
}{
|
|
{
|
|
name: "create table",
|
|
op: ReplacingMergeTree{
|
|
MergeTree{
|
|
OrderBy: "(timestamp, resource_id)",
|
|
},
|
|
},
|
|
wantSQL: "ReplacingMergeTree ORDER BY (timestamp, resource_id)",
|
|
},
|
|
{
|
|
name: "create table with distributed engine",
|
|
op: Distributed{
|
|
Database: "default",
|
|
Table: "logs",
|
|
Cluster: "cluster",
|
|
ShardingKey: "rand()",
|
|
},
|
|
wantSQL: "Distributed('cluster', default, logs, rand())",
|
|
},
|
|
}
|
|
|
|
for _, tc := range testCases {
|
|
gotSQL := tc.op.ToSQL()
|
|
if gotSQL != tc.wantSQL {
|
|
t.Errorf("got %s, want %s", gotSQL, tc.wantSQL)
|
|
}
|
|
}
|
|
}
|