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
IAdhocMapbacks it, perfect-hash key lookup and cached projections
Working with data
- Tables — table query DAG, SQL/JooQ integration, null handling
- Filtering —
ISliceFilter,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
IAdhocStreammodel - 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 Factory —
IOperatorsFactoryand injecting custom aggregations/combinations - Custom Aggregations — implementing
IAggregationfor domain objects;MarketRiskSensitivityexample - 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 viaICustomMarkerTranscoder; Spring-side wiring throughIAdhocSchemaCustomizer - Calculated Columns —
IColumnGenerator/IDecomposition(EXPLODE),FunctionCalculatedColumn(per-record function),EvaluatedExpressionColumn(user-authored expression), andColumnsManagerauto-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+AMeasureQueryStepfor arbitrary evaluation logic;RouterMeasureexample - Composite Cubes — unifying multiple
ICubeWrapperinstances viaCompositeCubesTableWrapper - Authorizations — rights management via
IImplicitFilter - Pivotable Security Model — SPA authentication flow,
SESSIONcookie 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