Let’s say I have a Tweets dataset, and I have a SyntheticTweeterAdapter to feed 
the data. It will generate the record like r1: { “id”: 1, “tweet” : “blabla”, 
“coordinate”: point(1,2) } 
During the feeding, I want to have an UDF that can enrich the dataset by 
appending another field to the record. 
E.g. I can add the address information of the previous r1 :  { “id”: 1, “tweet” 
: “blabla”, “coordinate”: point(1,2), “address”: [“Irvine, CA”] } . 

In order to get the mapping from “coordinate” to “address”, I need to run a AQL 
query like 

for $t in feed Tweets
return { “id”: $t.id, “tweet”: $t.tweet, “coordinate”: $t.coordinate,
“address”: for $city in dataset (“AsterixCityTable”) where  spatio-intersect 
($t.coordinate, $city.geometry) return $city.name
}

It seems more like the second one: using an AQL function as a UDF connector. 
But I’m not very certain about it. It will be very helpful if you can provide 
some existing UDF example, not necessary the AQL ones.  Thank you!


> On Oct 29, 2015, at 3:53 PM, Heri Ramampiaro <[email protected]> wrote:
> 
>> 
>> 2. Can we use AQL function in those kind of feed UDFs?
> 
> Can you give an example of what you are trying to do?
> I.e do you want to run an AQL inside a UDF or use an AQL function as a
> UDF connected to a running feed?
> 
> -heri



Best,

Jianfeng Jia
PhD Candidate of Computer Science
University of California, Irvine

Reply via email to