Skip to content

Re-work ordering clause support in query builder - #2047

Merged
absurdfarce merged 1 commit into
apache:4.xfrom
absurdfarce:consolidate_query_builder_ordering
Jan 14, 2026
Merged

absurdfarce merged 1 commit into
apache:4.xfrom
absurdfarce:consolidate_query_builder_ordering

Conversation

@absurdfarce

Copy link
Copy Markdown
Contributor

Goal is to unify ordering clause support in the query builder into a single OrderingClause entity. This will enable future implementations to completely manage the structure of "ORDER BY" clauses at granular levels.

A concrete example: we've been able to leverage this functionality to implement support for BM25 queries on Astra. Ideally something like this can be added to cassandra-java-driver once it makes it's way to OSS Cassandra but until then we should be safe to get the support for these kinds of extensions (included in this PR) into the driver.

diff --git a/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/select/BM25OrderingClause.java b/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/select/BM25OrderingClause.java
new file mode 100644
index 00000000000..5f5daa7499e
--- /dev/null
+++ b/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/select/BM25OrderingClause.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.datastax.oss.driver.api.querybuilder.select;
+
+import com.datastax.oss.driver.api.core.CqlIdentifier;
+import com.datastax.oss.driver.api.querybuilder.QueryBuilder;
+import edu.umd.cs.findbugs.annotations.NonNull;
+
+public class BM25OrderingClause extends OrderingClause {
+
+  private final CqlIdentifier identifier;
+  private final String stringToMatch;
+
+  BM25OrderingClause(CqlIdentifier identifier, String stringToMatch) {
+
+    this.identifier = identifier;
+    this.stringToMatch = stringToMatch;
+  }
+
+  public static BM25OrderingClause create(CqlIdentifier identifier, String stringToMatch) {
+    return new BM25OrderingClause(identifier, stringToMatch);
+  }
+
+  @Override
+  public void appendTo(@NonNull StringBuilder builder) {
+    builder.append(" ORDER BY ").append(this.identifier.asCql(true)).append(" BM25 OF ");
+    QueryBuilder.literal(this.stringToMatch).appendTo(builder);
+  }
+}
diff --git a/query-builder/src/main/java/com/datastax/oss/driver/internal/querybuilder/select/BM25Select.java b/query-builder/src/main/java/com/datastax/oss/driver/internal/querybuilder/select/BM25Select.java
new file mode 100644
index 00000000000..4f22fa6d3db
--- /dev/null
+++ b/query-builder/src/main/java/com/datastax/oss/driver/internal/querybuilder/select/BM25Select.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.datastax.oss.driver.internal.querybuilder.select;
+
+import com.datastax.oss.driver.api.core.CqlIdentifier;
+import com.datastax.oss.driver.api.querybuilder.select.BM25OrderingClause;
+import com.datastax.oss.driver.api.querybuilder.select.Select;
+import edu.umd.cs.findbugs.annotations.NonNull;
+
+public class BM25Select extends DefaultSelect {
+
+  public BM25Select(DefaultSelect copy) {
+    super(
+        copy.getKeyspace(),
+        copy.getTable(),
+        copy.isJson(),
+        copy.isDistinct(),
+        copy.getSelectors(),
+        copy.getRelations(),
+        copy.getGroupByClauses(),
+        copy.getOrderingClause(),
+        copy.getLimit(),
+        copy.getPerPartitionLimit(),
+        copy.allowsFiltering());
+  }
+
+  public static BM25Select create(DefaultSelect copy) {
+    return new BM25Select(copy);
+  }
+
+  @NonNull
+  public Select orderByBM25Of(@NonNull String columnName, @NonNull String stringToMatch) {
+    return withOrderingClause(
+        BM25OrderingClause.create(CqlIdentifier.fromCql(columnName), stringToMatch));
+  }
+
+  @NonNull
+  public Select orderByBM25Of(@NonNull CqlIdentifier columnId, @NonNull String stringToMatch) {
+    return withOrderingClause(BM25OrderingClause.create(columnId, stringToMatch));
+  }
+}
diff --git a/query-builder/src/test/java/com/datastax/oss/driver/api/querybuilder/select/BM25SelectOrderingTest.java b/query-builder/src/test/java/com/datastax/oss/driver/api/querybuilder/select/BM25SelectOrderingTest.java
new file mode 100644
index 00000000000..03ba0bb5aa0
--- /dev/null
+++ b/query-builder/src/test/java/com/datastax/oss/driver/api/querybuilder/select/BM25SelectOrderingTest.java
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.datastax.oss.driver.api.querybuilder.select;
+
+import static com.datastax.oss.driver.api.core.metadata.schema.ClusteringOrder.ASC;
+import static com.datastax.oss.driver.api.core.metadata.schema.ClusteringOrder.DESC;
+import static com.datastax.oss.driver.api.querybuilder.Assertions.assertThat;
+import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.literal;
+import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.selectFrom;
+
+import com.datastax.oss.driver.api.core.data.CqlVector;
+import com.datastax.oss.driver.api.querybuilder.relation.Relation;
+import com.datastax.oss.driver.internal.querybuilder.select.BM25Select;
+import com.datastax.oss.driver.internal.querybuilder.select.DefaultSelect;
+import org.junit.Test;
+
+public class BM25SelectOrderingTest {
+
+  @Test
+  public void should_generate_bm25_ordering_clauses() {
+    DefaultSelect base =
+        (DefaultSelect) selectFrom("foo").all().where(Relation.column("k").isEqualTo(literal(1)));
+    assertThat(BM25Select.create(base).orderByBM25Of("c1", "foo"))
+        .hasCql("SELECT * FROM foo WHERE k=1 ORDER BY c1 BM25 OF 'foo'");
+  }
+
+  @Test
+  public void should_replace_columns_ordering_with_bm25() {
+    DefaultSelect base =
+        (DefaultSelect)
+            selectFrom("foo")
+                .all()
+                .where(Relation.column("k").isEqualTo(literal(1)))
+                .orderBy("c1", ASC)
+                .orderBy("c2", DESC);
+    assertThat(BM25Select.create(base).orderByBM25Of("c1", "foo"))
+        .hasCql("SELECT * FROM foo WHERE k=1 ORDER BY c1 BM25 OF 'foo'");
+  }
+
+  @Test
+  public void should_replace_ann_ordering_with_bm25() {
+    DefaultSelect base =
+        (DefaultSelect)
+            selectFrom("foo")
+                .all()
+                .where(Relation.column("k").isEqualTo(literal(1)))
+                .orderByAnnOf("c1", CqlVector.newInstance(0.1, 0.2, 0.3));
+    assertThat(BM25Select.create(base).orderByBM25Of("c1", "foo"))
+        .hasCql("SELECT * FROM foo WHERE k=1 ORDER BY c1 BM25 OF 'foo'");
+  }
+
+  @Test
+  public void should_replace_bm25_ordering_with_columns() {
+    DefaultSelect base =
+        (DefaultSelect) selectFrom("foo").all().where(Relation.column("k").isEqualTo(literal(1)));
+    Select bm25Select = BM25Select.create(base).orderByBM25Of("c1", "foo");
+    Select finalSelect = bm25Select.orderBy("c1", ASC).orderBy("c2", DESC);
+    assertThat(finalSelect).hasCql("SELECT * FROM foo WHERE k=1 ORDER BY c1 ASC,c2 DESC");
+  }
+
+  @Test
+  public void should_replace_bm25_ordering_with_ann() {
+    DefaultSelect base =
+        (DefaultSelect) selectFrom("foo").all().where(Relation.column("k").isEqualTo(literal(1)));
+    Select bm25Select = BM25Select.create(base).orderByBM25Of("c1", "foo");
+    Select finalSelect = bm25Select.orderByAnnOf("c1", CqlVector.newInstance(0.1, 0.2, 0.3));
+    assertThat(finalSelect)
+        .hasCql("SELECT * FROM foo WHERE k=1 ORDER BY c1 ANN OF [0.1, 0.2, 0.3]");
+  }
+}

