plusplusjiajia opened a new pull request, #35:
URL: https://github.com/apache/terraform-provider-paimon/pull/35

   After `terraform import`, `paimon_row_filter` and `paimon_column_mask` 
planned an in-place update even when the configuration matched the server. 
Policy updates are non-atomic, so this looked like a real policy change to 
operators. It wasn't: both updates only rewrote state.
   
   Two causes:
   
   - `allow_non_atomic_update` exists only in configuration, so import left it 
null. Its schema default (`false`) only applies during planning.
   - Read stored the server's `predicate`/`transform` verbatim. DLF returns 
column-mask JSON with whitespace that `jsonencode` never emits, so the plan 
showed `# whitespace changes`.
   
   Changes:
   
   - `ImportState` for both resources records `allow_non_atomic_update = false`.
   - Read stores server JSON in `jsonencode` form through a new `compactJSON` 
helper: sorted keys, no whitespace, `<`/`>`/`&` escaped as `<`/`>`/`&`, numbers 
kept exact. I checked this against `jsonencode` output from Terraform 1.14.3 
and OpenTofu 1.12.6. Invalid JSON is stored unchanged.
   - The import sections of the row filter and column mask docs describe this.
   
   Tests:
   
   - `TestAccPolicyImportPlansNoChanges` creates both policies, forgets them 
with `removed { lifecycle { destroy = false } }`, imports them, and requires an 
empty plan. Its fixture returns indented JSON, as DLF does. Without the fix the 
test fails with `will be updated in-place` / `# whitespace changes`.
   - `TestCompactJSONMatchesJSONEncode` covers whitespace, key order, large 
integers, HTML escaping, and invalid input.
   - `make check`, `make test-acceptance`, `make test-acceptance-tofu`, and 
`make check-license` pass.
   - Live check against a DLF catalog through the cn-hangzhou VPC endpoint with 
ECS RAM role auth: apply, import both policies, then plan, which shows `No 
changes`.
   
   The table update after import is unchanged. 
`TestAccImportMatchingImmutableOptionPreservesTable` expects it: it adopts the 
declared option keys without altering the catalog.
   


-- 
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]

Reply via email to