You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by dkuppitz <gi...@git.apache.org> on 2018/04/02 22:46:14 UTC
[GitHub] tinkerpop pull request #829: TINKERPOP-1888 Extend max and min to all Compar...
GitHub user dkuppitz opened a pull request:
https://github.com/apache/tinkerpop/pull/829
TINKERPOP-1888 Extend max and min to all Comparable properties, not just Numbers
https://issues.apache.org/jira/browse/TINKERPOP-1888
Extended `min()` and `max()` to support all comparable data types.
From the docs:
```
gremlin> g.V().values('name').min()
==>josh
gremlin> g.V().values('name').max()
==>vadas
```
And another example:
```
gremlin> x = [new Date()]; sleep 1000; x << new Date()
==>Mon Apr 02 15:43:01 MST 2018
==>Mon Apr 02 15:43:02 MST 2018
gremlin> __(x).min(local)
==>Mon Apr 02 15:43:01 MST 2018
gremlin> __(x).max(local)
==>Mon Apr 02 15:43:02 MST 2018
gremlin> __(x).unfold().min()
==>Mon Apr 02 15:43:01 MST 2018
gremlin> __(x).unfold().max()
==>Mon Apr 02 15:43:02 MST 2018
```
`docker/build.sh -t -i` passed and the result of `docker/build.sh -d` looked good.
VOTE: +1
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/tinkerpop TINKERPOP-1888
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tinkerpop/pull/829.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #829
----
commit 5265e3a5c756b3649c91b15d74a5213858d2929f
Author: Daniel Kuppitz <da...@...>
Date: 2018-04-02T21:55:27Z
TINKERPOP-1888: Extended `min()` and `max()` to support all comparable data types.
----
---
[GitHub] tinkerpop pull request #829: TINKERPOP-1888 Extend max and min to all Compar...
Posted by dkuppitz <gi...@git.apache.org>.
Github user dkuppitz commented on a diff in the pull request:
https://github.com/apache/tinkerpop/pull/829#discussion_r179155101
--- Diff: CHANGELOG.asciidoc ---
@@ -25,6 +25,7 @@ NEED AND IMAGE
This release also includes changes from <<release-3-3-2, 3.3.2>>.
+* `min()` and `max()` now support all types implementing `Comparable`.
--- End diff --
It is, and I have no idea why you get that wrong in all my PRs :)
---
[GitHub] tinkerpop issue #829: TINKERPOP-1888 Extend max and min to all Comparable pr...
Posted by robertdale <gi...@git.apache.org>.
Github user robertdale commented on the issue:
https://github.com/apache/tinkerpop/pull/829
VOTE +1
---
[GitHub] tinkerpop issue #829: TINKERPOP-1888 Extend max and min to all Comparable pr...
Posted by dkuppitz <gi...@git.apache.org>.
Github user dkuppitz commented on the issue:
https://github.com/apache/tinkerpop/pull/829
I added some notes in the upgrade docs, rebases the branch and force-pushed it.
---
[GitHub] tinkerpop pull request #829: TINKERPOP-1888 Extend max and min to all Compar...
Posted by robertdale <gi...@git.apache.org>.
Github user robertdale commented on a diff in the pull request:
https://github.com/apache/tinkerpop/pull/829#discussion_r179166002
--- Diff: docs/src/reference/the-traversal.asciidoc ---
@@ -1471,16 +1471,17 @@ link:++http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/grem
[[max-step]]
=== Max Step
-The `max()`-step (*map*) operates on a stream of numbers and determines which is the largest number in the stream.
+The `max()`-step (*map*) operates on a stream of comparable objects and determines which is the largest object in the stream.
--- End diff --
~~largest object~~ last object according to its natural sort order
---
[GitHub] tinkerpop pull request #829: TINKERPOP-1888 Extend max and min to all Compar...
Posted by spmallette <gi...@git.apache.org>.
Github user spmallette commented on a diff in the pull request:
https://github.com/apache/tinkerpop/pull/829#discussion_r179156638
--- Diff: CHANGELOG.asciidoc ---
@@ -25,6 +25,7 @@ NEED AND IMAGE
This release also includes changes from <<release-3-3-2, 3.3.2>>.
+* `min()` and `max()` now support all types implementing `Comparable`.
--- End diff --
damn it - it's because i just read this in the diff `<<release-3-3-2, 3.3.2>>` - sorry
---
[GitHub] tinkerpop pull request #829: TINKERPOP-1888 Extend max and min to all Compar...
Posted by robertdale <gi...@git.apache.org>.
Github user robertdale commented on a diff in the pull request:
https://github.com/apache/tinkerpop/pull/829#discussion_r179166260
--- Diff: docs/src/reference/the-traversal.asciidoc ---
@@ -1515,16 +1516,17 @@ link:++http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/grem
[[min-step]]
=== Min Step
-The `min()`-step (*map*) operates on a stream of numbers and determines which is the smallest number in the stream.
+The `min()`-step (*map*) operates on a stream of comparable objects and determines which is the smallest object in the stream.
--- End diff --
~~smallest object~~ first object according to its natural sort order
---
[GitHub] tinkerpop issue #829: TINKERPOP-1888 Extend max and min to all Comparable pr...
Posted by dkuppitz <gi...@git.apache.org>.
Github user dkuppitz commented on the issue:
https://github.com/apache/tinkerpop/pull/829
I thought about the upgrade docs, but felt like it's not necessary as existing working scenarios didn't change, we just allow more now. But, well, I can add something.
---
[GitHub] tinkerpop issue #829: TINKERPOP-1888 Extend max and min to all Comparable pr...
Posted by spmallette <gi...@git.apache.org>.
Github user spmallette commented on the issue:
https://github.com/apache/tinkerpop/pull/829
VOTE +1
---
[GitHub] tinkerpop issue #829: TINKERPOP-1888 Extend max and min to all Comparable pr...
Posted by PBGraff <gi...@git.apache.org>.
Github user PBGraff commented on the issue:
https://github.com/apache/tinkerpop/pull/829
Thank you!
---
[GitHub] tinkerpop issue #829: TINKERPOP-1888 Extend max and min to all Comparable pr...
Posted by spmallette <gi...@git.apache.org>.
Github user spmallette commented on the issue:
https://github.com/apache/tinkerpop/pull/829
Perhaps this needs upgrade docs for 3.4.0 as well? I think it would be good to call attention to this change in behavior.
---
[GitHub] tinkerpop pull request #829: TINKERPOP-1888 Extend max and min to all Compar...
Posted by spmallette <gi...@git.apache.org>.
Github user spmallette commented on a diff in the pull request:
https://github.com/apache/tinkerpop/pull/829#discussion_r179146832
--- Diff: CHANGELOG.asciidoc ---
@@ -25,6 +25,7 @@ NEED AND IMAGE
This release also includes changes from <<release-3-3-2, 3.3.2>>.
+* `min()` and `max()` now support all types implementing `Comparable`.
--- End diff --
this should be on 3.4.0 right?
---
[GitHub] tinkerpop issue #829: TINKERPOP-1888 Extend max and min to all Comparable pr...
Posted by spmallette <gi...@git.apache.org>.
Github user spmallette commented on the issue:
https://github.com/apache/tinkerpop/pull/829
yeah - i tend to think of upgrade docs as extending to more than just breaking changes. it should also include any new features that people might like to know about and that we want to call attention to
---
[GitHub] tinkerpop pull request #829: TINKERPOP-1888 Extend max and min to all Compar...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/tinkerpop/pull/829
---