@lukasz-antoniak
lukasz-antoniak self-requested a review January 13, 2026 12:25

@lukasz-antoniak lukasz-antoniak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT, maybe just add one-liner JavaDoc to ColumnsOrderingClause and AnnOrderingClause?

@absurdfarce

Copy link
Copy Markdown
Contributor Author

Good catch @lukasz-antoniak! Added a few sentences for each class... take a look and let me know if you're good with what's here now.

…ringClause abstraction. This allows for

custom impls to define their own logic for managing "ORDER BY" clauses.

patch by Bret McGuire; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2047
@absurdfarce
absurdfarce force-pushed the consolidate_query_builder_ordering branch from 3e04c08 to b3c1021 Compare January 14, 2026 21:48
@absurdfarce
absurdfarce merged commit af0a63a into apache:4.x Jan 14, 2026
@absurdfarce
absurdfarce deleted the consolidate_query_builder_ordering branch January 14, 2026 21:51
nikagra added a commit to nikagra/java-driver that referenced this pull request Oct 20, 2026
* [maven-release-plugin] prepare for next development iteration

* Removing interface to Travis CI

Patch by Bret McGuire; reviewed by Andy Tolbert and Bret McGuire
reference: apache#2066

* Replace outdated link in README

patch by April Murphy; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2064

