You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@asterixdb.apache.org by Torsten Bergh Moss <to...@ig.ntnu.no> on 2019/11/12 21:52:39 UTC

Re: Running the template sentiment analysis UDF

Thing is, in my UDF-template's pom.xml file, ${asterixdb-verson} results in a missing dependency, so I found and downloaded the jar-file for 0.9.4.1 from https://mvnrepository.com/artifact/org.apache.asterix/apache-asterixdb and used that instead when building the UDF package.

I'm on the master branch on my AsterixDB instance, since I am still getting the error when running the UDF I assume I also have to have the patch in the asterix-jar-file that is used as a dependency to build the UDF?

Running mvn package on my AsterixDB-instance results in RAT-problems, and if I resolve those with -Drat.skip=true, I get a failure on execution of goal org.apache.maven.plugins:maven-dependency-plugin:3.1.1:analyze-only. How can I build a UDF that includes the patch?

Best wishes,
Torsten

________________________________________
From: Xikui Wang <xi...@uci.edu>
Sent: Friday, October 11, 2019 7:25 PM
To: dev@asterixdb.apache.org
Subject: Re: Running the template sentiment analysis UDF

This patch has just been merged into the master branch. If you check out
the latest master, this issue should be gone.

Best,
Xikui

On Tue, Oct 8, 2019 at 9:55 AM Xikui Wang <xi...@uci.edu> wrote:

> Hi Torsten,
>
> The sentiment function in the template is for demo purposes and is not
> expected to be applied on Tweets directly. You need to modify it to work
> with Tweets.
>
> The error that you see is because of a bug in mapping an incoming Tweet to
> a Java record that is to be used in UDF. Although you didn't use Array
> explicitly, the Tweets coming from Twitter do contain arrays. This is a
> known issue, and I have submitted a patch for this but it hasn't been
> merged yet. You can get the fix at [1].
>
> [1] https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/3405
>
> Best,
> Xikui
>
> On Tue, Oct 8, 2019 at 7:47 AM Torsten Bergh Moss <
> torsten.b.moss@ig.ntnu.no> wrote:
>
>> Hi!
>>
>>
>> I built a dataset of tweets using the twitter feed adaptor, and now I am
>> trying to run the tweets through the sample sentiment analysis UDF from the
>> template:
>>
>>
>>
>> https://github.com/idleft/asterix-udf-template/blob/master/src/main/java/org/apache/asterix/external/library/SentimentFunction.java
>>
>>
>> First I got an error about not being able to cast a JLong to a JString,
>> but I fixed it quickly by making the id JFloat on line 40.
>>
>>
>> Now I'm getting a RunTimeDataException stating "Cannot parse list item of
>> type array", however I cannot seem to find a use of neither arrays nor
>> lists in the function. I've also scanned the logs for clues without any
>> luck.
>>
>>
>> Any pointers in the right direction would be highly appreciated.
>>
>>
>> Best wishes,
>>
>> Torsten Bergh Moss
>>
>