[jira] [Commented] (TINKERPOP-3045) EarlyLimitStrategy is too aggresive to promote Limit and thus causing incorrect results

2024-02-05 Thread ASF GitHub Bot (Jira)


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

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

spmallette commented on PR #2481:
URL: https://github.com/apache/tinkerpop/pull/2481#issuecomment-1928575168

   closing for #2475 which was updated to match what is here.




> EarlyLimitStrategy is too aggresive to promote Limit and thus causing 
> incorrect results
> ---
>
> Key: TINKERPOP-3045
> URL: https://issues.apache.org/jira/browse/TINKERPOP-3045
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.6.6
>Reporter: Prashant
>Assignee: Stephen Mallette
>Priority: Major
>  Labels: easyfix
> Fix For: 3.6.7
>
>
> {code:java}
> gremlin>   g.V().map(__.in().hasId('1')).limit(2).values('name')
> ==>marko{code}
> {code:java}
> gremlin>   
> g.withoutStrategies(EarlyLimitStrategy).V().map(__.in().hasId('1')).limit(2).values('name')
> ==>marko
> ==>marko {code}
> Early Limit strategy pulls Limit in front of map steps. However not all map 
> steps allow the cardinality of the results flowing to be same. 
>  
> As is shown in example above.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (TINKERPOP-3045) EarlyLimitStrategy is too aggresive to promote Limit and thus causing incorrect results

2024-02-05 Thread ASF GitHub Bot (Jira)


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

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

spmallette closed pull request #2481: TINKERPOP-3045: EarlyLimitStrategy is too 
aggresive to promote Limit …
URL: https://github.com/apache/tinkerpop/pull/2481




> EarlyLimitStrategy is too aggresive to promote Limit and thus causing 
> incorrect results
> ---
>
> Key: TINKERPOP-3045
> URL: https://issues.apache.org/jira/browse/TINKERPOP-3045
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.6.6
>Reporter: Prashant
>Assignee: Stephen Mallette
>Priority: Major
>  Labels: easyfix
> Fix For: 3.6.7
>
>
> {code:java}
> gremlin>   g.V().map(__.in().hasId('1')).limit(2).values('name')
> ==>marko{code}
> {code:java}
> gremlin>   
> g.withoutStrategies(EarlyLimitStrategy).V().map(__.in().hasId('1')).limit(2).values('name')
> ==>marko
> ==>marko {code}
> Early Limit strategy pulls Limit in front of map steps. However not all map 
> steps allow the cardinality of the results flowing to be same. 
>  
> As is shown in example above.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (TINKERPOP-3045) EarlyLimitStrategy is too aggresive to promote Limit and thus causing incorrect results

2024-02-05 Thread ASF GitHub Bot (Jira)


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

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

upadhyay-prashant opened a new pull request, #2481:
URL: https://github.com/apache/tinkerpop/pull/2481

   …and thus causing incorrect results
   
   https://issues.apache.org/jira/browse/TINKERPOP-3045
   
   EarlyLimitStrategy was too aggressive to promote limit before map steps. Not 
all the Map step can be displaced. Specifically if a Map step has capability to 
filter the results, then it should be displaced.
   
   This code change brings in a utility to statically determine the output 
arity of a step and accordingly allow EarlyLimitStrategy to make a decision 
whether a map step can be moved.
   
   Test is added in Range.feature which ensures that this bug is fixed. This 
test gives wrong result without this code change.




> EarlyLimitStrategy is too aggresive to promote Limit and thus causing 
> incorrect results
> ---
>
> Key: TINKERPOP-3045
> URL: https://issues.apache.org/jira/browse/TINKERPOP-3045
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.6.6
>Reporter: Prashant
>Assignee: Stephen Mallette
>Priority: Major
>  Labels: easyfix
> Fix For: 3.6.7
>
>
> {code:java}
> gremlin>   g.V().map(__.in().hasId('1')).limit(2).values('name')
> ==>marko{code}
> {code:java}
> gremlin>   
> g.withoutStrategies(EarlyLimitStrategy).V().map(__.in().hasId('1')).limit(2).values('name')
> ==>marko
> ==>marko {code}
> Early Limit strategy pulls Limit in front of map steps. However not all map 
> steps allow the cardinality of the results flowing to be same. 
>  
> As is shown in example above.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (TINKERPOP-3045) EarlyLimitStrategy is too aggresive to promote Limit and thus causing incorrect results

2024-02-05 Thread ASF GitHub Bot (Jira)


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

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

upadhyay-prashant commented on code in PR #2475:
URL: https://github.com/apache/tinkerpop/pull/2475#discussion_r1479052070


##
gremlin-core/pom.xml:
##
@@ -101,6 +101,16 @@ limitations under the License.
 hamcrest
 test
 
+

Review Comment:
   done 



##
gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Range.feature:
##
@@ -280,4 +280,16 @@ Feature: Step - range()
 When iterated to list
 Then the result should be unordered
   | result |
-  | d[29].i |
\ No newline at end of file
+  | d[29].i |
+
+  Scenario: g_V_mapXinX_limitX2X_valuesXnameX
+Given the modern graph
+And the traversal of
+  """
+  g.V().map(__.in()).limit(2).values('name')

Review Comment:
   done





> EarlyLimitStrategy is too aggresive to promote Limit and thus causing 
> incorrect results
> ---
>
> Key: TINKERPOP-3045
> URL: https://issues.apache.org/jira/browse/TINKERPOP-3045
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.6.6
>Reporter: Prashant
>Assignee: Stephen Mallette
>Priority: Major
>  Labels: easyfix
> Fix For: 3.6.7
>
>
> {code:java}
> gremlin>   g.V().map(__.in().hasId('1')).limit(2).values('name')
> ==>marko{code}
> {code:java}
> gremlin>   
> g.withoutStrategies(EarlyLimitStrategy).V().map(__.in().hasId('1')).limit(2).values('name')
> ==>marko
> ==>marko {code}
> Early Limit strategy pulls Limit in front of map steps. However not all map 
> steps allow the cardinality of the results flowing to be same. 
>  
> As is shown in example above.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)