* ninja-fix: Remove ASF donation message

* Update LZ4 and Netty dependencies for CVE response

The primary goal here is to address CVE-2025-12183. Netty includes a
dependency on vulnerable versions of lz4-java, so update to a fixed
version of Netty as well. On the C* server side, we opted to move to the
new community fork of lz4-java, so match that decision here
(CASSANDRA-21052).

patch by Abe Ratnofsky; reviewed by Francisco Guerrero for CASSJAVA-113

* Bump logback to most recent Java8-compatible version

patch by Bret McGuire; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2051

* ninja-fix - adding an extra space to render the page correctly with mkdocs

I've been looking into details on custom codes and noticed that the there is an issue with rendering bullet points on the following page: https://apache.github.io/cassandra-java-driver/4.19.0/core/custom_codecs/

* ninja-fix Updating a few indented lists that were observed to not render correctly while working on the previous ninja-fix

* Re-work ordering clause support in query builder behind a single OrderingClause abstraction.  This allows for
custom impls to define their own logic for managing "ORDER BY" clauses.

patch by Bret McGuire; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2047

* ninja-fix We apparently had some unformatted files slip in in the last commit

* CASSJAVA-122 Fix OSGi LZ4 test

patch by Lukasz Antoniak; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2075

* Bump Jackson to 2.20.1

patch by Bret McGuire: reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2076

* CASSJAVA-108 Update ESRI (and remove org.json) dependencies

patch by Bret McGuire; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2052

* ninja-fix Update Jenkins label to Jammy

* Revert "ninja-fix Update Jenkins label to Jammy"

This reverts commit de96ce8.

* Fix race condition in ClockSeqAndNodeContainer

patch by Jason Koch; reviewed by Lukasz Antoniak and Bret McGuire
reference: apache#2050

* CASSJAVA-3: Fix ordering of LIMIT and PER PARTITION LIMIT clauses

patch by David Stringer; reviewed by Lukasz Antoniak and Bret McGuire
reference: apache#2022

* CASSJAVA-30: Update CONTRIBUTING.md
patch by Jane He; reviewed by Bret McGuire and Andy Tolbert

* CASSJAVA-104: Fix Flaky tests
patch by Jane He; review by
Bret McGuire and Andy Tolbert

* CASSJAVA-109, CASSJAVA-117: Manual and API References after donation, Build CI for Java Driver Doc
Patch by Jane He and
Łukasz Antoniak; Reviewed by Bret McGuire

* [maven-release-plugin] prepare release 4.19.3

* [maven-release-plugin] prepare for next development iteration

* Revert "[maven-release-plugin] prepare for next development iteration"

This reverts commit 342088c.

* Revert "[maven-release-plugin] prepare release 4.19.3"

This reverts commit 375e4b5.

* Revert apache#2051 and replace it with something closer to the intent of the original PR (apache#1901).

The change that was actually merged attempted to bump us up to the most recent Java8-compatible
logback impl.  This moved us from 1.2.x to 1.3.x which in turn brought some dependency changes
that were excessive, especially for a patch release.

patch by Bret McGuire; reviewed by Andy Tolbert and Abe Ratnofsky
reference: apache#2088

* Add changelog for 4.19.3

* [maven-release-plugin] prepare release 4.19.3

* Revert "[maven-release-plugin] prepare release 4.19.3"

This reverts commit 8e2e70c.

* [maven-release-plugin] prepare release 4.19.3

---------

