Skip to content

fix: graceful error handling for incompatible TsFile data decoding#15

Merged
HTHou merged 1 commit into
apache:mainfrom
CritasWang:fix/graceful-data-decode-error-handling
Apr 29, 2026
Merged

fix: graceful error handling for incompatible TsFile data decoding#15
HTHou merged 1 commit into
apache:mainfrom
CritasWang:fix/graceful-data-decode-error-handling

Conversation

@CritasWang
Copy link
Copy Markdown
Contributor

Summary

  • When reading TsFile data created by incompatible SDK versions (e.g., Python SDK), the DeltaBinaryDecoder throws BufferUnderflowException, which previously caused a 500 error with no user-facing explanation
  • Catch BufferUnderflowException and other runtime exceptions in all TsFileDataReader query methods, allowing partial data to be returned instead of crashing
  • Add warnings field to DataPreviewResponse to propagate decode error details to the frontend, and display them as an Alert in the data preview view

Changes

Backend:

  • TsFileDataReader: Added catch blocks for BufferUnderflowException, BufferOverflowException, and RuntimeException in all data reading methods; collect warning messages
  • DataReadResult: Added warnings field to carry decode warnings
  • DataPreviewResponse: Added warnings field with builder support
  • DataService: Pass warnings from DataReadResult through to response

Frontend:

  • types.ts: Added warnings?: string[] to DataPreviewResponse
  • data-preview/index.vue: Display warnings as an Ant Design Alert when data cannot be fully decoded
  • en-US.json / zh-CN.json: Added i18n translations for warning message

Test plan

  • Open a TsFile created by the Java SDK — should load data normally with no warnings
  • Open a TsFile created by the Python SDK — metadata loads, data preview shows a warning alert explaining the incompatibility instead of a 500 error
  • Verify the warning message is displayed in both English and Chinese locales

When reading TsFile data created by incompatible SDK versions (e.g.,
Python SDK), the DeltaBinaryDecoder throws BufferUnderflowException.
Previously this caused a 500 error with no user-facing explanation.

Changes:
- Catch BufferUnderflowException and other runtime exceptions in all
  TsFileDataReader query methods, allowing partial data to be returned
- Add warnings field to DataReadResult and DataPreviewResponse to
  propagate decode error details to the frontend
- Display warnings as an Alert in the data preview view when data
  cannot be fully decoded
- Add i18n translations for warning message (en-US and zh-CN)
@HTHou HTHou merged commit 5cb12ea into apache:main Apr 29, 2026
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