Skip to content

Answer a missing or invalid shared-table Delta log with errors that name the data provider - #186

Closed
littlegrasscao wants to merge 1 commit into
OpenSharing-IO:mainfrom
littlegrasscao:fix/incomplete-delta-log-catalog-error
Closed

littlegrasscao wants to merge 1 commit into
OpenSharing-IO:mainfrom
littlegrasscao:fix/incomplete-delta-log-catalog-error

Conversation

@littlegrasscao

@littlegrasscao littlegrasscao commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

A shared table whose Delta log is missing, starts after version 0, has a gap, or is otherwise invalid, or whose version Kernel cannot read, returned 500 INTERNAL_ERROR or an error code and message of this server's own. The recipient cannot fix any of these, so the answer now says what is wrong and, when the shared table itself is at fault, whom to contact. Storage paths stay in the server log and out of every response.

DeltaKernel.classify classifies each Kernel failure once, by exception type instead of message text:

Case Answer
No log (TableNotFoundException), or a file missing or denied (FileNotFoundException, AccessDeniedException) 400 BAD_REQUEST "Unable to access table <share>.<schema>.<table>: something is wrong with the table. Please contact your data provider."
InvalidTableException (gap, non-contiguous, invalid content) 400 BAD_REQUEST, Kernel's message with the table path removed, then " Please contact your data provider."
Any other Kernel report (a version or timestamp the table does not have) 400 BAD_REQUEST, Kernel's message with the table path removed
A reader feature or version Kernel cannot read 400 INVALID_PARAMETER_VALUE "Table features <features> are found in table[ version: <n>]. This server cannot read them. Please contact your data provider." (features lowercase, sorted)
A storage-layer failure for a reason of its own stays a server error

Path removal replaces every spelling of the table path (as given, without file:, with spaces escaped or not) and then any other location with a scheme.

The version endpoint no longer pre-checks a timestamp against the latest commit, and snapshots are opened straight at the version or timestamp asked for; Kernel's message is what the recipient gets.

Fixes #185

Changes

  • ErrorCodes.BAD_REQUEST, ApiException.badRequest, ApiException.unsupportedFeatures; the 400 RESOURCE_DOES_NOT_EXIST factories are gone.
  • SourceTableException carries a source-table failure up to ProtocolTables, which names the table as the share does.
  • Every Kernel call that reads a table is classified in one place (DeltaKernel, DeltaSnapshots, the readers).
  • Fixtures: a log with in-commit timestamps and no CommitInfo (in a directory with a space in its name) and a table readable at its latest version but not at version 0.
  • Tests assert status, error code and message, and that no storage path appears.

Test plan

  • opensharing-server-core and opensharing-server test runs pass locally (Java 17, Maven). S3-backed integration classes skip without cloud credentials; their expectations were updated but not run.

This pull request and its description were written by Isaac.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🔍 OpenCodeReview found 2 issue(s) in this PR.

  • ✅ Successfully posted inline: 0 comment(s)
  • 📋 Routed to summary by policy: 1 comment(s)
  • ⏭️ Skipped (overlap with history): 1 comment(s)

maintainability · low

📄 server/opensharing-server-core/src/main/java/io/opensharing/http/ApiException.java (L66-L67)

⚠️ GitHub could not post this as an inline comment: Routed to summary (severity low · category maintainability)

Inconsistent error code: other table-unreadable cases now map to BAD_REQUEST, but unsupportedFeatures returns INVALID_PARAMETER_VALUE. The table's features are not a request parameter, so clients get a misleading code and may handle it differently. Use badRequest, or document why this one differs. Also, BAD_REQUEST isn't defined in spec/, so clients can't rely on it.


ℹ️ All inline comments overlapped with existing reviews; nothing new was posted.

@littlegrasscao littlegrasscao changed the title Map an incomplete Delta log to the catalog error, as a missing log is Answer a missing or invalid shared-table Delta log with the recipient's error Nov 12, 2026
@littlegrasscao
littlegrasscao force-pushed the fix/incomplete-delta-log-catalog-error branch from fc682a9 to afade93 Compare November 13, 2026 01:31
@littlegrasscao
littlegrasscao force-pushed the fix/incomplete-delta-log-catalog-error branch from afade93 to 03f45df Compare November 13, 2026 01:39
@littlegrasscao
littlegrasscao force-pushed the fix/incomplete-delta-log-catalog-error branch from 03f45df to add54a7 Compare November 13, 2026 01:47
@littlegrasscao
littlegrasscao force-pushed the fix/incomplete-delta-log-catalog-error branch from add54a7 to 0b96d5f Compare November 13, 2026 01:57
@littlegrasscao littlegrasscao changed the title Answer a missing or invalid shared-table Delta log with the recipient's error Answer a missing or invalid shared-table Delta log with errors that name the data provider Nov 13, 2026
…ame the data provider

A shared table whose Delta log is missing, starts after version 0, has a
gap, or is otherwise invalid, or whose version Kernel cannot read,
returned 500 INTERNAL_ERROR or an error code and message of this
server's own. The recipient cannot fix any of these, so the answer now
says what is wrong and, when the shared table itself is at fault, whom
to contact.

DeltaKernel classifies every Kernel failure once, by Kernel's exception
type rather than its message text:

- A missing log (TableNotFoundException), or a file that is missing or
  denied (FileNotFoundException, AccessDeniedException), is the shared
  table's own state: 400 BAD_REQUEST "Unable to access table
  <share>.<schema>.<table>: something is wrong with the table. Please
  contact your data provider." The table is named as the share names
  it, and its storage path stays in the log.
- An InvalidTableException, such as a gap in the log, is reported in
  Kernel's own words, with every spelling of the table's path and any
  other location removed, and the recipient is asked to contact the
  data provider: 400 BAD_REQUEST.
- Any other Kernel report, such as a version or timestamp the table does
  not have, is the request's mistake in Kernel's words, without the
  path: 400 BAD_REQUEST.
- A failure of the storage layer for a reason of its own stays a server
  error.
- A reader feature or version Kernel cannot read is named in a fixed
  order: 400 INVALID_PARAMETER_VALUE "Table features <features> are
  found in table[ version: <n>]. This server cannot read them. Please
  contact your data provider."

The version endpoint no longer pre-checks a timestamp against the
latest commit and leaves that to Kernel, and a snapshot is opened
straight at the version or timestamp asked for.

Adds ErrorCodes.BAD_REQUEST, ApiException.badRequest and
ApiException.unsupportedFeatures, and fixtures for a log with in-commit
timestamps but no CommitInfo (in a directory with a space in its name)
and a table that is readable at its latest version but not at version 0.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Sun Cao <sun.cao+data@databricks.com>
@littlegrasscao

Copy link
Copy Markdown
Collaborator Author

Superseded by #195, which carries the same commit from an OpenSharing-IO branch so it can be the base of a stacked PR (#195 → #196 → #197). Review threads here were answered before the move.

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.

Table with a Delta log missing its first commit returns 500 instead of 502 CATALOG_ERROR

1 participant