Co-authored-by: absurdfarce <[email protected]>
Co-authored-by: April I. Murphy <[email protected]>
Co-authored-by: Lukasz Antoniak <[email protected]>
Co-authored-by: Abe Ratnofsky <[email protected]>
Co-authored-by: absurdfarce <[email protected]>
Co-authored-by: Mikhail Laptev <[email protected]>
Co-authored-by: jasonk000 <[email protected]>
Co-authored-by: David Stringer <[email protected]>
Co-authored-by: janehe <[email protected]>
Co-authored-by: janehe <[email protected]>
Co-authored-by: Abe Ratnofsky <[email protected]>
Co-authored-by: Abe Ratnofsky <[email protected]>
dkropachev pushed a commit to scylladb/java-driver that referenced this pull request Oct 28, 2026
* [maven-release-plugin] prepare for next development iteration

* Removing interface to Travis CI

Patch by Bret McGuire; reviewed by Andy Tolbert and Bret McGuire
reference: apache#2066

* Replace outdated link in README

patch by April Murphy; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2064

* ninja-fix: Remove ASF donation message

* Update LZ4 and Netty dependencies for CVE response

The primary goal here is to address CVE-2025-12183. Netty includes a
dependency on vulnerable versions of lz4-java, so update to a fixed
version of Netty as well. On the C* server side, we opted to move to the
new community fork of lz4-java, so match that decision here
(CASSANDRA-21052).

patch by Abe Ratnofsky; reviewed by Francisco Guerrero for CASSJAVA-113

* Bump logback to most recent Java8-compatible version

patch by Bret McGuire; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2051

* ninja-fix - adding an extra space to render the page correctly with mkdocs

I've been looking into details on custom codes and noticed that the there is an issue with rendering bullet points on the following page: https://apache.github.io/cassandra-java-driver/4.19.0/core/custom_codecs/

* ninja-fix Updating a few indented lists that were observed to not render correctly while working on the previous ninja-fix

* Re-work ordering clause support in query builder behind a single OrderingClause abstraction.  This allows for
custom impls to define their own logic for managing "ORDER BY" clauses.

patch by Bret McGuire; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2047

* ninja-fix We apparently had some unformatted files slip in in the last commit

* CASSJAVA-122 Fix OSGi LZ4 test

patch by Lukasz Antoniak; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2075

* Bump Jackson to 2.20.1

patch by Bret McGuire: reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2076

* CASSJAVA-108 Update ESRI (and remove org.json) dependencies

patch by Bret McGuire; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2052

* ninja-fix Update Jenkins label to Jammy

* Revert "ninja-fix Update Jenkins label to Jammy"

This reverts commit de96ce8.

* Fix race condition in ClockSeqAndNodeContainer

patch by Jason Koch; reviewed by Lukasz Antoniak and Bret McGuire
reference: apache#2050

* CASSJAVA-3: Fix ordering of LIMIT and PER PARTITION LIMIT clauses

patch by David Stringer; reviewed by Lukasz Antoniak and Bret McGuire
reference: apache#2022

* CASSJAVA-30: Update CONTRIBUTING.md
patch by Jane He; reviewed by Bret McGuire and Andy Tolbert

* CASSJAVA-104: Fix Flaky tests
patch by Jane He; review by
Bret McGuire and Andy Tolbert

* CASSJAVA-109, CASSJAVA-117: Manual and API References after donation, Build CI for Java Driver Doc
Patch by Jane He and
Łukasz Antoniak; Reviewed by Bret McGuire

* [maven-release-plugin] prepare release 4.19.3

* [maven-release-plugin] prepare for next development iteration

* Revert "[maven-release-plugin] prepare for next development iteration"

This reverts commit 342088c.

* Revert "[maven-release-plugin] prepare release 4.19.3"

This reverts commit 375e4b5.

* Revert apache#2051 and replace it with something closer to the intent of the original PR (apache#1901).

The change that was actually merged attempted to bump us up to the most recent Java8-compatible
logback impl.  This moved us from 1.2.x to 1.3.x which in turn brought some dependency changes
that were excessive, especially for a patch release.

patch by Bret McGuire; reviewed by Andy Tolbert and Abe Ratnofsky
reference: apache#2088

* Add changelog for 4.19.3

* [maven-release-plugin] prepare release 4.19.3

* Revert "[maven-release-plugin] prepare release 4.19.3"

This reverts commit 8e2e70c.

* [maven-release-plugin] prepare release 4.19.3

* [maven-release-plugin] prepare for next development iteration

* Add security-model discoverability (AGENTS.md -> SECURITY.md -> security model)

