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

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

GitHub user okram opened a pull request:

    https://github.com/apache/incubator-tinkerpop/pull/277

    TINKERPOP-1236: SelectDenormalizationStrategy for select().by(starGraph) in 
OLAP.

    https://issues.apache.org/jira/browse/TINKERPOP-1236
    
    This is massive. We have been plagued by 
`select("a","b").by("name").by("age")`-style traversals not working in OLAP 
because they are `PathProcessor` traversals are grab `ReferenceElements` out of 
the LABELED_PATH. However, you can compile these to work:
    
    ``
    select("a").by("name") -> select("a").map(values("name"))
    select("a","b").by("name").by("age") -> 
select("a").map(values("name")).as("a").select("b").map(values("name")).as("b").select(last,"a","b")
    ```
    
    When we are able to drop path labels, we will be able to open up 
`where(as("a").outE().count().is(gt(10))`-style traversals to OLAP as well. 
Note that this type of `WhereTraversalStep` typically is used in conjunction 
with `MatchStep` and `MatchPredicateStrategy` handles it appropriately so we 
are not missing out too much.
    
    CHANGELOG
    
    ```
    * `select("a","b").by("name").by("age")`-style traversals now work in OLAP 
with new  `PathProcessorStrategy`.
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-tinkerpop TINKERPOP-1236

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-tinkerpop/pull/277.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 #277
    
----
commit 7a52aa4ebd072cdacdf07005eb587815e39835e7
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-03-25T15:01:19Z

    Created SelectLinearizationStrategy which for OLAP. Right now, it just does 
the easy part of making select('a').by('name') into 
select('a').map(values('name')). This doesn't cover the full range of what we 
want, but a start.

commit bb06ee5a6f2347fd0495485bbbaaedf5e049a438
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-03-25T16:53:21Z

    Merge branch 'master' into TINKERPOP-1236

commit 9ff33dda97a4fa1927f1689b19a04d7e2e2b2f9b
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-03-25T19:24:44Z

    Renamed SelectLinearizationStrategy to PathProcessorStrategy as it handles 
SelectStep, SelectOneStep, and WhereTraversalStep. Opened up a bunch more tests 
throughout in WhereTest, SelectTest, and MatchTest.

commit 69d8ce69c148481c88f733fe90b6076c6f3d0341
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-03-25T19:50:47Z

    added PathProcessStratergyTest to ensure that the compilation is as 
expected. Found a bug around TraversalFilterStep conversion required when a 
WhereTraversal is stripped of its start/end labels. Fixed. This is ready to go.

----


> SelectDenormalizationStrategy for select().by(starGraph) in OLAP.
> -----------------------------------------------------------------
>
>                 Key: TINKERPOP-1236
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1236
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.1.1-incubating
>            Reporter: Marko A. Rodriguez
>
> Right now, if you do anything beyond {{select().by(id)}} in OLAP, you get a 
> {{PathProcessor can't go beyond ElementRequirements.ID}}-style exception. 
> This is TOTALLY unacceptable (like totally... I know right.) because 
> {{select()}} is so heavily used that it makes the OLAP experience not so 
> bueno.
> Enter -- {{SelectDenomalizationStrategy}} which will only be used in OLAP 
> compilations.
> {code}
> select("a").by("name") // not allowed in OLAP right now. (1)
> select("a").map(values("name")) // allowed in OLAP. (2)
> {code}
> Thus, compile (1) into (2). However, in a {{while(true)}}-loop until 
> {{boolean fullyDenormalized}} you also check on this pattern:
> {code}
> select("a","b").by(outE().count()).by("name") // not allowed in OLAP right 
> now (1)
> select("a").by(outE().count()).as("a").select("b").by("name").as("b").select("a","b",Pop.last)
>  // not allowed in OLAP right now, but this denormalizes again given the 
> first SelectOne pattern
> {code}
> The only problem with this is that future {{select()}} will {{Pop}} a list. 
> We need to really make it so we can drop path labels. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to