Hi,

New bugged logged at: https://github.com/neo4j/community/issues/114

Details below for others to peruse.

Gremlin Table Projections - Column Order Incorrect when using chained 
.As('x').As('y')

EXPECTED Order: Createdy, ReferralGroup, ReferralId, ReferralData

When AS statements appear next to each other.
Consider A (WORKS - But not logical - have to reverse order when more than 1 AS 
statement is chained together right after each other for column array to match):
{"script":"g.v(0).outE[[label:'HOSTS']].inV.filter{ it.Key == 'romikoagency' 
}.inE[[label:'USER_BELONGS_TO']].outV.filter{ it.Username == 'romiko.derbynew' 
}.as('CreatedBy').outE[[label:'USER_LINKED_TO_PROGRAM']].inV.as('ReferralGroup').inE[[label:'HAS_SUGGESTED_PROGRAM']].outV.inE[[label:'REFERRAL_HAS_DECISIONS_SECTION']].outV.as('ReferralDate').as('ReferralId').table(new
 Table()){it.Username}{it.Name}{it.UniqueId}{it.DateInitiatedUtc}.cap"
}

notice: as('ReferralDate').as('ReferralId') and then notice the column order 
below is opposite this: "columns" .... "ReferralId", "ReferralDate" ]

Results
[ [ {
"data" : [ [ "romiko.derbynew", "Testa", 331, "/Date(1322007153048+1100)/" ], [ 
"romiko.derbynew", "Testa", 321, "/Date(1322003375637+1100)/" ]], 
"columns" : [ "CreatedBy", "ReferralGroup", "ReferralId", "ReferralDate" ]
} ] ]


Consider B (Does not work - this is more LOGICAL from gremlin perspective but 
is bugged, the Chained AS right after each other gets reversed in the column 
array.)
{"script":"g.v(0).outE[[label:'HOSTS']].inV.filter{ it.Key == 'romikoagency' 
}.inE[[label:'USER_BELONGS_TO']].outV.filter{ it.Username == 'romiko.derbynew' 
}.as('CreatedBy').outE[[label:'USER_LINKED_TO_PROGRAM']].inV.as('ReferralGroup').inE[[label:'HAS_SUGGESTED_PROGRAM']].outV.inE[[label:'REFERRAL_HAS_DECISIONS_SECTION']].outV.as('ReferralId').as('ReferralDate').table(new
 Table()){it.Username}{it.Name}{it.UniqueId}{it.DateInitiatedUtc}.cap"
}

Notice: .as('ReferralId').as('ReferralDate') and then the columns "columns" 
.... "ReferralDate", "ReferralId" ]

Results
[ [ {
"data" : [ [ "romiko.derbynew", "Testa", 331, "/Date(1322007153048+1100)/" ]],
"columns" : [ "CreatedBy", "ReferralGroup", "ReferralDate", "ReferralId" ]
} ] ]


_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to