sql - What do OrientDB's functions do when applied to the results of another function? -
i getting strange behavior on 2.0-m2. consider following against gratefuldeadconcerts database:
query 1
select name, in('written_by') wrote v type='artist' this query returns list of artists , songs each has written; majority of rows have @ least 1 song.
query 2
now try:
select name, count(in('written_by')) num_wrote v type='artist' on system (osx yosemite; orient 2.0-m2), see 1 row:
name num_wrote --------------------------- willie_cobb 224 this seems wrong. tried better understand. perhaps count() causes in() @ written_by edges...
query 3
select name, in('written_by') v type='artist' group name produces results similar first query.
query 4
now try count()
select name, count(in('written_by')) v type='artist' group name wrong path -- try let variables...
query 5
select name, $wblist, $wbcount v let $wblist = in('written_by'), $wbcount = count($wblist) type='artist' produces seemingly meaningless results:

you can see $wblist , $wbcount columns inconsistent 1 another, , $wbcount values don't show obvious progression cumulative result.
note strange behavior not limited count(). example, first() odd things.
count(), in rdbms, computes sum of records in 1 value. purpose .size()seems right method call:
in('written_by').size()
Comments
Post a Comment