tinkerpop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <j...@apache.org>
Subject [jira] [Commented] (TINKERPOP-2351) Local Map ordering of keys can generate cast errors
Date Thu, 19 Mar 2020 20:40:00 GMT

    [ https://issues.apache.org/jira/browse/TINKERPOP-2351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17062926#comment-17062926
] 

ASF GitHub Bot commented on TINKERPOP-2351:
-------------------------------------------

spmallette commented on pull request #1266: TINKERPOP-2351 Fixed bug in Order when enum is
a key in Map
URL: https://github.com/apache/tinkerpop/pull/1266
 
 
   https://issues.apache.org/jira/browse/TINKERPOP-2351
   
   This seemed like an easy fix. Can't think of any bad side-effects. Not sure if there are
other special cases we should consider, but at least this common case is solved.
   
   ```text
   gremlin> g.V().valueMap(true).order(local).by(keys,desc)
   ==>[name:[marko],label:person,id:1,age:[29]]
   ==>[name:[vadas],label:person,id:2,age:[27]]
   ==>[name:[lop],lang:[java],label:software,id:3]
   ==>[name:[josh],label:person,id:4,age:[32]]
   ==>[name:[ripple],lang:[java],label:software,id:5]
   ==>[name:[peter],label:person,id:6,age:[35]]
   gremlin> g.V(1).valueMap(true).order(local).by(keys,desc).next()[T.id]
   ==>1
   gremlin> g.V(1).valueMap(true).order(local).by(keys,desc).next()[T.label]
   ==>person
   ```
   
   When this merges forward to `3.4-dev` I will modify the test to use `elementMap()` rather
than `valueMap(true)` since that method is deprecated.
   
   All tests pass with `docker/build.sh -t -i`
   
   VOTE +1
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Local Map ordering of keys can generate cast errors
> ---------------------------------------------------
>
>                 Key: TINKERPOP-2351
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2351
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.3.10
>            Reporter: Stephen Mallette
>            Assignee: Stephen Mallette
>            Priority: Minor
>
> The issue is that if the {{Map}} contains enums like {{T}} it doesn't play well with
non-enum keys that are typically integrated in there when using something like {{elementMap()}}
or {{valueMap()}}:
> {code}
> gremlin> g.V().valueMap(true).order(local).by(keys,desc)
> java.lang.String cannot be cast to java.lang.Enum
> Type ':help' or ':h' for help.
> Display stack trace? [yN]n
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message