Wires the conventional AGENTS.md -> SECURITY.md -> security model chain so automated tooling can mechanically discover the project's security model. No model content is changed.

Generated-by: Claude Opus 4.8 (1M context)

patch by Jarek Potiuk; reviewed by Bret McGuire
reference: apache#2092

* ninja-fix Fix equality operation for Geometry subclasses

* CASSJAVA-131: Add Retention Requirement to Jenkinsfile-asf
patch by Jane He; reviewed by Michael Semb Wever

* CASSJAVA-136 Ninja fix to correct geometry equality actually broke geometry equality

patch by Bret McGuire; reviewed by Jane He

* CASSJAVA-137 Bump Netty to 4.1.138

patch by Bret McGuire; reviewed by Andy Tolbert

* ninja-fix Changelog entries for 4.19.4

* ninja-fix Update scm entry in root pom.xml to match what was done for 3.x

* ninja-fix XML formatting fix for pom.xml

* [maven-release-plugin] prepare release 4.19.4

* docs: restore Sphinx link style in merged manual pages

Upstream rewrote manual links to mkdocs' dir/README.md form, and the
lines without conflicts merged that way. Put them back to our ../dir/
form: the docs hook rewrites both forms and GitHub renders both, so
this is source consistency rather than a build requirement. Record the
rule in CONTRIBUTING so the next sync does not rediscover it.
Upstream's anchor and typo fixes stay.

Refs: DRIVER-1126
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>

* build: keep the mapper-runtime revapi baseline

Upstream 4.19.3 reset its revapi baselines after its release; the
other modules kept ours through conflicts, but mapper-runtime merged
cleanly and lost its entries. They are DataStax-era ignores (JAVA-2369,
JAVA-2633, JAVA-2792), inert against the 4.19.2.3 baseline revapi
resolves, so this only keeps the file identical to the line.

Refs: DRIVER-1126
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>

* docs: fix anchors, nesting and a stale version from the merge

Upstream's link to #inflighthandler was dead because the fork had
renamed the heading to match its own broken link; restore upstream's
heading. Re-indent the custom codecs list so the runtime snippet stays
inside its item, and lift the lz4-java example to the pinned version.

Refs: DRIVER-1126
Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix: compare geometries by the wrapped ESRI geometry

Since 4.19.3 equals() bound to OGCGeometry.equals(Object), which ESRI
1.x does not declare, so an application still on 1.x silently fell
back to identity comparison. Compare what that method compares, the
wrapped com.esri.core.geometry.Geometry and the spatial reference,
through API both 1.x and 2.x have; hashCode() already hashes the
geometry. The upgrade note no longer needs the 2.2.4 requirement.

Refs: DRIVER-1126
Co-Authored-By: Claude Fable 5.1 <[email protected]>

* test: restore the OSGi bundle provisioning the merge broke

Two slips in BundleOptions. The shaded guava bundle kept the
org.apache.cassandra groupId from #895, which versionAsInProject()
cannot resolve through our dependencies.properties. The 4.19.3 merge
resolved the lz4Bundle() conflict to our side and dropped upstream's
CASSJAVA-122 sun.misc extension bundle, which lz4-java imports. Every
Osgi*IT is @ignore'd and no lane runs them (#1293), so neither showed.

Refs: DRIVER-1126
Co-Authored-By: Claude Fable 5.1 <[email protected]>

* test: drop the prepared-cache retention the merge made redundant

Upstream 4.19.3 moved weakValues() from the protected constructor's
base builder into the public constructor's decorator, so a subclass
that passes its own decorator now gets a strong cache. Our
TestCqlPrepareAsyncProcessor only retained the cached futures to stop
them being collected mid-test. Take upstream's comment, drop the
retention set and the process() override, and require the removal
event again instead of checking it only when present.

Refs: DRIVER-1126
Co-Authored-By: Claude Fable 5.1 <[email protected]>

* docs: correct the ordering javadoc taken from upstream

Select.orderBy() still promises to append to the current list, but
since the OrderingClause rework an ANN ordering is replaced instead,
and orderByAnnOf() replaces any column ordering; say so. ANN stands
for approximate, not adjacent, nearest neighbor.

Refs: DRIVER-1126
Co-Authored-By: Claude Fable 5.1 <[email protected]>

* docs: drop fork entries from the upstream changelog

