asterixdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jianfeng Jia <>
Subject Re: Socket feed questions
Date Mon, 02 Nov 2015 07:32:35 GMT
I’ve tried the “apply AQLfunction” idea, but got an NullPointException:
        at org.apache.asterix.aql.translator.AqlTranslator.getFeedJointKey(
        at org.apache.asterix.aql.translator.AqlTranslator.getFeedConnectionRequest(
        at org.apache.asterix.aql.translator.AqlTranslator.handleConnectFeedStatement(
        at org.apache.asterix.aql.translator.AqlTranslator.compileAndExecute(
        at org.apache.asterix.api.http.servlet.APIServlet.doPost(
        at javax.servlet.http.HttpServlet.service(
        at javax.servlet.http.HttpServlet.service(
        at org.eclipse.jetty.servlet.ServletHolder.handle(
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
        at org.eclipse.jetty.servlet.ServletHandler.doScope(
        at org.eclipse.jetty.server.session.SessionHandler.doScope(
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
        at org.eclipse.jetty.server.Server.handle(
        at org.eclipse.jetty.server.HttpConnection.handleRequest(
        at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(
        at org.eclipse.jetty.http.HttpParser.parseNext(
        at org.eclipse.jetty.http.HttpParser.parseAvailable(
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(
        at org.eclipse.jetty.util.thread.QueuedThreadPool$

The ddl that I was using is here:
Anyone has any idea? Thank you!

> On Oct 30, 2015, at 12:30 AM, Heri Ramampiaro <> wrote:
> Although I haven’t tested this (I have mostly used & created java-based UDFs),

> one can execute AQL calls from within a UDF. Feeds allows functions to 
> execute arbitrary AQL statements (DDL, DMLs etc). I.e., I believe what
> you are trying to do is possible.  
> For example you could do:
> (Given that you have a rec. type called Tweet, and a dataset ProcessedTweets
> create feed CoordTwitterFeed if not exists
> using “push_twitter" (("type-name"="Tweet”))
> 	apply function find-intersection;
> (Here "find-intersection” is an AQL function that does the step specified under 2)).
> To do nr. 3 the easiest way is to have a modified version of the “hashTag” 
> (let’s call this “tweetlocator”).  Java-based UDF (see my previous message with
> TweetLib example). You can then connect this  as a secondary feed, connected to 
> “CoordTwitterFeed”.
> E.g.:
> create secondary feed ProcessedTwitterFeed from feed CoordTwitterFeed
> apply function “tweelib#tweetlocator";
> Thereafter you can connect the feeds to appropriate datasets.
> (Since the find-intersection is an AQL function, you can also call “tweelib#tweetlocator”
> inside this function).
> Best,
> -heri
>> On Oct 30, 2015, at 12:18 AM, Young-Seok Kim <> wrote:
>> I'm not sure whether the following UDF is possible or not, but hopefully it
>> is.
>> What we're trying to do is to have the following UDF.
>> The UDF
>> 1) accepts an incoming tweet record through a feed job as an input and then
>> 2) takes a field, more specifically, coordinate field value from the tweet
>> record and sends a spatial-intersect query using the coordinate in order to
>> find out the corresponding county of the coordinates (we have created
>> AsterixDB instance which stores US county shapes records into a dataset and
>> created R-tree index on the polygon field of it, so the query will return
>> the county effectively using the R-tree index)
>> 3) creates a new tweet record consisting of the original record's fields +
>> the returned county value
>> 4) ingests to a tweet dataset in the AsterixDB instance.
>> Can we have such an UDF?
>> Best,
>> Young-Seok
>> On Thu, Oct 29, 2015 at 3:53 PM, Heri Ramampiaro <> 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


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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message