Skip to content

Commit

Permalink
buf format -w (#673)
Browse files Browse the repository at this point in the history
* buf format -w

I was working on protobuf files and notices my vscode was formatting the files
differently.

We already use buf for generating, it is reasonable to use buf for formatting
as well. Strictly for consistency.

* add workflow for buf format
  • Loading branch information
gernest authored Jan 7, 2024
1 parent 0ebdb44 commit 5e5bde7
Show file tree
Hide file tree
Showing 5 changed files with 271 additions and 252 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/buf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Buf

on:
push:
branches: [main]
pull_request:
branches: [main]
paths:
- "proto/**/*.proto"

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: bufbuild/buf-setup-action@v1

- name: Format
run: buf format --exit-code
172 changes: 86 additions & 86 deletions proto/frostdb/schema/v1alpha1/schema.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,112 +4,112 @@ package frostdb.schema.v1alpha1;

// Schema definition for a table.
message Schema {
// Name of the schema.
string name = 1;
// Columns in the schema.
repeated Column columns = 2;
// Columns to sort by in the schema.
repeated SortingColumn sorting_columns = 3;
// UniquePrimaryIndex defines whether the primary index is unique. Duplicate
// (according to the sorting column) rows will be dropped on compaction.
bool unique_primary_index = 4;
// Name of the schema.
string name = 1;
// Columns in the schema.
repeated Column columns = 2;
// Columns to sort by in the schema.
repeated SortingColumn sorting_columns = 3;
// UniquePrimaryIndex defines whether the primary index is unique. Duplicate
// (according to the sorting column) rows will be dropped on compaction.
bool unique_primary_index = 4;
}

// Column definition.
message Column {
// Name of the column.
string name = 1;
// Storage layout of the column.
StorageLayout storage_layout = 2;
// Whether the column can dynamically expand.
bool dynamic = 3;
// Prehash the column before storing it. This is an optimization to speed up aggregation queries when this column is often aggregated.
// This will create a separate non-dynamic column with the same name and the prefix "hashed." that contains the prehashed values.
bool prehash = 4;
// Name of the column.
string name = 1;
// Storage layout of the column.
StorageLayout storage_layout = 2;
// Whether the column can dynamically expand.
bool dynamic = 3;
// Prehash the column before storing it. This is an optimization to speed up aggregation queries when this column is often aggregated.
// This will create a separate non-dynamic column with the same name and the prefix "hashed." that contains the prehashed values.
bool prehash = 4;
}

// Storage layout describes the physical storage properties of a column.
message StorageLayout {
// Type enum of a column.
enum Type {
// Unknown type.
TYPE_UNKNOWN_UNSPECIFIED = 0;
// Represents a string type.
TYPE_STRING = 1;
// Represents an int64 type.
TYPE_INT64 = 2;
// Represents a double type.
TYPE_DOUBLE = 3;
// Represents a boolean type.
TYPE_BOOL = 4;
// Represents a int32 type.
TYPE_INT32 = 5;
}
// Type enum of a column.
enum Type {
// Unknown type.
TYPE_UNKNOWN_UNSPECIFIED = 0;
// Represents a string type.
TYPE_STRING = 1;
// Represents an int64 type.
TYPE_INT64 = 2;
// Represents a double type.
TYPE_DOUBLE = 3;
// Represents a boolean type.
TYPE_BOOL = 4;
// Represents a int32 type.
TYPE_INT32 = 5;
}

// Type of the column.
Type type = 1;
// Type of the column.
Type type = 1;

// Encoding enum of a column.
enum Encoding {
// Plain encoding.
ENCODING_PLAIN_UNSPECIFIED = 0;
// Dictionary run-length encoding.
ENCODING_RLE_DICTIONARY = 1;
// Delta binary packed encoding.
ENCODING_DELTA_BINARY_PACKED = 2;
// Delta Byte Array encoding.
ENCODING_DELTA_BYTE_ARRAY = 3;
// Delta Length Byte Array encoding.
ENCODING_DELTA_LENGTH_BYTE_ARRAY = 4;
}
// Encoding enum of a column.
enum Encoding {
// Plain encoding.
ENCODING_PLAIN_UNSPECIFIED = 0;
// Dictionary run-length encoding.
ENCODING_RLE_DICTIONARY = 1;
// Delta binary packed encoding.
ENCODING_DELTA_BINARY_PACKED = 2;
// Delta Byte Array encoding.
ENCODING_DELTA_BYTE_ARRAY = 3;
// Delta Length Byte Array encoding.
ENCODING_DELTA_LENGTH_BYTE_ARRAY = 4;
}

// Encoding of the column.
Encoding encoding = 2;
// Encoding of the column.
Encoding encoding = 2;

// Compression enum of a column.
enum Compression {
// No compression.
COMPRESSION_NONE_UNSPECIFIED = 0;
// Snappy compression.
COMPRESSION_SNAPPY = 1;
// GZIP compression.
COMPRESSION_GZIP = 2;
// Brotli compression.
COMPRESSION_BROTLI = 3;
// LZ4_RAW compression.
COMPRESSION_LZ4_RAW = 4;
// ZSTD compression.
COMPRESSION_ZSTD = 5;
}
// Compression enum of a column.
enum Compression {
// No compression.
COMPRESSION_NONE_UNSPECIFIED = 0;
// Snappy compression.
COMPRESSION_SNAPPY = 1;
// GZIP compression.
COMPRESSION_GZIP = 2;
// Brotli compression.
COMPRESSION_BROTLI = 3;
// LZ4_RAW compression.
COMPRESSION_LZ4_RAW = 4;
// ZSTD compression.
COMPRESSION_ZSTD = 5;
}

// Compression of the column.
Compression compression = 3;
// Compression of the column.
Compression compression = 3;

// Wether values in the column are allowed to be null.
bool nullable = 4;
// Wether values in the column are allowed to be null.
bool nullable = 4;

// Whether the column is repeated.
bool repeated = 5;
// Whether the column is repeated.
bool repeated = 5;
}

// SortingColumn definition.
message SortingColumn {
// Name of the column to sort by.
string name = 1;
// Name of the column to sort by.
string name = 1;

// Enum of possible sorting directions.
enum Direction {
// Unknown direction.
DIRECTION_UNKNOWN_UNSPECIFIED = 0;
// Sort in ascending order.
DIRECTION_ASCENDING = 1;
// Sort in descending order.
DIRECTION_DESCENDING = 2;
}
// Enum of possible sorting directions.
enum Direction {
// Unknown direction.
DIRECTION_UNKNOWN_UNSPECIFIED = 0;
// Sort in ascending order.
DIRECTION_ASCENDING = 1;
// Sort in descending order.
DIRECTION_DESCENDING = 2;
}

// Direction of the sorting.
Direction direction = 2;
// Direction of the sorting.
Direction direction = 2;

// Whether nulls are the smallest or largest values.
bool nulls_first = 3;
// Whether nulls are the smallest or largest values.
bool nulls_first = 3;
}
Loading

0 comments on commit 5e5bde7

Please sign in to comment.