diff --git a/utils/udfsdk/docs/build/latex/UDAF.pdf b/utils/udfsdk/docs/build/latex/UDAF.pdf index 090a8a8c1..eb5011f33 100644 Binary files a/utils/udfsdk/docs/build/latex/UDAF.pdf and b/utils/udfsdk/docs/build/latex/UDAF.pdf differ diff --git a/utils/udfsdk/docs/source/reference/ByteStream.rst b/utils/udfsdk/docs/source/reference/ByteStream.rst index 99353a386..52317bf34 100644 --- a/utils/udfsdk/docs/source/reference/ByteStream.rst +++ b/utils/udfsdk/docs/source/reference/ByteStream.rst @@ -9,7 +9,7 @@ Bytestream is compiled and lives in the messageqcpp shared library. The header c #include "bytestream.h" -For UDA(n)F you should not have to instantiate a ByteStream. However, if you implement the Complex Data Model, you will need to use the instances passed to your serialize() and unserialize() methods. +For UDA(n)F you should not have to instantiate a ByteStream. However, if you implement :ref:`complexdatamodel`, you will need to use the instances passed to your serialize() and unserialize() methods. These typedefs exist only for backwards compatibility and can be ignored: diff --git a/utils/udfsdk/docs/source/usage/UDAFMap.rst b/utils/udfsdk/docs/source/reference/UDAFMap.rst similarity index 98% rename from utils/udfsdk/docs/source/usage/UDAFMap.rst rename to utils/udfsdk/docs/source/reference/UDAFMap.rst index afd739c12..48706bab3 100644 --- a/utils/udfsdk/docs/source/usage/UDAFMap.rst +++ b/utils/udfsdk/docs/source/reference/UDAFMap.rst @@ -1,4 +1,4 @@ -.. _udaf_map: +.. _udafmap: UDAFMap ======= diff --git a/utils/udfsdk/docs/source/reference/UserData.rst b/utils/udfsdk/docs/source/reference/UserData.rst index b9e28e868..c85176ff3 100644 --- a/utils/udfsdk/docs/source/reference/UserData.rst +++ b/utils/udfsdk/docs/source/reference/UserData.rst @@ -5,9 +5,9 @@ The UserData struct is used for allocating and streaming the intermediate data n There may be multiple instantiations of UserData for each UDA(n)F call. Make no assumptions about the contents except within the context of a method call. -Since there is no need to deal with the UserData Structure unless you are using the Complex Data Mode, the remainder of this page assumes the Complex Data Structure. +Since there is no need to deal with the UserData Structure unless you are using :ref:`complexdatamodel`, the remainder of this page assumes :ref:`complexdatamodel`. -To use the Complex Data Structure, you derive a struct from UserData and override, at the least, the streaming functions. +To use :ref:`complexdatamodel`, you derive a struct from UserData and override, at the least, the streaming functions. .. rubric:: constructor diff --git a/utils/udfsdk/docs/source/usage/headerfile.rst b/utils/udfsdk/docs/source/usage/headerfile.rst index d97c1210e..720acc5be 100644 --- a/utils/udfsdk/docs/source/usage/headerfile.rst +++ b/utils/udfsdk/docs/source/usage/headerfile.rst @@ -9,11 +9,10 @@ The easiest way to create these files is to copy them an example closest to the Your header file must have a class defined that will implement your function. This class must be derived from mcsv1_UDAF and be in the mcsv1sdk namespace. The following examples use the "allnull" UDAF. -First you must include at least the following: +First you must include at least the following:: -.. literalinclude:: ../../../allnull.h - :lines: 71-72 - :language: cpp + #include "mcsv1_udaf.h" + #include "calpontsystemcatalog.h" Other headers as needed. Then:: @@ -22,11 +21,20 @@ Other headers as needed. Then:: Next you must create your class that will implement the UDAF. You must have a constructor, virtual destructor and all the methods that are declared pure in the base class mcsv1_UDAF. There are also methods that have base class implementations. These you may extended as needed. Other methods may be added if you feel a need for helpers. -allnull uses the Simple Data Model. See the Complex Data Model chapter to see how that is used. See the MEDIAN example to see the dropValue() usage. +allnull uses the Simple Data Model. See :ref:`complexdatamodel` to see how that is used. See the MEDIAN example to see the dropValue() usage:: -.. literalinclude:: ../../../allnull.h - :lines: 94-218 - :language: cpp + class allnull : public mcsv1_UDAF + { + public: + allnull() : mcsv1_UDAF(){}; + virtual ~allnull(){}; + + virtual ReturnCode init(mcsv1Context* context, COL_TYPES& colTypes); + virtual ReturnCode reset(mcsv1Context* context); + virtual ReturnCode nextValue(mcsv1Context* context, std::vector& valsIn); + virtual ReturnCode subEvaluate(mcsv1Context* context, const UserData* userDataIn); + virtual ReturnCode evaluate(mcsv1Context* context, static_any::any& valOut); + }; diff --git a/utils/udfsdk/docs/source/usage/index.rst b/utils/udfsdk/docs/source/usage/index.rst index ce419f574..9aaff345b 100644 --- a/utils/udfsdk/docs/source/usage/index.rst +++ b/utils/udfsdk/docs/source/usage/index.rst @@ -8,7 +8,6 @@ Using mcsv1_udaf memoryallocation headerfile sourcefile - UDAFMap cmakelists compile copylibs diff --git a/utils/udfsdk/docs/source/usage/introduction.rst b/utils/udfsdk/docs/source/usage/introduction.rst index 403c83bc6..6b3544a1e 100644 --- a/utils/udfsdk/docs/source/usage/introduction.rst +++ b/utils/udfsdk/docs/source/usage/introduction.rst @@ -13,7 +13,7 @@ The steps required to create a function are: * Create a :ref:`header file ` for your function. * Create a :ref:`source file ` for your function. * Implement :ref:`mariadb udaf api ` code. -* Add the function to :ref:`UDAFMap ` in mcsv1_udaf.cpp +* Add the function to :ref:`UDAFMap ` in mcsv1_udaf.cpp * Add the function to :ref:`CMakeLists.txt ` in ./utils/udfsdk * :ref:`Compile udfsdk `. * :ref:`Copy the compiled libraries ` to the working directories. diff --git a/utils/udfsdk/docs/source/usage/memoryallocation.rst b/utils/udfsdk/docs/source/usage/memoryallocation.rst index 144f2099f..1ca5f74a5 100644 --- a/utils/udfsdk/docs/source/usage/memoryallocation.rst +++ b/utils/udfsdk/docs/source/usage/memoryallocation.rst @@ -51,7 +51,7 @@ This consists of the createUserData() method that must be over ridden and the Us Let's take a look at the base user data structure defined in mcsv1_udaf.h: .. literalinclude:: ../../../mcsv1_udaf.h - :lines: 126-168 + :lines: 131-173 :language: cpp There are two constructors listed. The second one taking a size is used by :ref:`simpledatamodel`.