Skip to content

FC-816 Complex sql queries - #11

Merged
zonotope merged 52 commits into
masterfrom
feature/complex-sql-queries
Nov 12, 2020
Merged

zonotope merged 52 commits into
masterfrom
feature/complex-sql-queries

Conversation

@zonotope

@zonotope zonotope commented Nov 6, 2020

Copy link
Copy Markdown
Contributor

This patch includes support for queries involving a single collection, as well as limited support for multi-collection join queries.

TODO: add robust error handling later
case insensitivity was causing the parser to seemingly randomly capitalize some
recognized letters. removing case insensitivity for now, possibly to enable it
later after debugging.
this allows us to get rid of table-reference all together.
@zonotope
zonotope requested a review from a team November 6, 2020 21:50
@zonotope zonotope changed the title FC-501 Complex sql queries FC-816 Complex sql queries Nov 6, 2020
@zonotope
zonotope force-pushed the feature/complex-sql-queries branch from 901d401 to 22da7a8 Compare November 8, 2020 05:02
@zonotope
zonotope merged commit 3635cd3 into master Nov 12, 2020
@zonotope
zonotope deleted the feature/complex-sql-queries branch November 12, 2020 04:07
flyingmachine pushed a commit that referenced this pull request Feb 22, 2023
aaj3f added a commit that referenced this pull request Jul 18, 2026
…d crawl + wildcard TM-prune guard

