<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – Overview of UDx</title>
    <link>/en/ot-cad/udx/</link>
    <description>Recent content in Overview of UDx on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/ot-cad/udx/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Ot-Cad: UDx</title>
      <link>/en/ot-cad/udx/udx/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/ot-cad/udx/udx/</guid>
      <description>
        
        
        &lt;p&gt;OTCAD enables you to create, list, and delete custom UDx, so that you can integrate them with existing database tables. UDx allow you to reuse and share code that extends built-in functionality. Use UDx to perform specific tasks such as complex calculations, transformations, or custom data manipulations.&lt;/p&gt;
&lt;p&gt;You can reuse a UDx several times. A function always returns a value explicitly by specifying an expression. It is a good choice to calculate and return a value. You can use UDFs to extend built-in functions or to encapsulate calculations that are standard for your organization. UDFs you create can be called in a way similar to built-in functions.&lt;/p&gt;
&lt;p&gt;You write a UDF’s logic (it&#39;s handler) – in python, C++, or java.&lt;/p&gt;
&lt;h2 id=&#34;about-udx&#34;&gt;About UDx&lt;/h2&gt;
&lt;p&gt;You can view and manage UDx. After logging in to OTCAD, the home page appears. Select the &lt;strong&gt;More options&lt;/strong&gt; button and &lt;strong&gt;UDx&lt;/strong&gt;. The User-defined extensions page appears with the Functions and UDx libraries tabs.&lt;/p&gt;
&lt;p&gt;The Functions tab lists the functions that are available in the system. The &lt;strong&gt;Active SDK version&lt;/strong&gt; label displays the current SDK version of the database. The following columns are displayed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Schema name - The name of the schema.&lt;/li&gt;
&lt;li&gt;Function name - The name of the function.&lt;/li&gt;
&lt;li&gt;Function type - The type of the function. Choose from among Scalar, Aggregate, Analytic, and Transform.&lt;/li&gt;
&lt;li&gt;SDK version - The version of the SDK used to create the library. This is applicable only for C++ and java. For python, this column is empty.&lt;/li&gt;
&lt;li&gt;Language - The language in which the function is developed. For e.g, Python.&lt;/li&gt;
&lt;li&gt;Library - The name of the library to which the UDx is associated.&lt;/li&gt;
&lt;li&gt;Created by - The user ID of the person who created the function.&lt;/li&gt;
&lt;li&gt;Actions - Option to delete the function. For more information about deleting a function, see &lt;a href=&#34;#Delfunc&#34;&gt;Delete a function&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the &lt;strong&gt;Search function name&lt;/strong&gt; field, enter the name of the function. The function is displayed in the Functions tab of the User-defined extensions page.&lt;/p&gt;
&lt;p&gt;The UDx libraries tab lists the UDx along with the status that are available in the system. The following columns are displayed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Library - The name of the library containing the UDx.&lt;/li&gt;
&lt;li&gt;Language - The language in which the library is developed. For e.g, Python.&lt;/li&gt;
&lt;li&gt;Functions - The number of functions associated with the UDx.&lt;/li&gt;
&lt;li&gt;Created by -The user ID of the person who created the library.&lt;/li&gt;
&lt;li&gt;Creation date - The date and time of creation of the library.&lt;/li&gt;
&lt;li&gt;Status - The present status of the UDx library.&lt;/li&gt;
&lt;li&gt;Details - Details about the UDx in the system.&lt;/li&gt;
&lt;li&gt;Actions - Option to delete the UDx library. For more information about deleting a UDx library, see &lt;a href=&#34;#Dellib&#34;&gt;Delete a UDx library&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the &lt;strong&gt;Search library name&lt;/strong&gt; field, enter the name of the UDx library. The UDx library is displayed in the UDX libraries tab of the User-defined extensions page.&lt;/p&gt;
&lt;h3 id=&#34;create-a-library&#34;&gt;Create a library&lt;/h3&gt;
&lt;p&gt;To create a library, do the following in the User-defined extensions page:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;+Add new&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The Create a library page appears.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Library name&lt;/strong&gt; field, enter the name of the library.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Schema&lt;/strong&gt; list, choose the required schema.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Language&lt;/strong&gt; list, choose the required programming language of the functions in the library - Python, Java, or C++.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;File name&lt;/strong&gt; field, enter the name of the file.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

&lt;pre&gt;&lt;code&gt;  Ensure that the class names are present in this file.
&lt;/code&gt;&lt;/pre&gt;


&lt;/div&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Browse&lt;/strong&gt; and choose the file that contains the file you selected in the previous step.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

&lt;pre&gt;&lt;code&gt;  For python, you can upload only .zip files. Ensure that the file is available immediately in the root folder. For example, root/my_file.py. 
  For C++, you can upload only .so files. For java, you can upload JAR files. The maximum file size allowed for all languages is 300 MB. Uploaded files are quarantined for antivirus scanning. If no threats are found, OTCAD creates the function.
&lt;/code&gt;&lt;/pre&gt;


&lt;/div&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

&lt;pre&gt;&lt;code&gt;   The uploading party is solely responsible for any code or content they submit. OpenText does not review or endorse uploads and assumes no liability for them. By uploading, users acknowledge and accept full responsibility for any consequences that may arise.
&lt;/code&gt;&lt;/pre&gt;


&lt;/div&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the Function area, for the &lt;strong&gt;Name&lt;/strong&gt; field, enter the name of the function.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the Function area, for the &lt;strong&gt;Class&lt;/strong&gt; field, enter the name of the class that is defined in the file selected in step 5. For e.g, 
MultiplyAndSumFactory.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From the &lt;strong&gt;Type&lt;/strong&gt; list, select the UDx type:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Scalar&lt;/li&gt;
&lt;li&gt;Aggregate&lt;/li&gt;
&lt;li&gt;Analytic&lt;/li&gt;
&lt;li&gt;Transform&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For more information about the UDx types and the supported languages, see &lt;a href=&#34;../../../en/ot-cad/udx/developing-udx/#&#34;&gt;Developing user-defined extensions (UDx)&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;+Add&lt;/strong&gt; to add another function.
The newly added functions appear in the UDx libraries tab.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

&lt;pre&gt;&lt;code&gt;   You need to have super user privilege to create the library.  
&lt;/code&gt;&lt;/pre&gt;


&lt;/div&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The library is created and displayed in the UDx libraries tab of the User-defined extensions page.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a name=&#34;Delfunc&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;delete-a-function&#34;&gt;Delete a function&lt;/h3&gt;
&lt;p&gt;You can delete functions that are no longer used or needed.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In the Functions tab of the User defined extensions page, select &lt;strong&gt;⋮&lt;/strong&gt; in the Action column.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Delete&lt;/strong&gt;.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

&lt;pre&gt;&lt;code&gt;   Deleting a function removes it from the database. However, references to the function are not deleted. For example, SQL query.
&lt;/code&gt;&lt;/pre&gt;


&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;In the Confirmation dialog, select &lt;strong&gt;Delete&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a name=&#34;Dellib&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;delete-a-udx-library&#34;&gt;Delete a UDx library&lt;/h3&gt;
&lt;p&gt;You can delete UDx libraries that are no longer used or needed.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In the UDx Libraries tab of the User defined extensions page, select &lt;strong&gt;⋮&lt;/strong&gt; in the Action column.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Delete&lt;/strong&gt;.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

&lt;pre&gt;&lt;code&gt;   Deleting a UDx library also deletes the associated UDx function. This may affect all locations where UDx functions are used. You will not be able to retrieve the UDx function after it is deleted as backups will not be available.
&lt;/code&gt;&lt;/pre&gt;


&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;In the Confirmation dialog, select &lt;strong&gt;Delete&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

      </description>
    </item>
    
    <item>
      <title>Ot-Cad: Developing user-defined extensions (UDx)</title>
      <link>/en/ot-cad/udx/developing-udx/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/ot-cad/udx/developing-udx/</guid>
      <description>
        
        
        &lt;p&gt;The primary strengths of UDx are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;You can use them wherever you use internal functions.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;They take full advantage of the distributed computing feature of the system. The extensions usually execute in parallel on each node in the cluster.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The complicated aspects of developing a distributed piece of analytic code are handled by the system. Your main programming task is to read in data, process it, and then write it out using the SDK APIs.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;fenced-mode&#34;&gt;Fenced mode&lt;/h2&gt;
&lt;p&gt;Fenced mode runs the UDx code outside of the main system process. Fenced UDx crashes do not impact the core system process. There is a small performance impact when running UDx code in fenced mode. On average, using fenced mode adds about 10% more time to execution.&lt;/p&gt;
&lt;p&gt;Fenced mode is currently available for all UDx with the exception of user-defined aggregates. All UDx run in fenced mode, since the Python runtimes cannot run directly within the system process. Using fenced mode does not affect the development of your UDx. Fenced mode is enabled by default for all UDx.&lt;/p&gt;
&lt;p&gt;OTCAD does not support the unfenced mode.&lt;/p&gt;
&lt;h2 id=&#34;developing-with-the-database-sdk&#34;&gt;Developing with the database SDK&lt;/h2&gt;
&lt;p&gt;Before you develop your UDx, you need to configure your development environment. The development environment must use the same database version as the production environment. For guidance on obtaining OpenText SDK, contact &lt;a href=&#34;https://www.vertica.com/support&#34;&gt;Technical Support&lt;/a&gt;. For more information about configuring your development environment, see &lt;a href=&#34;../../../en/extending/developing-udxs/developing-with-sdk/#&#34;&gt;Developing with the OpenText Analytics Database SDK&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;database-upgrade&#34;&gt;Database upgrade&lt;/h2&gt;
&lt;p&gt;When the database is upgraded, the SDK is also upgraded. Your UDx libraries depend on that SDK. If the SDK changes, your existing libraries may no longer work. You need to recompile your library using the new SDK, delete the old library, and upload the newly compiled one. If you do not recompile your library using the new SDK, the error &amp;quot;Library built with incompatible SDK version. Rebuild with SDK version [string] and recreate the library&amp;quot; appears when loading or running the UDx.&lt;/p&gt;
&lt;p&gt;If you make any changes to your UDx code, you must compile a new version of the library and upload it again. This also requires removing the existing library and replacing it with your updated one. The database then runs the latest version of your UDx library.&lt;/p&gt;
&lt;h2 id=&#34;udx-types&#34;&gt;UDx types&lt;/h2&gt;
&lt;p&gt;OTCAD supports four types of user-defined extensions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#UDAF&#34;&gt;User-defined aggregate functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#UDAnF&#34;&gt;User-defined analytic functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#UDSF&#34;&gt;User-defined scalar functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#UDTF&#34;&gt;User-defined transform functions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a name=&#34;UDAF&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;user-defined-aggregate-functions-udafs&#34;&gt;User-defined aggregate functions (UDAFs)&lt;/h3&gt;
&lt;p&gt;UDAFs allow you to create custom Aggregate functions specific to your needs. They read one column of data and return one output column. UDAFs can be developed in C++. An Aggregate function performs an operation on a set of values and returns one value. The system provides standard built-in aggregate functions such as AVG, MAX, and MIN. For more information about UDAF, see &lt;a href=&#34;../../../en/extending/developing-udxs/aggregate-functions-udafs/#&#34;&gt;Aggregate functions (UDAFs)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;UDAnF&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;user-defined-analytic-functions-udanfs&#34;&gt;User-defined analytic functions (UDAnFs)&lt;/h3&gt;
&lt;p&gt;UDAnFs are similar to UDSFs, in that they read a row of data and return a single row. However, the function can read input rows independently of outputting rows, so that the output values can be calculated over several input rows. UDAnFs can be developed in C++ and Java and are used for analytics. UDAnFs must output a single value for each row of data read and can have no more than 9800 arguments. For more information about UDAnF, see &lt;a href=&#34;../../../en/extending/developing-udxs/analytic-functions-udanfs/#&#34;&gt;Analytic functions (UDAnFs)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;UDSF&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;user-defined-scalar-functions-udsfs&#34;&gt;User-defined scalar functions (UDSFs)&lt;/h3&gt;
&lt;p&gt;UDSFs take in a single row of data and return a single value. UDSFs can be developed in C++, python, or java. A user-defined scalar function (UDSF) returns a single value for each row of data it reads. You can use a UDSF anywhere you can use a built-in database function. For more information about UDSF, see &lt;a href=&#34;../../../en/extending/developing-udxs/scalar-functions-udsfs/#&#34;&gt;Scalar functions (UDSFs)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;UDTF&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;user-defined-transform-functions-udtfs&#34;&gt;User-defined transform functions (UDTFs)&lt;/h3&gt;
&lt;p&gt;UDTFs operate on table partitions and return zero or more rows of data. The data they return can be an entirely new table, unrelated to the schema of the input table, with its own ordering and segmentation expressions. They can only be used in the SELECT list of a query. UDTFs can be developed in C++, python, and java.&lt;/p&gt;
&lt;p&gt;To optimize query performance, you can use live aggregate projections to pre-aggregate the data that a UDTF returns. A user-defined transform function (UDTF) lets you transform a table of data into another table. It reads one or more arguments (as a row of data) and returns zero or more rows of data comprising one or more columns. For more information about UDTF, see &lt;a href=&#34;../../../en/extending/developing-udxs/transform-functions-udtfs/#&#34;&gt;Transform functions (UDTFs)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;While each UDx type has a unique base class, developing them is similar in many ways. Different UDx types can also share the same library.&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;UDxtype&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;udx-types-and-supported-languages&#34;&gt;UDx types and supported languages&lt;/h3&gt;
&lt;p&gt;The UDx types and their supported languages are as follows:&lt;/p&gt;

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;th &gt;
UDx type&lt;/th&gt; 

&lt;th &gt;
Java&lt;/th&gt; 

&lt;th &gt;
C++&lt;/th&gt; 

&lt;th &gt;
Python&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;#UDSF&#34;&gt;User-defined scalar functions&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Yes&lt;/td&gt; 

&lt;td &gt;
Yes&lt;/td&gt; 

&lt;td &gt;
Yes&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;#UDAF&#34;&gt;User-defined aggregate functions&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
No&lt;/td&gt; 

&lt;td &gt;
Yes&lt;/td&gt; 

&lt;td &gt;
No&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;#UDAnF&#34;&gt;User-defined analytic functions&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Yes&lt;/td&gt; 

&lt;td &gt;
Yes&lt;/td&gt; 

&lt;td &gt;
No&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;#UDTF&#34;&gt;User-defined transform functions&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Yes&lt;/td&gt; 

&lt;td &gt;
Yes&lt;/td&gt; 

&lt;td &gt;
Yes&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;For more information, see [Developing user-defined extensions (UDx)] &lt;a href=&#34;../../../en/extending/developing-udxs/#&#34;&gt;Developing user-defined extensions (UDxs)&lt;/a&gt;&lt;/p&gt;

      </description>
    </item>
    
  </channel>
</rss>
