The Vertica Forum recently got a makeover! Let us know what you think by filling out this short, anonymous survey.

How to migrate User Defined Functions from Enterprise to EON

HI Team,
I want to migrate User Defined Functions from Enterprise to EON Vertica Database , so please let me know if anyone have steps .

Thanks,
Alim Shaikh

Best Answers

Answers

  • Jim_KnicelyJim_Knicely Administrator

    Actually, you'd want the EXPORT_OBJECTS function.

    Example:

    dbadmin=> \df randomdate
                              List of functions
     procedure_name | procedure_return_type |  procedure_argument_types
    ----------------+-----------------------+----------------------------
     randomdate     | Integer               | c Integer
     randomdate     | Timestamp             | d1 Timestamp, d2 Timestamp
    (2 rows)
    
    dbadmin=> SELECT export_objects('', 'randomdate', false);
                                                                                                                                                                 export_objects                                                          
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    CREATE FUNCTION public.randomdate(d1 Timestamp, d2 Timestamp)
    RETURN timestamp AS
    BEGIN
    RETURN (to_timestamptz(((date_part('epoch', d1) + randomint((floor((date_part('epoch', d2) - date_part('epoch', d1))))::int)))::float))::timestamp;
    END;
    
    CREATE FUNCTION public.randomdate(c Integer)
    RETURN int AS
    BEGIN
    RETURN 1;
    END;
    
    (1 row)
    

    See:
    https://www.vertica.com/docs/9.3.x/HTML/Content/Authoring/SQLReferenceManual/Functions/VerticaFunctions/EXPORT_OBJECTS.htm
    https://www.vertica.com/docs/9.3.x/HTML/Content/Authoring/AdministratorsGuide/CopyExportData/ExportingObjects.htm

  • Jim_KnicelyJim_Knicely Administrator

    @Sankarmn - There is a migration tool coming real soon to Vertica! So the journey from Enterprise mode to Eon mode will be much , much easier!

  • @Jim_Knicely, Good to know.

    Thanks for sharing :)

  • @Jim_Knicely said:
    @Sankarmn - There is a migration tool coming real soon to Vertica! So the journey from Enterprise mode to Eon mode will be much , much easier!

    Considering the overheads and time consuming process, for smaller data movement, is database link also being planned sooner?

    Also let me and the community know what other features are coming soon.

  • Hi Jim and Sankarmn,
    Thanks for the update ... !!!
    yes i did with EXPORT_OBJECTS function and manually run the DDL on EON .

    And what are the checks we need to check and compare for UDF migrations ?

    Thanks ,
    Alim Shaikh

Leave a Comment

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

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.