[
https://issues.apache.org/jira/browse/TINKERPOP-1888?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16423237#comment-16423237
]
ASF GitHub Bot commented on TINKERPOP-1888:
-------------------------------------------
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 <daniel_kuppitz@...>
Date: 2018-04-02T21:55:27Z
TINKERPOP-1888: Extended `min()` and `max()` to support all comparable data
types.
----
> Extend max and min to all Comparable properties, not just Numbers
> -----------------------------------------------------------------
>
> Key: TINKERPOP-1888
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1888
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.2.7
> Reporter: Philip Graff
> Assignee: Daniel Kuppitz
> Priority: Major
> Labels: breaking
>
> Currently, min() and max() only operate on properties that extend Number.
> However, these should be able to be applied to anything which implements
> Comparable as they are well-defined for those, too. Other steps like mean()
> and sum() should stay just for Numbers.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)