asterixdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xikui Wang <xik...@uci.edu>
Subject Re: Feed adapter for twitter data
Date Wed, 14 Nov 2018 20:10:47 GMT
Here is an example of how you would create a socket feed with a JSON parser:

create type TweetType as {
id: int64
};

create dataset Tweets (TweetType) primary key id;

create feed TwitterFeed with {
  "adapter-name" : "socket_adapter",
  "sockets" : "127.0.0.1:10001",
  "address-type" : "IP",
  "type-name" : "TweetType",
  "format" : "json"
};

connect feed TwitterFeed to dataset Tweets;
start feed TwitterFeed;

One thing that worth noticing is JSON format has limited data types, so you
will see the timestamps are parsed as string and points are parsed as
arrays of doubles.

Best,
Xikui

On Wed, Nov 14, 2018 at 8:32 AM Xikui Wang <xikuiw@uci.edu> wrote:

> Hi Sandra,
>
> Yes. You can create a socket feed with the JSON parser. This will allow
> you to push JSON formatted Tweets into AsterixDB directly.
>
> Best,
> Xikui
>
> On Wed, Nov 14, 2018 at 3:11 AM Sandra Skarshaug <
> sandraskarshaug@gmail.com> wrote:
>
>> Hi!
>>
>> Is it possible to use the twitter feed adapter without providing consumer
>> key and access token, but instead connecting the adapter to a socket which
>> streams twitter data?
>>
>> Best regards,
>> Sandra Skarshaug
>>
>

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