Review: Needs Information > > I don't understand why. In my example it wouldn't. The count functions could > > count > > the number of empty objects or objects that contain only the STREET field. > > I've looked into the test and here are the issues: > 1) The fn:count() does not have the %explores-json annotation. I've confused > it with the JSONiq array size() function. > > 2) Currently the dataguide does not distinguish between any of the fn: > functions. So for example if you modify the query: > > for $obj in parse-json(f:read-text(fn:resolve-uri("citylots-small.json"))) > group by $s := $obj.STREET > return { > street : $s, > count : count($obj), > seq : subsequence($obj, 1, 100) > } > > then if you prune the input to have only the .STREET field you'll get an > incorrect result. So currently the argument to subsequence() is "explored" and > so the dataguide is "*" in this case. The same happens with count(). > > 3) fn:count() is a special case as it only cares for the number of objects and > not their contents. I think another annotation could be added, which would be > the opposite of %explores-json and which would indicate that the function > ignores the details of the object. Or I could just add some code in the > dataguide collection to handle fn:count() separately. The way I see this is not a problem with the fn functions. The problem is related to the fact how the objects are used. In this case, the objects are used to construct a new object. The dataguide needs to handle that. Similar to serialization, this means that the entire object is needed.
-- https://code.launchpad.net/~zorba-coders/zorba/use-dataguide/+merge/176385 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp