zeroshade commented on code in PR #172:
URL: 
https://github.com/apache/terraform-provider-iceberg/pull/172#discussion_r4620483529


##########
internal/provider/resource_table.go:
##########
@@ -365,9 +365,17 @@ func (r *icebergTableResource) Update(ctx context.Context, 
req resource.UpdateRe
        updates := make([]table.Update, 0)
 
        updates = append(updates, r.calculatePropertyUpdates(ctx, &plan, 
&state, &resp.Diagnostics)...)
-       updates = append(updates, r.calculateSchemaUpdates(ctx, &plan, &state, 
tbl, &resp.Diagnostics)...)
-       updates = append(updates, r.calculatePartitionUpdates(ctx, &plan, tbl, 
&resp.Diagnostics)...)
-       updates = append(updates, r.calculateSortOrderUpdates(ctx, &plan, tbl, 
&resp.Diagnostics)...)
+       schemaUpdates, plannedSchema := r.calculateSchemaUpdates(ctx, &plan, 
&state, tbl, &resp.Diagnostics)

Review Comment:
   Heads-up: this overlaps #144 (approved), which also changes 
`calculateSchemaUpdates` and the partition/sort update functions, so whichever 
lands second will need a rebase. When combining, #144's existing-spec/order 
lookup should compare against the spec/order resolved from names here.



##########
docs/resources/table.md:
##########
@@ -424,12 +472,13 @@ Required:
 Required:
 
 - `name` (String) The partition field name.
-- `source_ids` (List of Number) The source field IDs.
 - `transform` (String) The partition transform.
 
 Optional:
 
 - `field_id` (Number) The partition field ID.
+- `source_ids` (List of Number) The source field IDs. Set exactly one of 
source_ids or source_names the other is computed.

Review Comment:
   These descriptions (here and at lines 481, 503, 504) drop the semicolon 
present in `table_tfschema.go`: "…source_names; the other is computed."



##########
docs/resources/table.md:
##########
@@ -106,6 +106,54 @@ schema = {
 }
 ```
 
+## Referencing source columns by name
+
+Partition and sort fields identify their source columns by field id
+(`source_ids` / `source_id`) or by column name (`source_names` /
+`source_name`). Set exactly one of each pair, the provider fills in the other.

Review Comment:
   Nit: "Set exactly one of each pair; the provider fills in the other." Also a 
few lines below, "…added in the same apply; until then the plan shows…" is 
missing punctuation.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to