changelog/README.md tracks upstream releases only. The 4.19.2.3 section
came in with feature PRs; the same changes are described in the upgrade
guide and the GitHub release notes.

Refs: DRIVER-1126
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* build: bump version to 4.19.4.0-SNAPSHOT

The line now carries upstream 4.19.4, so the next fork release
restarts the fourth component at 4.19.4.0, as 4.19.2.0 did after the
4.19.2 sync.

Refs: DRIVER-1126
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test: await the prepared-cache removal event

Guava lowers the cache size before it calls the removal listener, so the
size wait alone left the removed-query-id assertion racing the event.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: keep ANN ordering on an empty orderByIds map

The ordering-clause rework made orderByIds(emptyMap) replace an ANN
ordering with nothing; 4.19.2.x kept it. Document the map overloads'
replace behaviour and fix a typo in CqlPrepareAsyncProcessor.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: absurdfarce <[email protected]>
Co-authored-by: April I. Murphy <[email protected]>
Co-authored-by: Lukasz Antoniak <[email protected]>
Co-authored-by: Abe Ratnofsky <[email protected]>
Co-authored-by: absurdfarce <[email protected]>
Co-authored-by: Mikhail Laptev <[email protected]>
Co-authored-by: jasonk000 <[email protected]>
Co-authored-by: David Stringer <[email protected]>
Co-authored-by: janehe <[email protected]>
Co-authored-by: janehe <[email protected]>
Co-authored-by: Abe Ratnofsky <[email protected]>
Co-authored-by: Abe Ratnofsky <[email protected]>
Co-authored-by: Jarek Potiuk <[email protected]>
Co-authored-by: Jane He <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
dkropachev pushed a commit to scylladb/java-driver that referenced this pull request Oct 30, 2026
* [maven-release-plugin] prepare for next development iteration

* Removing interface to Travis CI

Patch by Bret McGuire; reviewed by Andy Tolbert and Bret McGuire
reference: apache#2066

* Replace outdated link in README

patch by April Murphy; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2064

* ninja-fix: Remove ASF donation message

* Update LZ4 and Netty dependencies for CVE response

The primary goal here is to address CVE-2025-12183. Netty includes a
dependency on vulnerable versions of lz4-java, so update to a fixed
version of Netty as well. On the C* server side, we opted to move to the
new community fork of lz4-java, so match that decision here
(CASSANDRA-21052).

patch by Abe Ratnofsky; reviewed by Francisco Guerrero for CASSJAVA-113

* Bump logback to most recent Java8-compatible version

patch by Bret McGuire; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2051

* ninja-fix - adding an extra space to render the page correctly with mkdocs

I've been looking into details on custom codes and noticed that the there is an issue with rendering bullet points on the following page: https://apache.github.io/cassandra-java-driver/4.19.0/core/custom_codecs/

* ninja-fix Updating a few indented lists that were observed to not render correctly while working on the previous ninja-fix

* Re-work ordering clause support in query builder behind a single OrderingClause abstraction.  This allows for
custom impls to define their own logic for managing "ORDER BY" clauses.

patch by Bret McGuire; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2047

* ninja-fix We apparently had some unformatted files slip in in the last commit

* CASSJAVA-122 Fix OSGi LZ4 test

patch by Lukasz Antoniak; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2075

* Bump Jackson to 2.20.1

patch by Bret McGuire: reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2076

* CASSJAVA-108 Update ESRI (and remove org.json) dependencies

patch by Bret McGuire; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2052

* ninja-fix Update Jenkins label to Jammy

* Revert "ninja-fix Update Jenkins label to Jammy"

This reverts commit de96ce8.

* Fix race condition in ClockSeqAndNodeContainer

patch by Jason Koch; reviewed by Lukasz Antoniak and Bret McGuire
reference: apache#2050

* CASSJAVA-3: Fix ordering of LIMIT and PER PARTITION LIMIT clauses

patch by David Stringer; reviewed by Lukasz Antoniak and Bret McGuire
reference: apache#2022

* CASSJAVA-30: Update CONTRIBUTING.md
patch by Jane He; reviewed by Bret McGuire and Andy Tolbert

* CASSJAVA-104: Fix Flaky tests
patch by Jane He; review by
Bret McGuire and Andy Tolbert

* CASSJAVA-109, CASSJAVA-117: Manual and API References after donation, Build CI for Java Driver Doc
Patch by Jane He and
Łukasz Antoniak; Reviewed by Bret McGuire

