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 <[email protected]> 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 <
> [email protected]> 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
>>
>

Reply via email to