-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
293 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
CREATE TABLE IF NOT EXISTS table | ||
( | ||
`service_instance_id` LowCardinality(String) COMMENT 'service.instance.id', | ||
`service_name` LowCardinality(String) COMMENT 'service.name', | ||
`service_namespace` LowCardinality(String) COMMENT 'service.namespace', | ||
`timestamp` DateTime64(9), | ||
`severity_number` UInt8, | ||
`severity_text` LowCardinality(String), | ||
`trace_id` FixedString(16), | ||
`span_id` FixedString(8), | ||
`trace_flags` UInt8, | ||
`body` String, | ||
`attribute` String, | ||
`resource` LowCardinality(String), | ||
`scope_name` LowCardinality(String), | ||
`scope_version` LowCardinality(String), | ||
`scope` LowCardinality(String), | ||
|
||
INDEX `idx_trace_id` trace_id TYPE bloom_filter(0.001) GRANULARITY 1, | ||
INDEX `idx_body` body TYPE tokenbf_v1(32768, 3, 0) GRANULARITY 1, | ||
INDEX `idx_ts` timestamp TYPE minmax GRANULARITY 8192, | ||
INDEX `attribute_keys` arrayConcat(JSONExtractKeys(attribute), JSONExtractKeys(scope), JSONExtractKeys(resource)) TYPE set(100), | ||
) | ||
ENGINE = MergeTree | ||
PARTITION BY toYYYYMMDD(timestamp) | ||
ORDER BY (`severity_number`, `service_namespace`, `service_name`, `resource`, `timestamp`) | ||
PRIMARY KEY (`severity_number`, `service_namespace`, `service_name`, `resource`) |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package chstorage | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/go-faster/sdk/gold" | ||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/go-faster/oteldb/internal/ddl" | ||
) | ||
|
||
func Test_logColumns_DDL(t *testing.T) { | ||
lc := newLogColumns() | ||
table := lc.DDL() | ||
|
||
s, err := ddl.Generate(table) | ||
require.NoError(t, err) | ||
|
||
gold.Str(t, s, "log_columns_ddl.sql") | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
CREATE TABLE IF NOT EXISTS table | ||
( | ||
`a` Int32, | ||
`bar` LowCardinality(String) CODEC(ZSTD(1)), | ||
`c` String COMMENT 'foo.bar' CODEC(ZSTD(1)), | ||
|
||
INDEX `idx_trace_id` trace_id TYPE bloom_filter(0.001) GRANULARITY 1, | ||
INDEX `idx_body` body TYPE tokenbf_v1(32768, 3, 0) GRANULARITY 1, | ||
INDEX `idx_ts` timestamp TYPE minmax GRANULARITY 8192, | ||
INDEX `attribute_keys` arrayConcat(JSONExtractKeys(attribute), JSONExtractKeys(scope), JSONExtractKeys(resource)) TYPE set(100), | ||
) | ||
ENGINE = MergeTree() | ||
ORDER BY (`a`, `b`) |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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