This release adds 3 notable features for engineering teams evaluating rollout.
Published 3mo
Search Engines
✓ No known CVEs patched
✓ No known CVEs patched in this version
Topics
antlr4
data-processing
java
java-library
json
json-processing
+6 more
json-query
json-query-engine
maven
query-engine
sql
sql-parser
Summary
AI summaryCore Query Engine, SQL Syntax, Scalar/Aggregate Functions, Window Functions, Public API, Configuration & Security Defaults, and Build & Infrastructure were updated.
Full changelog
Core Query Engine
- SQL SELECT parsing via ANTLR4 grammar (case-insensitive keywords)
- Pipeline-based query execution: WHERE → GROUP BY → HAVING → WINDOW → ORDER BY → LIMIT → SELECT → DISTINCT
- Lazy streaming evaluation for WHERE and SELECT stages; materializing stages for GROUP BY, WINDOW, and ORDER BY
- Hash join execution for multi-source JOIN queries
- Nested JSON flattening with path-based field keys and query-scoped string interning
- Streaming JSON parser for efficient processing of large root arrays
- Zero external runtime dependencies beyond the ANTLR4 runtime
SQL Syntax
- SELECT with
*, specific columns, aliases (AS), and dot-notation aliases for structured nested output - FROM with root reference (
$r), nested path drilling ($r.response.data), table names for JOINs, and subqueries - JOIN / INNER JOIN, LEFT JOIN, RIGHT JOIN with equality
ONconditions (single or multi-column viaAND); chained JOINs supported - WHERE with comparison (
=,!=,>,<,>=,<=), pattern matching (LIKE,NOT LIKE), range (BETWEEN,NOT BETWEEN), set membership (IN,NOT IN), and null checks (IS NULL,IS NOT NULL) - GROUP BY with multiple columns and
HAVINGfilter on aggregated aliases - ORDER BY with
ASC/DESCon multiple columns and expressions - LIMIT and OFFSET for pagination
- DISTINCT for duplicate row elimination
- Subqueries in FROM clause (nesting depth bounded by a configurable limit)
- Logical connectives
AND/ORwith parenthesized grouping - Arbitrary nesting of function calls in SELECT, WHERE, GROUP BY, ORDER BY, and HAVING
- CASE expressions: Simple (
CASE expr WHEN val THEN result END) and searched (CASE WHEN condition THEN result END) forms, usable in SELECT, WHERE, ORDER BY, GROUP BY, and HAVING with full nesting support
Scalar & Aggregate Functions
- String (13): LOWER, UPPER (with locale support), CONCAT, SUBSTRING, TRIM, LENGTH, REPLACE, LEFT, RIGHT, LPAD, RPAD, REVERSE, POSITION
- Math (8): ABS, ROUND, CEIL, FLOOR, MOD, POWER, SQRT, SIGN
- Date/Time (10): TO_DATE (with optional format), NOW, YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, DATE_ADD, DATE_DIFF
- Conversion (3): CAST (7 target types: STRING, NUMBER, INTEGER, DECIMAL, BOOLEAN, DATE, DATETIME), NULLIF, COALESCE
- Aggregate (5): COUNT (including
COUNT(*)), SUM, AVG, MIN, MAX
Window Functions
- Ranking: ROW_NUMBER, RANK, DENSE_RANK, NTILE
- Offset: LAG, LEAD (with optional offset argument)
- Aggregate windows: SUM, AVG, COUNT, MIN, MAX usable with
OVER - OVER clause with
PARTITION BYand/orORDER BY(full-partition scope — window frames not yet supported)
Public API
SQL4Json— static facade:query(),queryAsJsonValue(),prepare(),engine()PreparedQuery— parse-once-execute-many, thread-safe and immutableSQL4JsonEngine— long-lived engine with bound data and optional result cache; thread-safeSQL4JsonEngineBuilder— fluent builder supporting both unnamed ($r) and named (JOIN) data sourcesQueryResultCache— SPI for custom cache implementations (default LRU provided); non-deterministic queries (e.g.NOW()) automatically bypass cachingJsonCodec— SPI for plugging in external JSON libraries (Jackson, Gson, etc.)JsonValue— sealed interface providing a library-native, dependency-free JSON abstraction
Configuration & Security Defaults
Sql4jsonSettings— immutable top-level settings record composed of four subsection records; customize any subsection viaSql4jsonSettings.builder()SecuritySettings:maxLikeWildcards(soft-ReDoS guard onLIKEpatterns),redactErrorDetails(multi-tenant information-disclosure guard)LimitsSettings:maxSqlLength,maxSubqueryDepth(default 16),maxInListSize,maxRowsPerQuery(enforced at GROUP BY, ORDER BY, WINDOW, JOIN, DISTINCT, and the final pipeline/streaming sink)CacheSettings: bounded LIKE-pattern cache (likePatternCacheSize), optional LRU query-result cache (queryResultCacheEnabled,queryResultCacheSize), plus a pluggableQueryResultCacheSPIDefaultJsonCodecSettings:maxInputLength,maxNestingDepth,maxStringLength,maxNumberLength,maxPropertyNameLength,maxArrayElements,duplicateKeyPolicyDuplicateKeyPolicyenum —REJECT(default),FIRST_WINS,LAST_WINS— resolves RFC 8259 ambiguity on duplicate object keys- Conservative defaults out of the box — protect against denial-of-service and information-disclosure risks in multi-tenant deployments without requiring any configuration
Type System
JsonValuesealed interface: object, array, string, number, boolean, nullSqlValuesealed interface for typed query processing: string, number, boolean, date, datetime, null- Sealed exception hierarchy:
SQL4JsonException→SQL4JsonParseException(with line/column),SQL4JsonExecutionException
Build & Infrastructure
- Java 21+ required (JPMS module with explicit exports)
- Published to Maven Central (
io.github.mnesimiyilmaz:sql4json) - GitHub Actions CI (formatting check + build + test)
- Spotless code formatting, CycloneDX SBOM generation
- OWASP dependency-check plugin
- Dependabot for automated dependency updates
Weekly OSS security release digest.
The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.
No spam, unsubscribe anytime.
Share this release
About Sql4json
All releases →Related context
Beta — feedback welcome: [email protected]