Skip to content

SK-2955: Align upsert/upsertType with Flow-DB changes (docs, tests, error-message cleanup)#346

Open
Devesh-Skyflow wants to merge 1 commit into
release/26.7.15from
devesh/sk-2955
Open

SK-2955: Align upsert/upsertType with Flow-DB changes (docs, tests, error-message cleanup)#346
Devesh-Skyflow wants to merge 1 commit into
release/26.7.15from
devesh/sk-2955

Conversation

@Devesh-Skyflow

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to CJP-410 / CUST-4294 (Nykaa). The original report — record-level
upsertType.UPDATE behaving like REPLACE — was a Flow-DB (vault) bug, now
fixed server-side. Flow-DB also now defaults record-level upsert to UPDATE
(previously REPLACE) and owns upsert-placement validation.

No SDK contract change or core-logic fix required. The SDK already serializes
record-level upsertType into records[].upsert.updateType and omits updateType
entirely when unset, so the new server-side default applies. This PR covers the
remaining docs, tests, and error-message hygiene.

Jira: https://skyflow.atlassian.net/browse/SK-2955

Changes

  • README — document that upsertType is optional, that the default is now
    UPDATE (applied by the backend), and the UPDATE vs REPLACE semantics.
  • Samples — drop the now-redundant explicit upsertType(UpsertType.UPDATE)
    (it's the default) in BulkMultiTableInsertSync/BulkMultiTableInsertAsync,
    with a clarifying comment; removed the unused UpsertType import. REPLACE
    samples left unchanged (REPLACE is meaningful, non-default).
  • Validation (Validations.java) — defer upsert placement checks
    (request- vs record-level) to the backend, which returns the authoritative
    message. The SDK now only guards against empty upsert column lists.
  • Tests — add coverage for:
    • request-level upsert without upsertTypeupdateType omitted (default-UPDATE)
    • record-level upsert without upsertTypeupdateType omitted (default-UPDATE)
    • upsertType at both request and record level → both serialized (backend rejects)
    • updated ValidationsTests / InsertTests to reflect that placement is no
      longer validated client-side.
  • samples/pom.xml — bump SDK dependency to 3.0.0-beta.11.

Testing

  • mvn test (v3): all upsert-related tests pass. (testSetBearerTokenWithEnvCredentials
    is environmental — needs a local .env SKYFLOW_CREDENTIALS — and is unrelated.)
  • mvn compile (samples): passes.

Acceptance criteria

  • README + samples reflect optional upsertType and the new UPDATE default
  • Client-side validation messages deferred to backend
  • New unit tests pass for the scenarios above
  • Verified against blitz once vault changes are released (manual, pending vault release)

…ror-message cleanup)

Flow-DB now defaults record-level upsert to UPDATE (was REPLACE) and owns
upsert-placement validation server-side. The SDK already serializes
upsertType correctly and omits updateType when unset, so this is docs,
tests, and validation hygiene only.

- README: document upsertType is optional, default is now UPDATE, and
  UPDATE vs REPLACE semantics.
- Samples: drop redundant explicit upsertType(UPDATE) (now the default)
  in BulkMultiTableInsert{Sync,Async}; keep REPLACE samples as-is.
- Validations: defer upsert-placement checks to the backend (authoritative
  messages); SDK only guards empty upsert columns.
- Tests: cover default-UPDATE omission at request/record level, both-level
  serialization, and updated placement tests to reflect deferral.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants