Skip to content

Welcome to Adhoc

This project develops an in-memory transformation engine to enable computations of complex KPIs on top of any aggregation engine.

Pivotable

Pivotable is a referential implementation of a web application wrapping Adhoc capabilities.

Documentation

Core concepts

  • Lexicon — key terms and concepts used throughout the project
  • Concepts — general architecture, query flow, measures, columns, and transcoders
  • Architecture — class hierarchy diagram generated from source
  • Slice and IAdhocMap — what a slice is, how IAdhocMap backs it, perfect-hash key lookup and cached projections

Working with data

  • Tables — table query DAG, SQL/JooQ integration, null handling
  • FilteringISliceFilter, IValueMatcher, custom operators, and performance notes
  • Type Inference — int→long and float→double promotion rules

Advanced topics

  • CubeQueryEngine — two-DAG workflow: Cube DAG (measure logic) and Table DAG (DB query optimisation)
  • Immutability — why immutable data structures improve correctness, caching, and thread safety
  • Concurrency — thread-pool topology, pool selection rules, and IAdhocStream model
  • Optimisations — data-structure and query optimisations (slices, perfect hashing, encodings, filter arithmetic)
  • Data Transfer — primitive type management (IValueReceiver, IValueProvider)
  • Unsafe — advanced tweaks and low-level configuration via AdhocUnsafe

Customisation

  • Operators FactoryIOperatorsFactory and injecting custom aggregations/combinations
  • Custom Aggregations — implementing IAggregation for domain objects; MarketRiskSensitivity example
  • ICombination — the simplest business-logic extension point; ISliceWithStep.sliceReader() and the GROUP BY coordinate guarantee
  • Partitionor — GROUP BY widening, per-partition combination, and the ForeignExchange use case
  • Filtrator — enforcing a constant hardcoded filter on top of the query filter
  • Unfiltrator — widening a filter to a coarser granularity; share-of-total and hierarchical totals
  • Shiftor — fetching data from a different slice via IFilterEditor; previous-day and business-day patterns
  • Custom Markers — per-query user context propagated to every CubeQueryStep; raw-map → typed-POJO transcoding via ICustomMarkerTranscoder; Spring-side wiring through IAdhocSchemaCustomizer
  • Calculated ColumnsIColumnGenerator / IDecomposition (EXPLODE), FunctionCalculatedColumn (per-record function), EvaluatedExpressionColumn (user-authored expression), and ColumnsManager auto-propagation
  • Hierarchies — modelling multi-level dimensions today and the roadmap for native hierarchy support
  • Many-to-many — how a single fact can contribute to multiple coordinates via Dispatchor
  • Custom Measures — implementing IHasUnderlyingMeasures + AMeasureQueryStep for arbitrary evaluation logic; RouterMeasure example
  • Composite Cubes — unifying multiple ICubeWrapper instances via CompositeCubesTableWrapper
  • Authorizations — rights management via IImplicitFilter
  • Pivotable Security Model — SPA authentication flow, SESSION cookie vs applicative JWT, and the /api/login/v1/* routes involved

Project reference

  • Module Dependencies — inter-module Maven dependency graph
  • Debug / Investigations — debug/explain query options and automated documentation tools
  • FAQ — recurrent cases with one or more solutions
  • Research — background reading and algorithmic references