Normalizer interface for TMUDFs, blueprint cmp-tmudf-compile-time-interface Added new compiler interfaces:
describeParamsAndColumns has been extended to allow updating PARTITION BY and ORDER BY clauses specified for input tables.
describeDataFlowAndPredicates() allows the TMUDF to eliminate columns not needed by the query and to push predicates into the TMUDF or to the children.
describeConstraints() allows the TMUDF to see cardinality and uniqueness constraints of the table-valued inputs (children) and to synthesize cardinality and uniqueness constraints on the TMUDF result.
TMUDFs now have 3 function types: GENERIC - makes most conservative assumptions in the compiler MAPPER - assumes TMUDF carries no state between input rows REDUCER - assumes TMUDF carries no state between input partitions defined by PARTITION BY clause
Query id and user id are now available to the UDR.
Added doxygen documentation for the C++ UDR interface. The resulting web page will be published on the wiki. To generate the documentation yourself, do the following:
cd $MY_SQROOT/../sql/sqludr doxygen doxygen_tmudr.1.6.config # now open tmudr_1.0/html/index.html in a web browser
C++ run-time interface for TMUDFs blueprint cmp-tmudf-compile-time-interface
- Support for C++ run-time interface: - A new language, C++ is added to langman, the existing LanguageManagerC handles both C and C++ - Two new parameter styles got added, C++ and Java object-oriented parameter styles. Routines written in C++ use the new object-oriented C++ parameter style. The compiler interface is only supported for that style (and in the future for the Java object-oriented style). - Also added one more compile time interface, the "completeDescription()" call in the generator. Added logic to extract the UDRPlanInfo of the optimal plan. - Changes to UDRInvocationInfo and UDRPlanInfo classes: - UDRInvocationInfo and UDRPlanInfo objects can now be serialized and they are added to generated plans, as part of the UDR TDB. - Split TableInfo into TupleInfo and TableInfo classes. TupleInfo is now the common base class for describing both parameters and input/output tables. - TypeInfo now has offsets for data, null indicator and varchar indicator. - New get<type> and set<type> methods on class TupleInfo, to be used at compile time for parameters and at runtime for parameters, input and output tables. - Added a "call phase" member, to be able to throw exceptions when certain methods are called at the wrong time (e.g. trying to modify compile time members at runtime). - Routine class in langman now has a new subclass, LmRoutineCppObj and a new method, invokeRoutineMethod, that is used to invoke the object-oriented methods, requiring UDRInvocationInfo and UDRPlanInfo as parameters. - Fixed some executor issues with error handling for UDFs, this is still not very well supported - Emitting the EOD row in the UDF is no longer required, and no longer supported or even possible. - UDRPlanInfo is now part of the physical properties, so that we can extract it from the optimal plan. - Disabling TMUDF as the inner of a nested join - for now. We might support this "routine join" at a later time. - regress/udr/TEST001: - SESSIONIZE_STATIC remains in C, but other TMUDFs are now rewritten in C++ (the runtime part that was not yet in C++) - SESSIONIZE_DYNAMIC is now the same as the example on the wiki - regress/udr/TEST002: Added some tests for event log reader UDF, but can't add the part that copies a sample log file, since in Jenkins, we don't have $MY_SQROOT set. Tried the test on my workstation, though. Steve tells me $MY_SQROOT should be available, so in a future checkin I'll enable this code again. - For patch set 2: Removed fix for LP bug 1420539 and addressed other review comments.