Skip to content

Make java-qwp dataset-compatible with the Python generator#14

Open
javier wants to merge 2 commits into
mainfrom
jv/qwp_python_parity
Open

Make java-qwp dataset-compatible with the Python generator#14
javier wants to merge 2 commits into
mainfrom
jv/qwp_python_parity

Conversation

@javier

@javier javier commented Jun 30, 2026

Copy link
Copy Markdown
Owner

What & why

Makes the Java QWP generator dataset-compatible with the authoritative Python fx_data_generator.py, so a demo can backfill with one engine and continue (or go live) with the other on the same tables, with consistent schemas, views, and price continuity.

Changes

  • --prefix option (verbatim, default qwp_; set "" for the exact Python names). Trades stem renamed to fx_trades, so an empty prefix yields fx_trades (not trades), matching Python.
  • Full 11 Python-parity materialized views (was 3): core_price_1s/1d, bbo_1s/1m/1h/1d, market_data_ohlc_1m/15m/1d, fx_trades_ohlc_1m/1d — byte-faithful DDL, per-view TTLs, and REFRESH EVERY … DEFERRED START clauses, each gated on its base pool being enabled. --create_views now defaults to true (matches Python).
  • --incremental seeds from core_price (mid, spread, indicator1/indicator2) instead of mid-only from trades, and continues the per-symbol walk from it, so open(seam) == close(prev) for bid/ask/spread/indicators.
  • --incremental rejected in real-time (real-time always syncs live Yahoo quotes), symmetric with Python.
  • Real-time mid-walk drift 5.0 → 7.0 (faster-than-life stays 5.0), matching Python's real-time path.
  • Base-table STORAGE POLICY under --enterprise and per-view TTLs mirror Python.
  • Fixed the stale FxUniverse Javadoc.
  • READMEs (root + java-qwp/) updated; added INTERCHANGEABILITY_SPEC.md.

Validation (local QuestDB)

  • Isolated DDL: a throwaway-prefix FTL run created all 3 tables + all 11 views without error, and the views populated.
  • Cross-engine seam: a real Python backfill (00:00–13:00) continued by Java (--prefix "" --incremental) resumed all three pools contiguously from 13:00:00 with zero gap-seconds in fx_trades/market_data/core_price; core_price mid continuity ≤ 0.5 pip (pip-quantization only); the existing Python matviews incrementally refreshed across the seam.

Operational note

For a seamless cross-engine dataset, run both engines with the same EPS / orders rates — per-second density comes from the rate flags, not from the existing data, so mismatched EPS steps the row density at the seam even though prices stay continuous. Documented in both the README runbook and the spec.

javier added 2 commits June 30, 2026 13:20
Lets a Python backfill be continued (or taken live) by the Java generator
on the same tables, with matching schemas, views, and price continuity.

- Cli: add --prefix (verbatim, default qwp_; set "" for the exact Python
  names), prefix-based table accessors, rename the trades stem to fx_trades
  so an empty prefix yields fx_trades. Reject --incremental in real-time
  (real-time always syncs live quotes), and default --create_views to true
  to match Python.
- Views: create the full 11 Python-parity materialized views (core_price
  OHLC-mid, BBO 1s/1m/1h/1d ladder, market_data OHLC 1m/15m/1d, fx_trades
  OHLC 1m/1d) with byte-faithful DDL, per-view TTLs, and refresh/deferred
  clauses; each view gated on its base pool being enabled.
- Incremental: seed mid/spread/indicators from the last stored core_price
  row per symbol (was mid-only from trades) and continue the per-symbol
  walk from it, so open(seam) == close(prev) for bid/ask/spread/indicators.
- Real-time mid-walk drift 5.0 -> 7.0 (faster-than-life stays 5.0), matching
  the Python real-time path.
- Retention parity: base-table STORAGE POLICY under --enterprise and per-view
  TTLs already mirror Python.
- Fix the stale FxUniverse Javadoc (it no longer claims there is no order
  book / no market_data/core_price tables).
- Docs: update both READMEs and add INTERCHANGEABILITY_SPEC.md covering
  --prefix, the view set, incremental-from-core_price, and the requirement to
  match EPS/orders rates across engines for a seamless cross-engine dataset.
- Cli: new --durable_ack [true|false] (default false), independent of
  --enterprise. OSS rejects durable ack during the WS upgrade, so it stays
  opt-in; enable it for no-loss Enterprise HA.
- buildSender: call requestDurableAck(true) when --durable_ack, so a failover
  cannot lose rows the old primary accepted but had not yet replicated to the
  node that gets promoted.
- pom: default questdb.client.version to 1.3.6-SNAPSHOT (the build with the QWP
  HA role-failover + durable-ack lifecycle). Not on Maven Central; install the
  java-questdb-client locally, or override with -Dquestdb.client.version=...
- README: document --durable_ack and the 1.3.6-SNAPSHOT requirement.
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.

1 participant