You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by be...@apache.org on 2022/07/08 20:09:11 UTC

[tinkerpop] branch master updated: Cherry picked commit id 50bf8b272adebf2501310e099ed16cec9622cc73 to 3.5-dev. Add a getter for selectKeys in SelectStep to retrieve keys with the same order as given in a query

This is an automated email from the ASF dual-hosted git repository.

bechbd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


The following commit(s) were added to refs/heads/master by this push:
     new 9a8efc45eb Cherry picked commit id 50bf8b272adebf2501310e099ed16cec9622cc73 to 3.5-dev.  Add a getter for selectKeys in SelectStep to retrieve keys with the same order as given in a query
     new e0749770c6 Merge branch '3.5-dev'
9a8efc45eb is described below

commit 9a8efc45eb3d3e1f7d5b228d2be7752acaed08f0
Author: Norio Akagi (norakagi) <no...@amazon.com>
AuthorDate: Tue Jun 21 10:00:39 2022 -0700

    Cherry picked commit id 50bf8b272adebf2501310e099ed16cec9622cc73 to 3.5-dev.  Add a getter for selectKeys in SelectStep to retrieve keys with the same order as given in a query
---
 CHANGELOG.asciidoc                                            |  1 +
 .../gremlin/process/traversal/step/map/SelectStep.java        | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 0468ef6bf6..d2bbd6d6b4 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -44,6 +44,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 * Fixed potential `NullPointerException` in `gremlin-driver` where initialization of a `ConnectionPool` would fail but not throw an exception due to centralized error check being satisfied by a different process.
 * Fixed a bug where the JavaScript client would hang indefinitely on traversals if the connection to the server was terminated.
 * Fix a javadoc comment in Cluster.Builder regarding maxInProcessPerConnection.
+* Added a getter for selectKeys in SelectStep
 
 [[release-3-5-3]]
 === TinkerPop 3.5.3 (Release Date: April 4, 2022)
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectStep.java
index 9edde9d346..8c7702ff4c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectStep.java
@@ -139,6 +139,17 @@ public final class SelectStep<S, E> extends MapStep<S, Map<String, E>> implement
         return this.selectKeysSet;
     }
 
+    /**
+     * Get the keys for this SelectStep. Unlike {@link SelectStep#getScopeKeys()}, this returns a list possibly with
+     * a duplicate key. This guarantees to return the keys in the same order as passed in.
+     * TODO: getScopeKeys should return order-aware data structure instead of HashSet so that graph providers can
+     *       get the keys in the order passed in a query, and can associate them with by-traversals in a correct sequence.
+     *
+     */
+    public List<String> getSelectKeys() {
+        return this.selectKeys;
+    }
+
     public Map<String, Traversal.Admin<Object, E>> getByTraversals() {
         final Map<String, Traversal.Admin<Object, E>> map = new HashMap<>();
         this.traversalRing.reset();