* [maven-release-plugin] prepare release 4.19.3

* [maven-release-plugin] prepare for next development iteration

* Revert "[maven-release-plugin] prepare for next development iteration"

This reverts commit 342088c.

* Revert "[maven-release-plugin] prepare release 4.19.3"

This reverts commit 375e4b5.

* Revert apache#2051 and replace it with something closer to the intent of the original PR (apache#1901).

The change that was actually merged attempted to bump us up to the most recent Java8-compatible
logback impl.  This moved us from 1.2.x to 1.3.x which in turn brought some dependency changes
that were excessive, especially for a patch release.

patch by Bret McGuire; reviewed by Andy Tolbert and Abe Ratnofsky
reference: apache#2088

* Add changelog for 4.19.3

* [maven-release-plugin] prepare release 4.19.3

* Revert "[maven-release-plugin] prepare release 4.19.3"

This reverts commit 8e2e70c.

* [maven-release-plugin] prepare release 4.19.3

* [maven-release-plugin] prepare for next development iteration

* Add security-model discoverability (AGENTS.md -> SECURITY.md -> security model)

Wires the conventional AGENTS.md -> SECURITY.md -> security model chain so automated tooling can mechanically discover the project's security model. No model content is changed.

Generated-by: Claude Opus 4.8 (1M context)

patch by Jarek Potiuk; reviewed by Bret McGuire
reference: apache#2092

* ninja-fix Fix equality operation for Geometry subclasses

* CASSJAVA-131: Add Retention Requirement to Jenkinsfile-asf
patch by Jane He; reviewed by Michael Semb Wever

* CASSJAVA-136 Ninja fix to correct geometry equality actually broke geometry equality

patch by Bret McGuire; reviewed by Jane He

* CASSJAVA-137 Bump Netty to 4.1.138

patch by Bret McGuire; reviewed by Andy Tolbert

* ninja-fix Changelog entries for 4.19.4

* ninja-fix Update scm entry in root pom.xml to match what was done for 3.x

* ninja-fix XML formatting fix for pom.xml

* [maven-release-plugin] prepare release 4.19.4

---------

Co-authored-by: absurdfarce <[email protected]>
Co-authored-by: April I. Murphy <[email protected]>
Co-authored-by: Lukasz Antoniak <[email protected]>
Co-authored-by: Abe Ratnofsky <[email protected]>
Co-authored-by: absurdfarce <[email protected]>
Co-authored-by: Mikhail Laptev <[email protected]>
Co-authored-by: jasonk000 <[email protected]>
Co-authored-by: David Stringer <[email protected]>
Co-authored-by: janehe <[email protected]>
Co-authored-by: janehe <[email protected]>
Co-authored-by: Abe Ratnofsky <[email protected]>
Co-authored-by: Abe Ratnofsky <[email protected]>
Co-authored-by: Jarek Potiuk <[email protected]>
Co-authored-by: Jane He <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
nikagra added a commit to scylladb/java-driver that referenced this pull request Oct 30, 2026
* [maven-release-plugin] prepare for next development iteration

* Removing interface to Travis CI

Patch by Bret McGuire; reviewed by Andy Tolbert and Bret McGuire
reference: apache#2066

* Replace outdated link in README

patch by April Murphy; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2064

* ninja-fix: Remove ASF donation message

* Update LZ4 and Netty dependencies for CVE response

The primary goal here is to address CVE-2025-12183. Netty includes a
dependency on vulnerable versions of lz4-java, so update to a fixed
version of Netty as well. On the C* server side, we opted to move to the
new community fork of lz4-java, so match that decision here
(CASSANDRA-21052).

patch by Abe Ratnofsky; reviewed by Francisco Guerrero for CASSJAVA-113

* Bump logback to most recent Java8-compatible version

patch by Bret McGuire; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2051

* ninja-fix - adding an extra space to render the page correctly with mkdocs

I've been looking into details on custom codes and noticed that the there is an issue with rendering bullet points on the following page: https://apache.github.io/cassandra-java-driver/4.19.0/core/custom_codecs/

* ninja-fix Updating a few indented lists that were observed to not render correctly while working on the previous ninja-fix

* Re-work ordering clause support in query builder behind a single OrderingClause abstraction.  This allows for
custom impls to define their own logic for managing "ORDER BY" clauses.