The W4-1b fold sets star_constraints on the crawl wildcard, which flipped
has_star_members() and thereby (catch #10) DISABLED the trust_fk_refs
FK-template ref shortcut by construction — the folded crawl paid a full
parent-table scan (FACT_ORDER 36M) for every RefObjectMap POM that the
plain crawl renders scan-free. This was F-16's residual, realized by
W4-1b's own mechanism.

- ref_template_shortcut (operator.rs): re-enabled for a folded wildcard
  ONLY when every folded constraint is ObjectConstant::Scalar (catch #11:
  an IRI constraint on a ref predicate would be satisfied by the templated
  render of a DANGLING FK — the shortcut skips exactly the parent scan
  that would have dropped that subject = over-match). Decimal/Double
  constants are deliberately conservative-excluded (sound parent-scan
  path; only plain scalars qualify). Helper folded_wildcard_all_scalar +
  unit gate test covering scalar/iri/mixed/star/plain/fixed shapes.
- star_required_preds TM-prune: now fixed-predicate-star-only
  (predicate_var.is_none()). The all-preds prune argument does not
  transfer to a wildcard, which emits per-(p,o) across co-subject maps —
  pruning a map lacking the folded constraint predicate would drop its
  rows for vertically-partitioned subjects (F10-class mappings).
- harness: admit the mixed_group_keys feature tag (q066/q067 re-tagged
  with it; q066 joins the smoke subset for tag coverage); corpus
  meta-tests updated for the 68-member corpus incl. q068 rows-only.

F-16 closes pending the live q068 telemetry (expect ref render via
FK-template, zero FACT_ORDER files planned).
aaj3f added a commit that referenced this pull request Jul 18, 2026
…lar-folded crawl

Extracts the trust_fk_refs admission into ref_template_shortcut_enabled
(non-behavioral: the parent-lookup build now calls the named fn) and pins
the fire condition the corpus structurally cannot exercise: SPARQL corpus
queries run via query_from where trust_fk_refs is always false, so a
shortcut regression is perf-silent to q068 (the flag-true-vs-path-taken
seam, catch #10's class).

f16_ref_template_shortcut_fires_for_scalar_folded asserts: admission true
for a scalar-folded crawl under trust + build_ref_shortcut Some for the
single-col templated ref (together = the build inserts the shortcut, no
parent scan); admission false for Iri-folded (catch #11 dangling-FK
over-match hazard — sound parent-scan path), for trust-off (the chat
path), and for fixed-predicate stars; plain wildcards unchanged.
aaj3f added a commit that referenced this pull request Aug 27, 2026
…p into a shared head-stream pump

fluree-db-nameservice-sync grows head_stream::run_head_stream — the peer
subscription loop parameterized over everything runtime-specific: the
connection (SseChunkSource; ReqwestSseSource natively, a channel fed by
the browser driver's fetch-stream on wasm), the timer (Sleeper), the
consumer (HeadSink), and a watch-channel stop signal. It reuses the
crate's existing server_sse payload parser and lifts the server's
ExponentialBackoff verbatim (configurable multiplier, +/-25% jitter,
reset on clean stream end, 401/403 and token-load failures fatal). The
watch/server_sse modules are un-gated for wasm32 (pure code); rand moves
to both targets for the jitter; wasm gets tokio/sync for the stop
signal. Six native pump tests cover chunk-split parsing, backoff growth
and reset, malformed-frame skipping, and both stop paths.

fluree-db-server's PeerSubscriptionTask now drives the shared pump: the
task keeps its public shape (new/spawn, PeerSubscriptionError with its
is_fatal taxonomy retained for compat) and a PeerEventSink owns what
events mean for a peer — state watermarks, ledger-cache notify, preload
on connect, retraction eviction — with the previous log lines kept.

Two deliberate behavior deltas, both strict improvements: (1) ledger
records now carry source_branch/branches from the wire into
LedgerManager::notify (the old local conversion hardcoded None/0 —
lineage the peer needs for BranchedContentStore, cf. the proxy client's
finding #11 regression test); (2) an SSE record with an unparseable
ledger_id degrades to name=ledger_id instead of erroring the event.
NOTE: no existing integration test exercises the subscription task; the
gate here is the full server suite plus the pump's own unit tests.
aaj3f added a commit that referenced this pull request Aug 27, 2026
…p into a shared head-stream pump

fluree-db-nameservice-sync grows head_stream::run_head_stream — the peer
subscription loop parameterized over everything runtime-specific: the
connection (SseChunkSource; ReqwestSseSource natively, a channel fed by
the browser driver's fetch-stream on wasm), the timer (Sleeper), the
consumer (HeadSink), and a watch-channel stop signal. It reuses the
crate's existing server_sse payload parser and lifts the server's
ExponentialBackoff verbatim (configurable multiplier, +/-25% jitter,
reset on clean stream end, 401/403 and token-load failures fatal). The
watch/server_sse modules are un-gated for wasm32 (pure code); rand moves
to both targets for the jitter; wasm gets tokio/sync for the stop
signal. Six native pump tests cover chunk-split parsing, backoff growth
and reset, malformed-frame skipping, and both stop paths.

fluree-db-server's PeerSubscriptionTask now drives the shared pump: the
task keeps its public shape (new/spawn, PeerSubscriptionError with its
is_fatal taxonomy retained for compat) and a PeerEventSink owns what
events mean for a peer — state watermarks, ledger-cache notify, preload
on connect, retraction eviction — with the previous log lines kept.

Two deliberate behavior deltas, both strict improvements: (1) ledger
records now carry source_branch/branches from the wire into
LedgerManager::notify (the old local conversion hardcoded None/0 —
lineage the peer needs for BranchedContentStore, cf. the proxy client's
finding #11 regression test); (2) an SSE record with an unparseable
ledger_id degrades to name=ledger_id instead of erroring the event.
NOTE: no existing integration test exercises the subscription task; the
gate here is the full server suite plus the pump's own unit tests.
aaj3f added a commit that referenced this pull request Aug 28, 2026
…p into a shared head-stream pump

fluree-db-nameservice-sync grows head_stream::run_head_stream — the peer
subscription loop parameterized over everything runtime-specific: the
connection (SseChunkSource; ReqwestSseSource natively, a channel fed by
the browser driver's fetch-stream on wasm), the timer (Sleeper), the
consumer (HeadSink), and a watch-channel stop signal. It reuses the
crate's existing server_sse payload parser and lifts the server's
ExponentialBackoff verbatim (configurable multiplier, +/-25% jitter,
reset on clean stream end, 401/403 and token-load failures fatal). The
watch/server_sse modules are un-gated for wasm32 (pure code); rand moves
to both targets for the jitter; wasm gets tokio/sync for the stop
signal. Six native pump tests cover chunk-split parsing, backoff growth
and reset, malformed-frame skipping, and both stop paths.

fluree-db-server's PeerSubscriptionTask now drives the shared pump: the
task keeps its public shape (new/spawn, PeerSubscriptionError with its
is_fatal taxonomy retained for compat) and a PeerEventSink owns what
events mean for a peer — state watermarks, ledger-cache notify, preload
on connect, retraction eviction — with the previous log lines kept.

Two deliberate behavior deltas, both strict improvements: (1) ledger
records now carry source_branch/branches from the wire into
LedgerManager::notify (the old local conversion hardcoded None/0 —
lineage the peer needs for BranchedContentStore, cf. the proxy client's
finding #11 regression test); (2) an SSE record with an unparseable
ledger_id degrades to name=ledger_id instead of erroring the event.
NOTE: no existing integration test exercises the subscription task; the
gate here is the full server suite plus the pump's own unit tests.
aaj3f added a commit that referenced this pull request Aug 28, 2026
…p into a shared head-stream pump

fluree-db-nameservice-sync grows head_stream::run_head_stream — the peer
subscription loop parameterized over everything runtime-specific: the
connection (SseChunkSource; ReqwestSseSource natively, a channel fed by
the browser driver's fetch-stream on wasm), the timer (Sleeper), the
consumer (HeadSink), and a watch-channel stop signal. It reuses the
crate's existing server_sse payload parser and lifts the server's
ExponentialBackoff verbatim (configurable multiplier, +/-25% jitter,
reset on clean stream end, 401/403 and token-load failures fatal). The
watch/server_sse modules are un-gated for wasm32 (pure code); rand moves
to both targets for the jitter; wasm gets tokio/sync for the stop
signal. Six native pump tests cover chunk-split parsing, backoff growth
and reset, malformed-frame skipping, and both stop paths.

fluree-db-server's PeerSubscriptionTask now drives the shared pump: the
task keeps its public shape (new/spawn, PeerSubscriptionError with its
is_fatal taxonomy retained for compat) and a PeerEventSink owns what
events mean for a peer — state watermarks, ledger-cache notify, preload
on connect, retraction eviction — with the previous log lines kept.

Two deliberate behavior deltas, both strict improvements: (1) ledger
records now carry source_branch/branches from the wire into
LedgerManager::notify (the old local conversion hardcoded None/0 —
lineage the peer needs for BranchedContentStore, cf. the proxy client's
finding #11 regression test); (2) an SSE record with an unparseable
ledger_id degrades to name=ledger_id instead of erroring the event.
NOTE: no existing integration test exercises the subscription task; the
gate here is the full server suite plus the pump's own unit tests.
aaj3f added a commit that referenced this pull request Sep 2, 2026
…p into a shared head-stream pump

fluree-db-nameservice-sync grows head_stream::run_head_stream — the peer
subscription loop parameterized over everything runtime-specific: the
connection (SseChunkSource; ReqwestSseSource natively, a channel fed by
the browser driver's fetch-stream on wasm), the timer (Sleeper), the
consumer (HeadSink), and a watch-channel stop signal. It reuses the
crate's existing server_sse payload parser and lifts the server's
ExponentialBackoff verbatim (configurable multiplier, +/-25% jitter,
reset on clean stream end, 401/403 and token-load failures fatal). The
watch/server_sse modules are un-gated for wasm32 (pure code); rand moves
to both targets for the jitter; wasm gets tokio/sync for the stop
signal. Six native pump tests cover chunk-split parsing, backoff growth
and reset, malformed-frame skipping, and both stop paths.

fluree-db-server's PeerSubscriptionTask now drives the shared pump: the
task keeps its public shape (new/spawn, PeerSubscriptionError with its
is_fatal taxonomy retained for compat) and a PeerEventSink owns what
events mean for a peer — state watermarks, ledger-cache notify, preload
on connect, retraction eviction — with the previous log lines kept.

Two deliberate behavior deltas, both strict improvements: (1) ledger
records now carry source_branch/branches from the wire into
LedgerManager::notify (the old local conversion hardcoded None/0 —
lineage the peer needs for BranchedContentStore, cf. the proxy client's
finding #11 regression test); (2) an SSE record with an unparseable
ledger_id degrades to name=ledger_id instead of erroring the event.
NOTE: no existing integration test exercises the subscription task; the
gate here is the full server suite plus the pump's own unit tests.
aaj3f added a commit that referenced this pull request Sep 2, 2026
…p into a shared head-stream pump

fluree-db-nameservice-sync grows head_stream::run_head_stream — the peer
subscription loop parameterized over everything runtime-specific: the
connection (SseChunkSource; ReqwestSseSource natively, a channel fed by
the browser driver's fetch-stream on wasm), the timer (Sleeper), the
consumer (HeadSink), and a watch-channel stop signal. It reuses the
crate's existing server_sse payload parser and lifts the server's
ExponentialBackoff verbatim (configurable multiplier, +/-25% jitter,
reset on clean stream end, 401/403 and token-load failures fatal). The
watch/server_sse modules are un-gated for wasm32 (pure code); rand moves
to both targets for the jitter; wasm gets tokio/sync for the stop
signal. Six native pump tests cover chunk-split parsing, backoff growth
and reset, malformed-frame skipping, and both stop paths.

fluree-db-server's PeerSubscriptionTask now drives the shared pump: the
task keeps its public shape (new/spawn, PeerSubscriptionError with its
is_fatal taxonomy retained for compat) and a PeerEventSink owns what
events mean for a peer — state watermarks, ledger-cache notify, preload
on connect, retraction eviction — with the previous log lines kept.

Two deliberate behavior deltas, both strict improvements: (1) ledger
records now carry source_branch/branches from the wire into
LedgerManager::notify (the old local conversion hardcoded None/0 —
lineage the peer needs for BranchedContentStore, cf. the proxy client's
finding #11 regression test); (2) an SSE record with an unparseable
ledger_id degrades to name=ledger_id instead of erroring the event.
NOTE: no existing integration test exercises the subscription task; the
gate here is the full server suite plus the pump's own unit tests.
aaj3f added a commit that referenced this pull request Sep 3, 2026
…p into a shared head-stream pump

fluree-db-nameservice-sync grows head_stream::run_head_stream — the peer
subscription loop parameterized over everything runtime-specific: the
connection (SseChunkSource; ReqwestSseSource natively, a channel fed by
the browser driver's fetch-stream on wasm), the timer (Sleeper), the
consumer (HeadSink), and a watch-channel stop signal. It reuses the
crate's existing server_sse payload parser and lifts the server's
ExponentialBackoff verbatim (configurable multiplier, +/-25% jitter,
reset on clean stream end, 401/403 and token-load failures fatal). The
watch/server_sse modules are un-gated for wasm32 (pure code); rand moves
to both targets for the jitter; wasm gets tokio/sync for the stop
signal. Six native pump tests cover chunk-split parsing, backoff growth
and reset, malformed-frame skipping, and both stop paths.

fluree-db-server's PeerSubscriptionTask now drives the shared pump: the
task keeps its public shape (new/spawn, PeerSubscriptionError with its
is_fatal taxonomy retained for compat) and a PeerEventSink owns what
events mean for a peer — state watermarks, ledger-cache notify, preload
on connect, retraction eviction — with the previous log lines kept.

Two deliberate behavior deltas, both strict improvements: (1) ledger
records now carry source_branch/branches from the wire into
LedgerManager::notify (the old local conversion hardcoded None/0 —
lineage the peer needs for BranchedContentStore, cf. the proxy client's
finding #11 regression test); (2) an SSE record with an unparseable
ledger_id degrades to name=ledger_id instead of erroring the event.
NOTE: no existing integration test exercises the subscription task; the
gate here is the full server suite plus the pump's own unit tests.
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