Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion parser/parser_column.go
Original file line number Diff line number Diff line change
Expand Up @@ -801,10 +801,15 @@ func (p *Parser) tryParseCompressionCodecs(pos Pos) (*CompressionCodec, error) {
if err != nil {
return nil, err
}
// parse DELTA if CODEC(Delta, ZSTD(1))
// parse DELTA if CODEC(Delta, ZSTD(1)) or CODEC(Delta(9), ZSTD(1))
var codecType *Ident
if strings.ToUpper(name.Name) == "DELTA" {
codecType = name
// try parse delta level
if _, err := p.tryParseCompressionLevel(p.Pos()); err != nil {
return nil, err
}
// consume comma
if _, err := p.consumeTokenKind(","); err != nil {
return nil, err
}
Expand Down
1 change: 1 addition & 0 deletions parser/testdata/ddl/create_table_with_codec_delta.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ CREATE TABLE IF NOT EXISTS test_local
(
`id` UInt64 CODEC(Delta, ZSTD(1)),
`api_id` UInt64 CODEC(ZSTD(1)),
`app_id` UInt64 CODEC(Delta(9), ZSTD(1)),
`timestamp` DateTime64(9) CODEC(ZSTD(1)),
INDEX timestamp_index(timestamp) TYPE minmax GRANULARITY 4
)
Expand Down
2 changes: 2 additions & 0 deletions parser/testdata/ddl/format/create_table_with_codec_delta.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CREATE TABLE IF NOT EXISTS test_local
(
`id` UInt64 CODEC(Delta, ZSTD(1)),
`api_id` UInt64 CODEC(ZSTD(1)),
`app_id` UInt64 CODEC(Delta(9), ZSTD(1)),
`timestamp` DateTime64(9) CODEC(ZSTD(1)),
INDEX timestamp_index(timestamp) TYPE minmax GRANULARITY 4
)
Expand All @@ -18,6 +19,7 @@ CREATE TABLE IF NOT EXISTS test_local
(
`id` UInt64 CODEC(Delta, ZSTD(1)),
`api_id` UInt64 CODEC(ZSTD(1)),
`app_id` UInt64 CODEC(Delta, ZSTD(1)),
`timestamp` DateTime64(9) CODEC(ZSTD(1)),
INDEX timestamp_index(timestamp) TYPE minmax GRANULARITY 4
)
Expand Down
Loading