Unable to find vertica_sdk

I am trying to write a custom UD Filter in Python as in the below screenshot

But I am unable to find the vertica_sdk module, how can I fix this

Answers

  • marcothesanemarcothesane - Select Field - Administrator

    There is no such thing as a ready-made sdk module . There is, however, a software development kit, with plugin locations in Vertica's software.

    And there are examples that you inspire yourself on when you build your own custom functionality.

    For Python, on any Vertica node, go:

    $ ls -lF /opt/vertica/sdk/examples/python
    total 36
    -rw-rw-r-- 1 gessnerm gessnerm  3704 Dez 20 15:32 AvgMultiPhaseUDT.py
    -rw-rw-r-- 1 gessnerm gessnerm 11150 Dez 20 15:32 InvertedIndex.py
    -rw-rw-r-- 1 gessnerm gessnerm  6931 Dez 20 15:32 ScalarFunctions.py
    -rw-rw-r-- 1 gessnerm gessnerm  6206 Dez 20 15:32 TransformFunctions.py
    -rw-rw-r-- 1 gessnerm gessnerm  2421 Dez 20 15:32 UDParsers.py
    

    There's no sample on UDFilter, true, but there is one on UDParsers; you could start from that one to build your custom UDFilter Python script

  • edited May 9

    Thanks @marcothesane .
    All the py samples seems to be inheriting some class from vertica_sdk, are you saying these are just examples and doesnt work?

    Also in case of UDFilter the documentation says the subclass should override and provide implementation for process() method

    and I am using UDFilter I also need to subclass FilterFactory class

    examples in the documentations also suggest importing vertica_sdk

  • SruthiASruthiA Administrator

    Did you perform the steps in the below link? vertica_sdk should be available after you set up environment as shown in the below link.

    https://docs.vertica.com/24.2.x/en/extending/developing-udxs/developing-with-sdk/python-sdk/setting-up-python-development-environment

  • edited May 14

    I have created the virtual env but still see an error which says modulenot found

    In my PyUXD I am trying to use a lz4 module which helps me with decompressing the file , but I get only a error saying modulenotfound

    PyUDX

    **Creating library :- **

    CREATE OR REPLACE LIBRARY UDFilterTest AS '/usr/pyudx/UDFilter.py' DEPENDS '/usr/pyudx/lib64/python3.9/site-packages/*' LANGUAGE 'Python';

    error :-

  • SruthiASruthiA Administrator

    I see that now the error is different. Did you install lz4 module using pip install lz4 on the server?

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file