Merge pull request #7800 from influxdata/dom/partition-template-rpc
feat(proto): partition template typepull/24376/head
commit
3ec40ca5c7
|
@ -39,12 +39,13 @@ fn generate_grpc_types(root: &Path) -> Result<()> {
|
|||
let ingester_path = root.join("influxdata/iox/ingester/v1");
|
||||
let namespace_path = root.join("influxdata/iox/namespace/v1");
|
||||
let object_store_path = root.join("influxdata/iox/object_store/v1");
|
||||
let partition_template_path = root.join("influxdata/iox/partition_template/v1");
|
||||
let predicate_path = root.join("influxdata/iox/predicate/v1");
|
||||
let querier_path = root.join("influxdata/iox/querier/v1");
|
||||
let schema_path = root.join("influxdata/iox/schema/v1");
|
||||
let wal_path = root.join("influxdata/iox/wal/v1");
|
||||
let storage_path = root.join("influxdata/platform/storage");
|
||||
let storage_errors_path = root.join("influxdata/platform/errors");
|
||||
let storage_path = root.join("influxdata/platform/storage");
|
||||
let wal_path = root.join("influxdata/iox/wal/v1");
|
||||
|
||||
let proto_files = vec![
|
||||
authz_path.join("authz.proto"),
|
||||
|
@ -53,11 +54,12 @@ fn generate_grpc_types(root: &Path) -> Result<()> {
|
|||
compactor_path.join("service.proto"),
|
||||
delete_path.join("service.proto"),
|
||||
ingester_path.join("parquet_metadata.proto"),
|
||||
ingester_path.join("write.proto"),
|
||||
ingester_path.join("replication.proto"),
|
||||
ingester_path.join("persist.proto"),
|
||||
ingester_path.join("replication.proto"),
|
||||
ingester_path.join("write.proto"),
|
||||
namespace_path.join("service.proto"),
|
||||
object_store_path.join("service.proto"),
|
||||
partition_template_path.join("template.proto"),
|
||||
predicate_path.join("predicate.proto"),
|
||||
querier_path.join("flight.proto"),
|
||||
root.join("google/longrunning/operations.proto"),
|
||||
|
@ -66,13 +68,13 @@ fn generate_grpc_types(root: &Path) -> Result<()> {
|
|||
root.join("grpc/health/v1/service.proto"),
|
||||
root.join("influxdata/pbdata/v1/influxdb_pb_data_protocol.proto"),
|
||||
schema_path.join("service.proto"),
|
||||
wal_path.join("wal.proto"),
|
||||
storage_errors_path.join("errors.proto"),
|
||||
storage_path.join("predicate.proto"),
|
||||
storage_path.join("service.proto"),
|
||||
storage_path.join("source.proto"),
|
||||
storage_path.join("storage_common.proto"),
|
||||
storage_path.join("test.proto"),
|
||||
storage_errors_path.join("errors.proto"),
|
||||
wal_path.join("wal.proto"),
|
||||
];
|
||||
|
||||
// Tell cargo to recompile if any of these proto files are changed
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
syntax = "proto3";
|
||||
package influxdata.iox.partition_template.v1;
|
||||
option go_package = "github.com/influxdata/iox/partition_template/v1";
|
||||
|
||||
// A partitioning template describes how data is split into IOx partitions in
|
||||
// the ingest pipeline.
|
||||
message PartitionTemplate {
|
||||
// One or more partitioning template parts.
|
||||
//
|
||||
// Each template part is evaluated in sequence, concatinating the final
|
||||
// partition key from the output of each part, delimited by hyphens.
|
||||
//
|
||||
// For example, given the following template:
|
||||
//
|
||||
// [ TemplatePart::time_format("%Y.%j") TemplatePart::tag_value("region") ]
|
||||
//
|
||||
// The below example rows would have the specified partition key derived:
|
||||
//
|
||||
// time=2023-03-10T13:00:00, region=EMEA, x=42 => "2023.69-EMEA"
|
||||
// time=2023-03-10T13:00:00, region=EMEA-bananas => "2023.69-EMEA-bananas"
|
||||
// time=2023-03-10T13:00:00, x=42 => "2023.69-region"
|
||||
//
|
||||
repeated TemplatePart parts = 1;
|
||||
}
|
||||
|
||||
// A sub-part of a PartitionTemplate.
|
||||
message TemplatePart {
|
||||
oneof part {
|
||||
// A tag value matcher extracts a string value from the tag with the
|
||||
// specified name.
|
||||
//
|
||||
// If a row does not contain the specified tag, the provided tag name is
|
||||
// rendered instead of the (missing) value.
|
||||
string tag_value = 1;
|
||||
|
||||
// A time format matcher accepts a "strftime"-like format string and
|
||||
// evaluates it against the "time" column.
|
||||
string time_format = 2;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue