sap_hana: add SAP HANA polling input and hana driver support (ENG-1213) - #4775
Open
squiidz wants to merge 4 commits into
Open
sap_hana: add SAP HANA polling input and hana driver support (ENG-1213)#4775squiidz wants to merge 4 commits into
squiidz wants to merge 4 commits into
Conversation
Adds a sap_hana input with bulk, incrementing, timestamp, timestamp+incrementing, and query modes. Schema metadata comes from SYS.TABLE_COLUMNS (primary-key discovery, per-column nullability, precision-aware DECIMAL canonicalisation) and the high-water mark can be persisted to a cache resource for resume across restarts. Also adds driver: hana support to the sql_* components (go-hdb registered in every distribution) and a read benchmark harness with results. Checkpointing is ack-order aware: HWM snapshots flow through a checkpoint.Capped tracker bounded by an advanced checkpoint_limit field and only persist once every earlier batch has resolved. Cursor teardown after an error rewinds the in-memory HWM to the last safe value so scanned-but-undelivered rows are re-read instead of skipped. Supersedes the work started in an external PR; original implementation by David Dedu. Co-authored-by: ness-david-dedu <david.dedu@ness.com>
squiidz
force-pushed
the
eng-1213-sap-hana-input
branch
from
September 4, 2026 17:06
7f5c9a4 to
1367fba
Compare
- Register the saphana package in the integration-test registry so the integration-test-filter CI job passes. - Fix the metadata docs to name the keys the input actually emits (table_name, database_schema, schema, primary_key_columns), state when each is present, and skip database_schema when schema_name is unset. - Implement numeric_mapping=best_fit: DECIMAL columns whose precision fits a double (<= 15) map to Float64 at the schema layer and emit as floats, with an equivalent digit-count fallback when no schema is available; corrected the documented behaviour of none. - Expose the query retry delay as a retry_backoff duration field instead of a hardcoded one-second base. - Issue the first poll immediately on startup instead of sleeping a full poll_interval before the first query. - Document the fetch_size / checkpoint_limit interaction (oversized batches serialize, they do not deadlock) and warn at startup. - Drop the write benchmark sections that measured a dedicated output removed from this PR; the harness returns with the write-path PR. - Add unit coverage for timestamp and timestamp+incrementing query shapes and HWM advancement, checkpoint resume across restart, and the retry path.
HANA Express is an amd64-only ~4GB image that needs ~8GB RAM, relaxed seccomp, and a multi-minute cold start per container, which standard CI runners cannot provide. The testcontainers harness also starts one container per test and passes the SAP license agreement as an env var where the image requires a container argument, so it needs rework on an amd64 host before it can run anywhere.
… (ENG-1213) Every []byte from go-hdb was converted to a Go string, and encoding/json mangles invalid UTF-8 in strings into U+FFFD replacement characters, silently corrupting VARBINARY/BLOB values while the emitted schema promised ByteArray. Text-typed columns still convert to string, but binary columns (and, without schema metadata, any invalid-UTF-8 bytes) now stay []byte so JSON base64-encodes them losslessly. A failed primary-key catalog lookup was also swallowed without a log, leaving primary_key_columns silently absent for the pipeline lifetime (the schema result is cached); it now emits a warning naming the table.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adopts and supersedes #4462 by @ness-david-dedu, keeping the original commits and authorship, and carries the work forward so CI can run and the outstanding review findings are addressed.
What this adds
sap_hanainput withbulk,incrementing,timestamp,timestamp+incrementing, andquerymodes. Schema metadata comes fromSYS.TABLE_COLUMNS(primary-key discovery, per-column nullability, precision-aware DECIMAL canonicalisation) and the high-water mark can be persisted to a cache resource for resume across restarts.driver: hanasupport for thesql_*components.internal/impl/saphana/benchplus results indocs/benchmark-results/sap-hana.md.New since #4462 (addresses the 2026-08-03 review)
checkpoint.Cappedtracker (bounded by a new advancedcheckpoint_limitfield, default 1024) and only persist once every earlier batch has resolved, so a later batch acking first cannot checkpoint past rows still in flight. Nacks resolve their slot like acks: withauto_replay_nacks(the default) they are replayed, and disabling it is the documented opt-in to drop.driver: hanaworks in every distribution. go-hdb (Apache-2.0) is now registered inpublic/components/sqlalongside the other supported drivers, instead of only via the enterprise saphana package import.docs/modules/components/pages/inputs/sap_hana.adocplus the regeneratedsql_*pages).Also: merged latest main, fixed all outstanding lint issues on the branch, and added sqlmock-based unit tests covering the HWM rewind and ack-ordering behaviour (each was verified to fail against the previous implementation).
Known gaps / follow-ups
numeric_mapping: best_fitcurrently behaves identically tonone(both emit canonical decimal strings).partition_countknob is not implemented.