diff --git a/runtime/compilers/rillv1/parse_model.go b/runtime/compilers/rillv1/parse_model.go index b31a12d3bc6..3ea8a296ab7 100644 --- a/runtime/compilers/rillv1/parse_model.go +++ b/runtime/compilers/rillv1/parse_model.go @@ -22,6 +22,7 @@ type ModelYAML struct { Incremental bool `yaml:"incremental"` State *DataYAML `yaml:"state"` Partitions *DataYAML `yaml:"partitions"` + Splits *DataYAML `yaml:"splits"` // Deprecated: use "partitions" instead PartitionsWatermark string `yaml:"partitions_watermark"` PartitionsConcurrency uint `yaml:"partitions_concurrency"` InputProperties map[string]any `yaml:",inline" mapstructure:",remain"` @@ -75,6 +76,12 @@ func (p *Parser) parseModel(ctx context.Context, node *Node) error { // Parse partitions resolver var partitionsResolver string var partitionsResolverProps *structpb.Struct + if tmp.Splits != nil { // Backwards compatibility: "splits" is deprecated and has been renamed to "partitions" + if tmp.Partitions != nil { + return fmt.Errorf(`"partitions" and "splits" are mutually exclusive`) + } + tmp.Partitions = tmp.Splits + } if tmp.Partitions != nil { var refs []ResourceName partitionsResolver, partitionsResolverProps, refs, err = p.parseDataYAML(tmp.Partitions) diff --git a/runtime/reconcilers/model.go b/runtime/reconcilers/model.go index 13c6c1345b3..ba70149ee3d 100644 --- a/runtime/reconcilers/model.go +++ b/runtime/reconcilers/model.go @@ -1354,7 +1354,10 @@ func (r *ModelReconciler) resolveTemplatedProps(ctx context.Context, self *runti var extraProps map[string]any if partition != nil { - extraProps = map[string]any{"partition": partition} + extraProps = map[string]any{ + "partition": partition, + "split": partition, // Deprecated: use "partition" instead + } } td := compilerv1.TemplateData{