patch by Bret McGuire; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2047

* ninja-fix We apparently had some unformatted files slip in in the last commit

* CASSJAVA-122 Fix OSGi LZ4 test

patch by Lukasz Antoniak; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2075

* Bump Jackson to 2.20.1

patch by Bret McGuire: reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2076

* CASSJAVA-108 Update ESRI (and remove org.json) dependencies

patch by Bret McGuire; reviewed by Bret McGuire and Lukasz Antoniak
reference: apache#2052

* ninja-fix Update Jenkins label to Jammy

* Revert "ninja-fix Update Jenkins label to Jammy"

This reverts commit de96ce8.

* Fix race condition in ClockSeqAndNodeContainer

patch by Jason Koch; reviewed by Lukasz Antoniak and Bret McGuire
reference: apache#2050

* CASSJAVA-3: Fix ordering of LIMIT and PER PARTITION LIMIT clauses

patch by David Stringer; reviewed by Lukasz Antoniak and Bret McGuire
reference: apache#2022

* CASSJAVA-30: Update CONTRIBUTING.md
patch by Jane He; reviewed by Bret McGuire and Andy Tolbert

* CASSJAVA-104: Fix Flaky tests
patch by Jane He; review by
Bret McGuire and Andy Tolbert

* CASSJAVA-109, CASSJAVA-117: Manual and API References after donation, Build CI for Java Driver Doc
Patch by Jane He and
Łukasz Antoniak; Reviewed by Bret McGuire

* [maven-release-plugin] prepare release 4.19.3

* [maven-release-plugin] prepare for next development iteration

* Revert "[maven-release-plugin] prepare for next development iteration"

This reverts commit 342088c.

* Revert "[maven-release-plugin] prepare release 4.19.3"

This reverts commit 375e4b5.

* Revert apache#2051 and replace it with something closer to the intent of the original PR (apache#1901).

The change that was actually merged attempted to bump us up to the most recent Java8-compatible
logback impl.  This moved us from 1.2.x to 1.3.x which in turn brought some dependency changes
that were excessive, especially for a patch release.

patch by Bret McGuire; reviewed by Andy Tolbert and Abe Ratnofsky
reference: apache#2088

* Add changelog for 4.19.3

* [maven-release-plugin] prepare release 4.19.3

* Revert "[maven-release-plugin] prepare release 4.19.3"

This reverts commit 8e2e70c.

* [maven-release-plugin] prepare release 4.19.3

* [maven-release-plugin] prepare for next development iteration

* Add security-model discoverability (AGENTS.md -> SECURITY.md -> security model)

Wires the conventional AGENTS.md -> SECURITY.md -> security model chain so automated tooling can mechanically discover the project's security model. No model content is changed.

Generated-by: Claude Opus 4.8 (1M context)

patch by Jarek Potiuk; reviewed by Bret McGuire
reference: apache#2092

* ninja-fix Fix equality operation for Geometry subclasses

* CASSJAVA-131: Add Retention Requirement to Jenkinsfile-asf
patch by Jane He; reviewed by Michael Semb Wever

* CASSJAVA-136 Ninja fix to correct geometry equality actually broke geometry equality

patch by Bret McGuire; reviewed by Jane He

* CASSJAVA-137 Bump Netty to 4.1.138

patch by Bret McGuire; reviewed by Andy Tolbert

* ninja-fix Changelog entries for 4.19.4

* ninja-fix Update scm entry in root pom.xml to match what was done for 3.x

* ninja-fix XML formatting fix for pom.xml

* [maven-release-plugin] prepare release 4.19.4

---------

Co-authored-by: absurdfarce <[email protected]>
Co-authored-by: April I. Murphy <[email protected]>
Co-authored-by: Lukasz Antoniak <[email protected]>
Co-authored-by: Abe Ratnofsky <[email protected]>
Co-authored-by: absurdfarce <[email protected]>
Co-authored-by: Mikhail Laptev <[email protected]>
Co-authored-by: jasonk000 <[email protected]>
Co-authored-by: David Stringer <[email protected]>
Co-authored-by: janehe <[email protected]>
Co-authored-by: janehe <[email protected]>
Co-authored-by: Abe Ratnofsky <[email protected]>
Co-authored-by: Abe Ratnofsky <[email protected]>
Co-authored-by: Jarek Potiuk <[email protected]>
Co-authored-by: Jane He <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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