Hi, I have a graph that looks kind of like this
var_0 = [] as Set
g.V().has("__typeName", "Table").fill(_var_0)
g.V().has("__superTypeNames", "Table").fill(_var_0)var_0._().as("src").in("__LoadProcess.inputTables").out("__LoadProcess.outputTable").loop("src"){true}{(it.object.' __typeName' == 'Table') | (it.object.'__superTypeNames' ? it.object.'__superTypeNames'.contains('Table') : false)}.as( "dest").select(["src","dest"]){[it."Table.name"]}{[it."Table.name"]}.toList()
==>[src:[sales_fact_daily_mv], dest:[sales_fact_monthly_mv]]
==>[src:[sales_fact], dest:[sales_fact_daily_mv]]
==>[src:[sales_fact], dest:[sales_fact_monthly_mv]]
==>[src:[time_dim], dest:[sales_fact_daily_mv]]
==>[src:[time_dim], dest:[sales_fact_monthly_mv]]
_var_0 = [] as Set;
g.V().has("__typeName", "Table").fill(_var_0);
g.V().has("__superTypeNames", "Table").fill(_var_0);
g.V(_var_0 as Object[]).as("src").repeat(__.in("__LoadProcess.inputTables").out("__LoadProcess.outputTable")).emit(has('__typeName',eq('Table')).or().has('__superTypeNames',eq('Table'))).as("dest").select("src","dest").by{[it."Table.name"]}.by{[it."Table.name"]}.toList()
The result I am getting is:
==>[src:[sales_fact_daily_mv], dest:[sales_fact_monthly_mv]]
==>[src:[sales_fact], dest:[sales_fact_daily_mv]]
==>[src:[sales_fact], dest:[[sales_fact_daily_mv, sales_fact_monthly_mv]]]
==>[src:[time_dim], dest:[sales_fact_daily_mv]]
==>[src:[time_dim], dest:[[sales_fact_daily_mv, sales_fact_monthly_mv]]]
I am trying to figure out what is needed to get the query result to look like the one from the original query. From what I can tell, the difference has something to do with the as or select clause. I've tried a couple experiments with simplified versions of the queries. Without the select, the "dest" part of the output seems to look right:
gremlin> g.V(_var_0 as Object[]).as("src").repeat(__.in('__LoadProcess.inputTables').out('__LoadProcess.outputTable')).emit().as("dest")
g.V(_var_0 as Object[]).as("src").repeat(__.in('__LoadProcess.inputTables').out('__LoadProcess.outputTable')).emit().as("dest")
==>v[16432]
==>v[12336]
==>v[16432]
==>v[12336]
==>v[16432]
However, when I add a select, some of the "dest" output values turn into an array:
gremlin> g.V(_var_0 as Object[]).as("src").repeat(__.in('__LoadProcess.inputTables').out('__LoadProcess.outputTable')).emit().as("dest").select("dest")
g.V(_var_0 as Object[]).as("src").repeat(__.in('__LoadProcess.inputTables').out('__LoadProcess.outputTable')).emit().as("dest").select("dest")
==>v[16432]
==>v[12336]
==>[v[12336], v[16432]]
==>v[12336]
==>[v[12336], v[16432]]
Can anyone explain this behavior or suggest what can be done to get rid of the extra values in "dest" so that the result matches what we got in Germlin 1?
Thanks a lot for any help you can provide.
-Jeff
--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/b811e185-905b-482a-8db6-b87b062d4fe6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
g.V(_var_0 as Object[]).as("src").repeat(__.in("__LoadProcess.inputTables").out("__LoadProcess.outputTable")).emit().as("dummy").select(last,"dummy").as("dest").select("src","dest").path()
Is this the expected behavior?
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/65920de6-694d-4ed6-b040-ea1a38f77733%40googlegroups.com.
g.V(_var_0 as Object[]).as("src").repeat(__.in("__LoadProcess.inputTables").out("__LoadProcess.outputTable")).emit().as("dummy").select(last,"dummy").as("dest").select("src","dest").path()
Is something like this what you had in mind?
g.V(_var_0 as Object[]).as("src").repeat(__.in("__LoadProcess.inputTables").out("__LoadProcess.outputTable")).emit().as("dest").select("src","dest")
g.V(_var_0 as Object[]).repeat(__.in("__LoadProcess.inputTables").out("__LoadProcess.outputTable")).emit().path()
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/670c020f-6cfa-401c-a681-44789cb0ab7b%40googlegroups.com.
g.V(_var_0 as
Object[]).as("src").repeat(__.in("__LoadProcess.inputTables").out("__LoadProcess.outputTable")).emit().sideEffect(__({((it
as Object[]) as List).last()}).as("dest")).select("src","dest")
g.V(_var_0 as Object[]).as("src").repeat(__.in("__LoadProcess.inputTables").out("__LoadProcess.outputTable")).emit().sideEffect{System.out.println(it)}
g.V(_var_0 as Object[]).as("src").repeat(__.in("__LoadProcess.inputTables").out("__LoadProcess.outputTable")).emit().as("dest").select("src","dest").by().by{((it as Object[]) as List).last()}.path()
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/85a396e8-91ae-480b-9fef-df7033ae8999%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Gremlin-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gremlin-users/P83GWgtRG_8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/CA%2Bf9seV36KVLRbT138RvcandLrxJ%3DraR1%2B%3D_AF1eA3A_DvJzmQ%40mail.gmail.com.