[
https://issues.apache.org/jira/browse/TINKERPOP-1777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16388341#comment-16388341
]
ASF GitHub Bot commented on TINKERPOP-1777:
-------------------------------------------
Github user spmallette commented on a diff in the pull request:
https://github.com/apache/tinkerpop/pull/805#discussion_r172627151
--- Diff: docs/src/upgrade/release-3.4.x.asciidoc ---
@@ -28,3 +28,45 @@ NEED AN IMAGE
Please see the
link:https://github.com/apache/tinkerpop/blob/3.4.0/CHANGELOG.asciidoc#release-3-4-0[changelog]
for a complete list of all the modifications that are part of this release.
=== Upgrading for Users
+
+==== Modifications to reducing barrier steps
+
+The behavior of `min()`, `max()`, `mean()` and `sum()` has been modified
to return no result if there's no input. Previously these steps yielded the
internal seed value:
+
+[source,groovy]
+----
+gremlin> g.V().values('foo').min()
+==>NaN
+gremlin> g.V().values('foo').max()
+==>NaN
+gremlin> g.V().values('foo').mean()
+==>NaN
+gremlin> g.V().values('foo').sum()
+==>0
+----
+
+These traversals will no longer emit a result. Note, that this also
affects more complex scenarios, e.g. if these steps are used in `by()`
modulators:
+
+[source,groovy]
+----
+gremlin> g.V().group().
+......1> by(label).
+......2> by(outE().values("weight").sum())
+==>[software:0,person:3.5]
+----
+
+Since software vertices have no outgoing edges and thus no weight values
to sum, `software` will no longer show up in the result. In order to get the
same result as before, one would
+have to add a `coalesce()`-step:
+
+[source,groovy]
+----
+gremlin> g.V().group().
+......1> by(label).
+......2> by(outE().values("weight").sum())
+==>[person:3.5]
+gremlin>
+gremlin> g.V().group().
+......1> by(label).
+......2> by(coalesce(outE().values("weight"), constant(0)).sum())
+==>[software:0,person:3.5]
+----
--- End diff --
please add the "See: {jira_issue}"
> Gremlin .max step returns -2147483648 for empty result sets
> -----------------------------------------------------------
>
> Key: TINKERPOP-1777
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1777
> Project: TinkerPop
> Issue Type: Bug
> Components: process
> Affects Versions: 3.2.6
> Reporter: Sebastian Estevez
> Assignee: Daniel Kuppitz
> Priority: Major
> Labels: breaking
>
> To reproduce:
> {code}gremlin> g.V().values('test').max()
> ==>-2147483648{code}
> This should probably return an exeption, "cannot take max of nothing"
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)