Return-Path: X-Original-To: apmail-asterixdb-users-archive@minotaur.apache.org Delivered-To: apmail-asterixdb-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 76BA51724E for ; Thu, 29 Oct 2015 23:18:55 +0000 (UTC) Received: (qmail 80937 invoked by uid 500); 29 Oct 2015 23:18:55 -0000 Delivered-To: apmail-asterixdb-users-archive@asterixdb.apache.org Received: (qmail 80905 invoked by uid 500); 29 Oct 2015 23:18:55 -0000 Mailing-List: contact users-help@asterixdb.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@asterixdb.incubator.apache.org Delivered-To: mailing list users@asterixdb.incubator.apache.org Received: (qmail 80853 invoked by uid 99); 29 Oct 2015 23:18:55 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Oct 2015 23:18:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id A67611A075B; Thu, 29 Oct 2015 23:18:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.9 X-Spam-Level: ** X-Spam-Status: No, score=2.9 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H2=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Nr62GD8Wpm68; Thu, 29 Oct 2015 23:18:46 +0000 (UTC) Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id E8A2E20634; Thu, 29 Oct 2015 23:18:45 +0000 (UTC) Received: by padhk11 with SMTP id hk11so53981502pad.1; Thu, 29 Oct 2015 16:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=sSRDTlZxPLLuxfIy0vIP+G9ZgztPMgT8MlYL7jn2WKg=; b=nKTzq/Be5byyyjxDuMMpiASsPuDHrvkQdbUbQQt3mb8AjIQNeiw+Ec3/EjiCcTDRbZ 1AsXru+wp/hqWbit9t/zyPa7pUtZbjjqGAfdeySax0zaEXCbj+wH7RbLACuQh920ATJy Aklv83rco4I4nCNMUcqljsmhe2/DVKs8kvT0eENseAoNyX2xsePWiQ4w+wdwtC2phhur 887z2KoS8k9dYQcVOnqCytw1j8vTOYa6mlU8oug5/7BtjjYsRZxrv4ktfsb4rZ2ZqjkT q8JRHlxz2aCmJGyfioeaYBImaD4qjxiu7j/K3UYMh4gURTmWp9HO4kKDNR6CKN5i8rvV eiBg== X-Received: by 10.66.164.161 with SMTP id yr1mr4869213pab.62.1446160725574; Thu, 29 Oct 2015 16:18:45 -0700 (PDT) Received: from dhcp-v044-005.mobile.uci.edu (dhcp-v044-005.mobile.uci.edu. [169.234.44.5]) by smtp.gmail.com with ESMTPSA id ce3sm4317701pbb.35.2015.10.29.16.18.44 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Oct 2015 16:18:44 -0700 (PDT) Content-Type: multipart/alternative; boundary="Apple-Mail=_39E719C0-35DB-4D73-B7F7-F4F8AEEA9751" Mime-Version: 1.0 (Mac OS X Mail 9.0 \(3094\)) Subject: Re: Socket feed questions From: Jianfeng Jia In-Reply-To: <2AD1BA54-BD3F-4CBB-BE67-77A72C03D839@gmail.com> Date: Thu, 29 Oct 2015 16:18:43 -0700 Cc: users@asterixdb.incubator.apache.org Message-Id: <1ECBD90B-AC5F-4914-B125-5C3E9BCE319B@gmail.com> References: <792997416F795F469B4A87A6FEC9F9766F54CF29@VTTMAIL3.ad.vtt.fi> <56290A20.8030106@gmail.com> <563054EB.5000405@ics.uci.edu> <2AD1BA54-BD3F-4CBB-BE67-77A72C03D839@gmail.com> To: dev@asterixdb.incubator.apache.org X-Mailer: Apple Mail (2.3094) --Apple-Mail=_39E719C0-35DB-4D73-B7F7-F4F8AEEA9751 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 =20 Let=E2=80=99s say I have a Tweets dataset, and I have a = SyntheticTweeterAdapter to feed the data. It will generate the record = like r1: { =E2=80=9Cid=E2=80=9D: 1, =E2=80=9Ctweet=E2=80=9D : = =E2=80=9Cblabla=E2=80=9D, =E2=80=9Ccoordinate=E2=80=9D: point(1,2) }=20 During the feeding, I want to have an UDF that can enrich the dataset by = appending another field to the record.=20 E.g. I can add the address information of the previous r1 : { =E2=80=9Cid= =E2=80=9D: 1, =E2=80=9Ctweet=E2=80=9D : =E2=80=9Cblabla=E2=80=9D, = =E2=80=9Ccoordinate=E2=80=9D: point(1,2), =E2=80=9Caddress=E2=80=9D: = [=E2=80=9CIrvine, CA=E2=80=9D] } .=20 In order to get the mapping from =E2=80=9Ccoordinate=E2=80=9D to = =E2=80=9Caddress=E2=80=9D, I need to run a AQL query like=20 for $t in feed Tweets return { =E2=80=9Cid=E2=80=9D: $t.id, =E2=80=9Ctweet=E2=80=9D: $t.tweet, = =E2=80=9Ccoordinate=E2=80=9D: $t.coordinate, =E2=80=9Caddress=E2=80=9D: for $city in dataset (=E2=80=9CAsterixCityTable= =E2=80=9D) 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=E2=80=99m 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 = wrote: >=20 >>=20 >> 2. Can we use AQL function in those kind of feed UDFs? >=20 > 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? >=20 > -heri Best, Jianfeng Jia PhD Candidate of Computer Science University of California, Irvine --Apple-Mail=_39E719C0-35DB-4D73-B7F7-F4F8AEEA9751 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
 
Let=E2=80=99s say = I have a Tweets dataset, and I have a SyntheticTweeterAdapter to feed = the data. It will generate the record like r1: { =E2=80=9Cid=E2=80=9D: = 1, =E2=80=9Ctweet=E2=80=9D : =E2=80=9Cblabla=E2=80=9D, =E2=80=9Ccoordinate= =E2=80=9D: 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 :  { =E2=80=9Cid=E2=80=9D: = 1, =E2=80=9Ctweet=E2=80=9D : =E2=80=9Cblabla=E2=80=9D, =E2=80=9Ccoordinate= =E2=80=9D: point(1,2), =E2=80=9Caddress=E2=80=9D: [=E2=80=9CIrvine, = CA=E2=80=9D] } . 

In order to get the mapping from =E2=80=9Ccoordinate=E2=80=9D = to =E2=80=9Caddress=E2=80=9D, I need to run a AQL query = like 

for = $t in feed Tweets
return { =E2=80=9Cid=E2=80=9D: = $t.id, =E2=80=9Ctweet=E2=80=9D: $t.tweet, =E2=80=9Ccoordinate=E2=80=9D: = $t.coordinate,
=E2=80=9Caddress=E2=80=9D: for $city = in dataset (=E2=80=9CAsterixCityTable=E2=80=9D) 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=E2=80=99m 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 <heriram@gmail.com> = 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

= --Apple-Mail=_39E719C0-35DB-4D73-B7F7-F4F8AEEA9751--