On 2018/10/15 17:58:38, Xikui Wang <[email protected]> wrote:
> Hi Sandra,
>
> The UDF template repo that you used was outdated for some time. There has
> been some UDF refactorization in AsterixDB since that. I've just updated
> the template repo to the latest AsterixDB build. Please pull the latest
> changes before you try again.
>
> If you want to install UDF with the NCService deployment, you would have to
> manually copy the package content into the
> "lib/udfs/DATAVERSE_NAME/LIB_NAME/" directory. You will probably need to
> create all the folders including the "udfs" one. A sample structure of the
> lib directory will be like this:
>
> lib
> ....
> ├── stax-utils-20060502.jar
> └── udfs
> └── test
> └── testlib
> ├── asterix-udf-template-0.1-SNAPSHOT.jar
> └── library_descriptor.xml
>
> About your previous question, Ansible always relies on SSH even if you
> configure it with localhost only. It treats the localhost as a cluster with
> a single machine. You may want to check the password-less configuration of
> your machine to avoid that problem. If you just to want to find a fast way
> to play around, the NCService deployment would be the right way to go. :)
>
> Best,
> Xikui
>
> On Mon, Oct 15, 2018 at 8:14 AM Ian Maxon <[email protected]> wrote:
>
> > You can probably get away with it, yes. Look at what the ansible task
> > to install the UDF does and copy it to the same location, and it'll
> > work.
> >
> > On Mon, Oct 15, 2018 at 7:00 AM Sandra Skarshaug
> > <[email protected]> wrote:
> > >
> > > Some follow up information, I have a folder structure inside
> > asterix-server-0.9.3-binary-assembly which looks like the attached image.
> > The files inside testlib are generated when building the following
> > udf-template project: https://github.com/idleft/asterix-udf-template.
> > >
> > > When I try to execute the query below, it says function
> > test.testlib#mysum@2 is not defined [CompilationException]
> > >
> > > "use test;
> > > testlib#mysum(3,4);"
> > >
> > > man. 15. okt. 2018 kl. 11:36 skrev Sandra Skarshaug <
> > [email protected]>:
> > >>
> > >> Hi!
> > >>
> > >> I am using AsterixDB for my master thesis, and I have some issues I
> > hope you can help me with!
> > >>
> > >> How do I install a UDF package when I am using NCService, not Ansible?
> > Is it enough to unzip the .jar generated from my project, and add it to
> > asterix-server-0.9.3-binary-assembly/lib/udfs/testlib? Or should I use my
> > local version of asterixdb (the cloned repo), not the one installed through
> > your webpage?
> > >>
> > >> The following information is found in the cc.log when I put the .jar in
> > the location specified above (lib/udfs/testlib): ssembly/lib/udfs
> > >>
> > >> Oct 15, 2018 10:41:17 AM org.apache.hyracks.control.cc.CCDriver main
> > >> SEVERE: Exiting CCDriver due to exception
> > >> java.lang.ArrayIndexOutOfBoundsException: 0
> > >> at
> > org.apache.asterix.app.external.ExternalLibraryUtils.getLibraryClassLoader(ExternalLibraryUtils.java:353)
> > >> at
> > org.apache.asterix.app.external.ExternalLibraryUtils.registerLibrary(ExternalLibraryUtils.java:299)
> > >> at
> > org.apache.asterix.app.external.ExternalLibraryUtils.setUpExternaLibraries(ExternalLibraryUtils.java:78)
> > >> at
> > org.apache.asterix.hyracks.bootstrap.CCApplication.start(CCApplication.java:140)
> > >> at org.apache.hyracks.control.cc
> > .ClusterControllerService.startApplication(ClusterControllerService.java:226)
> > >> at org.apache.hyracks.control.cc
> > .ClusterControllerService.start(ClusterControllerService.java:212)
> > >> at org.apache.hyracks.control.cc.CCDriver.main(CCDriver.java:47)
> > >>
> > >>
> > >> I am really looking forward to your answer!
> > >>
> > >> Best regards,
> > >> Sandra Skarshaug
> >
> Hi, thanks for your reply! It finally worked now!
However, I wrote a new function and factory (in the udf-template project), and
then updated the library_descriptor. Then I built the project, ran the
stop-script, before I added the updated files to /testlib. When starting up
asterixDB now, only the old (first) functions are found when executing the
query "SELECT * FROM Metadata.`Function`;", not the new one. Any idea what I
have to do to make the new function available as well?