diff --git a/proto/substrait/algebra.proto b/proto/substrait/algebra.proto index 8ea867eba..6146e2da0 100644 --- a/proto/substrait/algebra.proto +++ b/proto/substrait/algebra.proto @@ -142,6 +142,49 @@ message ReadRel { } } +// This operator passes-through while writing to an external sink +message WriteRel { + RelCommon common = 1; + Rel input = 2; + substrait.extensions.AdvancedExtension advanced_extension = 10; + + oneof write_type { + LocalFiles local_files = 3; + } + + message LocalFiles { + + // The consumer should avoid data duplication across items + repeated FileOrFiles items = 1; + substrait.extensions.AdvancedExtension advanced_extension = 10; + + message FileOrFiles { + oneof path_type { + string uri_path = 1; + string uri_path_glob = 2; + string uri_file = 3; + string uri_folder = 4; + } + + FileFormat format = 5; + + // the index of the partition this item belongs to + uint64 partition_index = 6; + + // the project-expressions to apply when writing this item + repeated Expression project_expressions; + + // the filter-condition to apply when writing this item + Expression filter_condition; + + enum FileFormat { + FILE_FORMAT_UNSPECIFIED = 0; + FILE_FORMAT_PARQUET = 1; + } + } + } +} + // This operator allows to represent calculated expressions of fields (e.g., a+b). Direct/Emit are used to represent classical relational projections message ProjectRel { RelCommon common = 1; @@ -361,6 +404,7 @@ message Rel { ExtensionMultiRel extension_multi = 10; ExtensionLeafRel extension_leaf = 11; CrossRel cross = 12; + WriteRel write = 13; } }