You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-523 Remove un-implemented functions finish(), getRowCnt(), and getRowsInPartition().
This commit is contained in:
@ -614,6 +614,7 @@
|
|||||||
<F N="../../../mariadb/sql/ha_partition.h"/>
|
<F N="../../../mariadb/sql/ha_partition.h"/>
|
||||||
<F N="ha_subquery.h"/>
|
<F N="ha_subquery.h"/>
|
||||||
<F N="ha_view.h"/>
|
<F N="ha_view.h"/>
|
||||||
|
<F N="idb_mysql.h"/>
|
||||||
</Folder>
|
</Folder>
|
||||||
<Folder
|
<Folder
|
||||||
Name="Resource Files"
|
Name="Resource Files"
|
||||||
|
@ -2860,11 +2860,9 @@ void RowAggregationUM::doNullConstantAggregate(const ConstantAggData& aggData, u
|
|||||||
|
|
||||||
case ROWAGG_UDAF:
|
case ROWAGG_UDAF:
|
||||||
{
|
{
|
||||||
int64_t rowCnt = 0;
|
|
||||||
// For a NULL constant, call nextValue with NULL and then evaluate.
|
// For a NULL constant, call nextValue with NULL and then evaluate.
|
||||||
bool bInterrupted = false;
|
bool bInterrupted = false;
|
||||||
mcsv1sdk::mcsv1Context context(((RowUDAFFunctionCol*)fFunctionCols[i].get())->fUDAFContext);
|
mcsv1sdk::mcsv1Context context(((RowUDAFFunctionCol*)fFunctionCols[i].get())->fUDAFContext);
|
||||||
context.setRowCnt(rowCnt);
|
|
||||||
context.setInterrupted(bInterrupted);
|
context.setInterrupted(bInterrupted);
|
||||||
context.createUserData();
|
context.createUserData();
|
||||||
mcsv1sdk::mcsv1_UDAF::ReturnCode rc;
|
mcsv1sdk::mcsv1_UDAF::ReturnCode rc;
|
||||||
@ -3191,10 +3189,8 @@ void RowAggregationUM::doNotNullConstantAggregate(const ConstantAggData& aggData
|
|||||||
|
|
||||||
case ROWAGG_UDAF:
|
case ROWAGG_UDAF:
|
||||||
{
|
{
|
||||||
int64_t rowCnt = 0;
|
|
||||||
bool bInterrupted = false;
|
bool bInterrupted = false;
|
||||||
mcsv1sdk::mcsv1Context context(((RowUDAFFunctionCol*)fFunctionCols[i].get())->fUDAFContext);
|
mcsv1sdk::mcsv1Context context(((RowUDAFFunctionCol*)fFunctionCols[i].get())->fUDAFContext);
|
||||||
context.setRowCnt(rowCnt);
|
|
||||||
context.setInterrupted(bInterrupted);
|
context.setInterrupted(bInterrupted);
|
||||||
context.createUserData();
|
context.createUserData();
|
||||||
mcsv1sdk::mcsv1_UDAF::ReturnCode rc;
|
mcsv1sdk::mcsv1_UDAF::ReturnCode rc;
|
||||||
|
@ -15,11 +15,7 @@
|
|||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
MA 02110-1301, USA. */
|
MA 02110-1301, USA. */
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
#include <cstring>
|
|
||||||
#include "allnull.h"
|
#include "allnull.h"
|
||||||
#include "bytestream.h"
|
|
||||||
#include "objectreader.h"
|
|
||||||
|
|
||||||
using namespace mcsv1sdk;
|
using namespace mcsv1sdk;
|
||||||
|
|
||||||
@ -31,7 +27,7 @@ struct allnull_data
|
|||||||
|
|
||||||
#define OUT_TYPE int64_t
|
#define OUT_TYPE int64_t
|
||||||
mcsv1_UDAF::ReturnCode allnull::init(mcsv1Context* context,
|
mcsv1_UDAF::ReturnCode allnull::init(mcsv1Context* context,
|
||||||
COL_TYPES& colTypes)
|
COL_TYPES& colTypes)
|
||||||
{
|
{
|
||||||
context->setUserDataSize(sizeof(allnull_data));
|
context->setUserDataSize(sizeof(allnull_data));
|
||||||
if (colTypes.size() < 1)
|
if (colTypes.size() < 1)
|
||||||
@ -46,11 +42,6 @@ mcsv1_UDAF::ReturnCode allnull::init(mcsv1Context* context,
|
|||||||
return mcsv1_UDAF::SUCCESS;
|
return mcsv1_UDAF::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
mcsv1_UDAF::ReturnCode allnull::finish(mcsv1Context* context)
|
|
||||||
{
|
|
||||||
return mcsv1_UDAF::SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
mcsv1_UDAF::ReturnCode allnull::reset(mcsv1Context* context)
|
mcsv1_UDAF::ReturnCode allnull::reset(mcsv1Context* context)
|
||||||
{
|
{
|
||||||
struct allnull_data* data = (struct allnull_data*)context->getUserData()->data;
|
struct allnull_data* data = (struct allnull_data*)context->getUserData()->data;
|
||||||
|
@ -38,22 +38,9 @@
|
|||||||
* 6. restart the Columnstore system.
|
* 6. restart the Columnstore system.
|
||||||
* 7. notify mysqld about the new functions with commands like:
|
* 7. notify mysqld about the new functions with commands like:
|
||||||
*
|
*
|
||||||
* // An example of xor over a range for UDAF and UDAnF
|
* CREATE AGGREGATE FUNCTION allnull returns BOOL soname
|
||||||
* CREATE AGGREGATE FUNCTION mcs_bit_xor returns BOOL soname
|
* 'libudf_mysql.so';
|
||||||
* 'libudfsdk.so';
|
|
||||||
*
|
*
|
||||||
* // An example that only makes sense as a UDAnF
|
|
||||||
* CREATE AGGREGATE FUNCTION mcs_interpolate returns REAL
|
|
||||||
* soname 'libudfsdk.so';
|
|
||||||
*
|
|
||||||
* The UDAF functions may run distributed in the Columnstore
|
|
||||||
* engine. UDAnF do not run distributed.
|
|
||||||
*
|
|
||||||
* UDAF is User Defined Aggregate Function.
|
|
||||||
* UDAnF is User Defined Analytic Function.
|
|
||||||
* UDA(n)F is an acronym for a function that could be either. It
|
|
||||||
* is also used to describe the interface that is used for
|
|
||||||
* either.
|
|
||||||
*/
|
*/
|
||||||
#ifndef HEADER_allnull
|
#ifndef HEADER_allnull
|
||||||
#define HEADER_allnull
|
#define HEADER_allnull
|
||||||
@ -116,18 +103,7 @@ public:
|
|||||||
* colTypes or wrong number of arguments. Else return
|
* colTypes or wrong number of arguments. Else return
|
||||||
* mcsv1_UDAF::SUCCESS.
|
* mcsv1_UDAF::SUCCESS.
|
||||||
*/
|
*/
|
||||||
virtual ReturnCode init(mcsv1Context* context,
|
virtual ReturnCode init(mcsv1Context* context, COL_TYPES& colTypes);
|
||||||
COL_TYPES& colTypes);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* finish()
|
|
||||||
*
|
|
||||||
* Mandatory. Completes the UDA(n)F. Called once per SQL
|
|
||||||
* statement. Do not free any memory allocated by
|
|
||||||
* context->setUserDataSize(). The SDK Framework owns that memory
|
|
||||||
* and will handle that. Often, there is nothing to do here.
|
|
||||||
*/
|
|
||||||
virtual ReturnCode finish(mcsv1Context* context);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* reset()
|
* reset()
|
||||||
@ -162,8 +138,7 @@ public:
|
|||||||
*
|
*
|
||||||
* valsIn (in) - a vector of the parameters from the row.
|
* valsIn (in) - a vector of the parameters from the row.
|
||||||
*/
|
*/
|
||||||
virtual ReturnCode nextValue(mcsv1Context* context,
|
virtual ReturnCode nextValue(mcsv1Context* context, std::vector<ColumnDatum>& valsIn);
|
||||||
std::vector<ColumnDatum>& valsIn);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* subEvaluate()
|
* subEvaluate()
|
||||||
|
@ -57,11 +57,6 @@ mcsv1_UDAF::ReturnCode avg_mode::init(mcsv1Context* context,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mcsv1_UDAF::ReturnCode avg_mode::finish(mcsv1Context* context)
|
|
||||||
{
|
|
||||||
return mcsv1_UDAF::SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
mcsv1_UDAF::ReturnCode avg_mode::reset(mcsv1Context* context)
|
mcsv1_UDAF::ReturnCode avg_mode::reset(mcsv1Context* context)
|
||||||
{
|
{
|
||||||
ModeData* data = static_cast<ModeData*>(context->getUserData());
|
ModeData* data = static_cast<ModeData*>(context->getUserData());
|
||||||
|
@ -136,16 +136,6 @@ public:
|
|||||||
virtual ReturnCode init(mcsv1Context* context,
|
virtual ReturnCode init(mcsv1Context* context,
|
||||||
COL_TYPES& colTypes);
|
COL_TYPES& colTypes);
|
||||||
|
|
||||||
/**
|
|
||||||
* finish()
|
|
||||||
*
|
|
||||||
* Mandatory. Completes the UDA(n)F. Called once per SQL
|
|
||||||
* statement. Do not free any memory allocated by
|
|
||||||
* context->setUserDataSize(). The SDK Framework owns that memory
|
|
||||||
* and will handle that. Often, there is nothing to do here.
|
|
||||||
*/
|
|
||||||
virtual ReturnCode finish(mcsv1Context* context);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* reset()
|
* reset()
|
||||||
*
|
*
|
||||||
|
@ -113,7 +113,6 @@ bool mcsv1Context::operator==(const mcsv1Context& c) const
|
|||||||
|| fResultType != c.fResultType
|
|| fResultType != c.fResultType
|
||||||
|| fResultscale != c.fResultscale
|
|| fResultscale != c.fResultscale
|
||||||
|| fResultPrecision != c.fResultPrecision
|
|| fResultPrecision != c.fResultPrecision
|
||||||
|| fRowsInPartition != c.fRowsInPartition
|
|
||||||
|| fStartFrame != c.fStartFrame
|
|| fStartFrame != c.fStartFrame
|
||||||
|| fEndFrame != c.fEndFrame
|
|| fEndFrame != c.fEndFrame
|
||||||
|| fStartConstant != c.fStartConstant
|
|| fStartConstant != c.fStartConstant
|
||||||
@ -135,7 +134,7 @@ const std::string mcsv1Context::toString() const
|
|||||||
output << " UserDataSize=" << fUserDataSize << " ResultType=" << colDataTypeToString(fResultType) << std::endl;
|
output << " UserDataSize=" << fUserDataSize << " ResultType=" << colDataTypeToString(fResultType) << std::endl;
|
||||||
output << " Resultscale=" << fResultscale << " ResultPrecision=" << fResultPrecision << std::endl;
|
output << " Resultscale=" << fResultscale << " ResultPrecision=" << fResultPrecision << std::endl;
|
||||||
output << " ErrorMsg=" << errorMsg << std::endl;
|
output << " ErrorMsg=" << errorMsg << std::endl;
|
||||||
output << " bInterrupted=" << bInterrupted << " RowsInPartition=" << fRowsInPartition << std::endl;
|
output << " bInterrupted=" << bInterrupted << std::endl;
|
||||||
output << " StartFrame=" << fStartFrame << " EndFrame=" << fEndFrame << std::endl;
|
output << " StartFrame=" << fStartFrame << " EndFrame=" << fEndFrame << std::endl;
|
||||||
output << " StartConstant=" << fStartConstant << " EndConstant=" << fEndConstant << std::endl;
|
output << " StartConstant=" << fStartConstant << " EndConstant=" << fEndConstant << std::endl;
|
||||||
return output.str();
|
return output.str();
|
||||||
@ -199,7 +198,6 @@ void mcsv1Context::serialize(messageqcpp::ByteStream& b) const
|
|||||||
b << errorMsg;
|
b << errorMsg;
|
||||||
// Don't send dataflags. These are set for each call
|
// Don't send dataflags. These are set for each call
|
||||||
// bInterrupted is set internally.
|
// bInterrupted is set internally.
|
||||||
b << fRowsInPartition;
|
|
||||||
b << (uint32_t)fStartFrame;
|
b << (uint32_t)fStartFrame;
|
||||||
b << (uint32_t)fEndFrame;
|
b << (uint32_t)fEndFrame;
|
||||||
b << fStartConstant;
|
b << fStartConstant;
|
||||||
@ -218,7 +216,6 @@ void mcsv1Context::unserialize(messageqcpp::ByteStream& b)
|
|||||||
b >> fResultscale;
|
b >> fResultscale;
|
||||||
b >> fResultPrecision;
|
b >> fResultPrecision;
|
||||||
b >> errorMsg;
|
b >> errorMsg;
|
||||||
b >> fRowsInPartition;
|
|
||||||
uint32_t frame;
|
uint32_t frame;
|
||||||
b >> frame;
|
b >> frame;
|
||||||
fStartFrame = (WF_FRAME)frame;
|
fStartFrame = (WF_FRAME)frame;
|
||||||
|
@ -32,20 +32,24 @@
|
|||||||
* 2. Create the UDF function implementation in some .cpp file
|
* 2. Create the UDF function implementation in some .cpp file
|
||||||
* 3. Create the connector stub (MariaDB UDAF definition) for
|
* 3. Create the connector stub (MariaDB UDAF definition) for
|
||||||
* this UDF function.
|
* this UDF function.
|
||||||
* 4. build the dynamic library using all of the source.
|
* 4. build the dynamic librarys using all of the source.
|
||||||
* 5 Put the library in $COLUMNSTORE_INSTALL/lib of
|
* 5 Put the library in $COLUMNSTORE_INSTALL/lib of
|
||||||
* all modules
|
* all modules
|
||||||
* 6. restart the Columnstore system.
|
* 6. Put the connector stub in $COLUMNSTORE_INSTALL/mysql/lib
|
||||||
* 7. notify mysqld about the new functions with commands like:
|
* of all UMs
|
||||||
|
* 7. restart the Columnstore system. 7. notify mysqld about the
|
||||||
|
* new functions with commands like:
|
||||||
*
|
*
|
||||||
* // An example of xor over a range for UDAF and UDAnF
|
* CREATE AGGREGATE FUNCTION all_null returns BOOL soname
|
||||||
* CREATE AGGREGATE FUNCTION mcs_bit_xor returns BOOL soname
|
* 'libudf_mysql.so';
|
||||||
* 'libudfsdk.so';
|
|
||||||
*
|
*
|
||||||
* // An example that only makes sense as a UDAnF
|
* // An example that only makes sense as a UDAnF
|
||||||
* CREATE AGGREGATE FUNCTION mcs_interpolate returns REAL
|
* CREATE AGGREGATE FUNCTION mcs_interpolate returns REAL
|
||||||
* soname 'libudfsdk.so';
|
* soname 'libudf_mysql.so';
|
||||||
*
|
*
|
||||||
|
* Use the name of the connector stub library in CREATE
|
||||||
|
* AGGREGATE FUNCTION
|
||||||
|
*
|
||||||
* The UDAF functions may run distributed in the Columnstore
|
* The UDAF functions may run distributed in the Columnstore
|
||||||
* engine. UDAnF do not run distributed.
|
* engine. UDAnF do not run distributed.
|
||||||
*
|
*
|
||||||
@ -55,6 +59,7 @@
|
|||||||
* is also used to describe the interface that is used for
|
* is also used to describe the interface that is used for
|
||||||
* either.
|
* either.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef HEADER_mcsv1_udaf
|
#ifndef HEADER_mcsv1_udaf
|
||||||
#define HEADER_mcsv1_udaf
|
#define HEADER_mcsv1_udaf
|
||||||
|
|
||||||
@ -133,9 +138,9 @@ struct UserData
|
|||||||
/**
|
/**
|
||||||
* serialize()
|
* serialize()
|
||||||
*
|
*
|
||||||
* User data is passed between process. In order to do so, it
|
* User data is passed between processes. In order to do so, it
|
||||||
* must be serialized. Since user data can have sub objects,
|
* must be serialized. Since user data can have sub objects,
|
||||||
* containers and the like, it is up to the UDAF to provide the
|
* containers and the like, it is up to the UDAF to provide the
|
||||||
* serialize function. The streaming functionality of
|
* serialize function. The streaming functionality of
|
||||||
* messageqcpp::ByteStream must be used.
|
* messageqcpp::ByteStream must be used.
|
||||||
*
|
*
|
||||||
@ -147,7 +152,7 @@ struct UserData
|
|||||||
/**
|
/**
|
||||||
* unserialize()
|
* unserialize()
|
||||||
*
|
*
|
||||||
* User data is passed between process. In order to do so, it
|
* User data is passed between processes. In order to do so, it
|
||||||
* must be unserialized. Since user data can have sub objects,
|
* must be unserialized. Since user data can have sub objects,
|
||||||
* containers and the like, it is up to the UDAF to provide the
|
* containers and the like, it is up to the UDAF to provide the
|
||||||
* unserialize function. The streaming functionality of
|
* unserialize function. The streaming functionality of
|
||||||
@ -198,7 +203,7 @@ typedef std::vector<std::pair<std::string, CalpontSystemCatalog::ColDataType> >C
|
|||||||
// This is the context class that is passed to all API callbacks
|
// This is the context class that is passed to all API callbacks
|
||||||
// The framework potentially sets data here for each invocation of
|
// The framework potentially sets data here for each invocation of
|
||||||
// mcsv1_UDAF methods. Access methods are given for data useful to UDA(n)F.
|
// mcsv1_UDAF methods. Access methods are given for data useful to UDA(n)F.
|
||||||
// Don't modify anything directly except data retrieved with getUserData().
|
// Don't modify anything directly except the struct retrieved with getUserData().
|
||||||
|
|
||||||
// UDA(n)F devlopers should not modify this class. The framework and other UDA(n)F
|
// UDA(n)F devlopers should not modify this class. The framework and other UDA(n)F
|
||||||
// rely on it being as it was when they were compiled.
|
// rely on it being as it was when they were compiled.
|
||||||
@ -257,23 +262,23 @@ public:
|
|||||||
EXPORT bool isPM();
|
EXPORT bool isPM();
|
||||||
|
|
||||||
// Parameter refinement description accessors
|
// Parameter refinement description accessors
|
||||||
// valid in nextValue, dropValue and evaluateCumulative
|
// valid in nextValue and dropValue
|
||||||
size_t getParameterCount() const;
|
size_t getParameterCount() const;
|
||||||
|
|
||||||
// Determine if an input parameter is NULL
|
// Determine if an input parameter is NULL
|
||||||
// valid in nextValue, dropValue and evaluateCumulative
|
// valid in nextValue and dropValue
|
||||||
EXPORT bool isParamNull(int paramIdx);
|
EXPORT bool isParamNull(int paramIdx);
|
||||||
|
|
||||||
// If a parameter is a constant, the UDA(n)F could presumably optimize its workings.
|
// If a parameter is a constant, the UDA(n)F could presumably optimize its workings
|
||||||
// During the first call to nextValue() or evaluateCumulative().
|
// during the first call to nextValue().
|
||||||
// Is there a better way to determine this?
|
// Is there a better way to determine this?
|
||||||
// valid in nextValue, dropValue and evaluateCumulative
|
// valid in nextValue
|
||||||
EXPORT bool isParamConstant(int paramIdx);
|
EXPORT bool isParamConstant(int paramIdx);
|
||||||
|
|
||||||
// For getting the result type.
|
// For getting the result type.
|
||||||
EXPORT CalpontSystemCatalog::ColDataType getResultType() const;
|
EXPORT CalpontSystemCatalog::ColDataType getResultType() const;
|
||||||
|
|
||||||
// For getting the decimal characteristics for the return value.
|
// For getting the decimal characteristics for the return type.
|
||||||
// These will be set to the default before init().
|
// These will be set to the default before init().
|
||||||
EXPORT int32_t getScale() const;
|
EXPORT int32_t getScale() const;
|
||||||
EXPORT int32_t getPrecision() const;
|
EXPORT int32_t getPrecision() const;
|
||||||
@ -302,16 +307,6 @@ public:
|
|||||||
// method should clean up and exit.
|
// method should clean up and exit.
|
||||||
EXPORT bool getInterrupted() const;
|
EXPORT bool getInterrupted() const;
|
||||||
|
|
||||||
// Returns the actual number of rows in the partition. If no partitioning, returns 0.
|
|
||||||
// valid in reset()
|
|
||||||
EXPORT uint64_t getRowsInPartition() const;
|
|
||||||
|
|
||||||
// Returns the number of rows in the aggregate. This could be the total number of rows,
|
|
||||||
// the number of rows in the group, or the number of rows in the PM's subaggregate,
|
|
||||||
// depending on the context it was called.
|
|
||||||
// valid in subEvaluate() end evaluate().
|
|
||||||
EXPORT uint64_t getRowCnt() const;
|
|
||||||
|
|
||||||
// Allocate instance specific memory. This should be type cast to a structure overlay
|
// Allocate instance specific memory. This should be type cast to a structure overlay
|
||||||
// defined by the function. The actual allocatoin occurs in the various modules that
|
// defined by the function. The actual allocatoin occurs in the various modules that
|
||||||
// do the aggregation. If the UDAF is being calculated in a distributed fashion, then
|
// do the aggregation. If the UDAF is being calculated in a distributed fashion, then
|
||||||
@ -362,18 +357,16 @@ public:
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
uint64_t fRunFlags; // Set by the user to define the type of UDA(n)F
|
uint64_t fRunFlags; // Set by the user to define the type of UDA(n)F
|
||||||
uint64_t fContextFlags; // Set by the framework to define this specific call.
|
uint64_t fContextFlags; // Set by the framework to define this specific call.
|
||||||
int32_t fUserDataSize;
|
int32_t fUserDataSize;
|
||||||
boost::shared_ptr<UserData> fUserData;
|
boost::shared_ptr<UserData> fUserData;
|
||||||
CalpontSystemCatalog::ColDataType fResultType;
|
CalpontSystemCatalog::ColDataType fResultType;
|
||||||
int32_t fColWidth; // The length in bytes of the return type
|
int32_t fColWidth; // The length in bytes of the return type
|
||||||
int32_t fResultscale; // For scale, the number of digits to the right of the decimal
|
int32_t fResultscale; // For scale, the number of digits to the right of the decimal
|
||||||
int32_t fResultPrecision; // The max number of digits allowed in the decimal value
|
int32_t fResultPrecision; // The max number of digits allowed in the decimal value
|
||||||
std::string errorMsg;
|
std::string errorMsg;
|
||||||
std::vector<uint32_t>* dataFlags; // one entry for each parameter
|
std::vector<uint32_t>* dataFlags; // one entry for each parameter
|
||||||
bool* bInterrupted; // Gets set to true by the Framework if something happens
|
bool* bInterrupted; // Gets set to true by the Framework if something happens
|
||||||
uint64_t fRowsInPartition; // Only valid in reset()
|
|
||||||
int64_t fRowCnt; // The number of rows involved in this aggregate.
|
|
||||||
WF_FRAME fStartFrame; // Is set to default to start, then modified by the actual frame in the call
|
WF_FRAME fStartFrame; // Is set to default to start, then modified by the actual frame in the call
|
||||||
WF_FRAME fEndFrame; // Is set to default to start, then modified by the actual frame in the call
|
WF_FRAME fEndFrame; // Is set to default to start, then modified by the actual frame in the call
|
||||||
int32_t fStartConstant; // for start frame WF_PRECEEDIMG or WF_FOLLOWING
|
int32_t fStartConstant; // for start frame WF_PRECEEDIMG or WF_FOLLOWING
|
||||||
@ -398,7 +391,6 @@ public:
|
|||||||
EXPORT void setDataFlags(std::vector<uint32_t>* flags);
|
EXPORT void setDataFlags(std::vector<uint32_t>* flags);
|
||||||
EXPORT void setInterrupted(bool interrupted);
|
EXPORT void setInterrupted(bool interrupted);
|
||||||
EXPORT void setInterrupted(bool* interrupted);
|
EXPORT void setInterrupted(bool* interrupted);
|
||||||
EXPORT void setRowCnt(uint64_t cnt);
|
|
||||||
EXPORT mcsv1sdk::mcsv1_UDAF* getFunction();
|
EXPORT mcsv1sdk::mcsv1_UDAF* getFunction();
|
||||||
EXPORT mcsv1sdk::mcsv1_UDAF* getFunction() const;
|
EXPORT mcsv1sdk::mcsv1_UDAF* getFunction() const;
|
||||||
EXPORT boost::shared_ptr<UserData> getUserDataSP();
|
EXPORT boost::shared_ptr<UserData> getUserDataSP();
|
||||||
@ -407,11 +399,11 @@ public:
|
|||||||
// Since aggregate functions can operate on any data type, we use the following structure
|
// Since aggregate functions can operate on any data type, we use the following structure
|
||||||
// to define the input row data. To be type insensiteve, data is stored in type static_any::any.
|
// to define the input row data. To be type insensiteve, data is stored in type static_any::any.
|
||||||
//
|
//
|
||||||
// To access the data it must be type cast to the correct type using boost::any_cast.
|
// To access the data it must be type cast to the correct type using static_any::cast.
|
||||||
// example for int data:
|
// example for int data:
|
||||||
//
|
//
|
||||||
// if (dataType == CalpontSystemCatalog::INT)
|
// if (valIn.compatible(intTypeId)
|
||||||
// int myint = boost::any_cast<int>columnData;
|
// int myint = valIn.cast<int>();
|
||||||
//
|
//
|
||||||
// For multi-paramter aggregations, the colsIn vector of next_value()
|
// For multi-paramter aggregations, the colsIn vector of next_value()
|
||||||
// contains the ordered set of row parameters.
|
// contains the ordered set of row parameters.
|
||||||
@ -469,16 +461,6 @@ public:
|
|||||||
virtual ReturnCode init(mcsv1Context* context,
|
virtual ReturnCode init(mcsv1Context* context,
|
||||||
COL_TYPES& colTypes) = 0;
|
COL_TYPES& colTypes) = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* finish()
|
|
||||||
*
|
|
||||||
* Mandatory. Completes the UDA(n)F. Called once per SQL
|
|
||||||
* statement. Do not free any memory allocated by
|
|
||||||
* createUserData(). The SDK Framework owns that memory
|
|
||||||
* and will handle that. Often, there is nothing to do here.
|
|
||||||
*/
|
|
||||||
virtual ReturnCode finish(mcsv1Context* context) = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* reset()
|
* reset()
|
||||||
*
|
*
|
||||||
@ -647,7 +629,6 @@ inline mcsv1Context::mcsv1Context() :
|
|||||||
fResultPrecision(18),
|
fResultPrecision(18),
|
||||||
dataFlags(NULL),
|
dataFlags(NULL),
|
||||||
bInterrupted(NULL),
|
bInterrupted(NULL),
|
||||||
fRowsInPartition(0),
|
|
||||||
fStartFrame(WF_UNBOUNDED_PRECEDING),
|
fStartFrame(WF_UNBOUNDED_PRECEDING),
|
||||||
fEndFrame(WF_CURRENT_ROW),
|
fEndFrame(WF_CURRENT_ROW),
|
||||||
fStartConstant(0),
|
fStartConstant(0),
|
||||||
@ -845,16 +826,6 @@ inline bool mcsv1Context::getInterrupted() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline uint64_t mcsv1Context::getRowsInPartition() const
|
|
||||||
{
|
|
||||||
return fRowsInPartition;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline uint64_t mcsv1Context::getRowCnt() const
|
|
||||||
{
|
|
||||||
return fRowCnt;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void mcsv1Context::setUserDataSize(int bytes)
|
inline void mcsv1Context::setUserDataSize(int bytes)
|
||||||
{
|
{
|
||||||
fUserDataSize = bytes;
|
fUserDataSize = bytes;
|
||||||
@ -930,11 +901,6 @@ inline void mcsv1Context::setName(std::string name)
|
|||||||
functionName = name;
|
functionName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void mcsv1Context::setRowCnt(uint64_t cnt)
|
|
||||||
{
|
|
||||||
fRowCnt = cnt;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline uint64_t mcsv1Context::getContextFlags() const
|
inline uint64_t mcsv1Context::getContextFlags() const
|
||||||
{
|
{
|
||||||
return fContextFlags;
|
return fContextFlags;
|
||||||
|
@ -57,11 +57,6 @@ mcsv1_UDAF::ReturnCode median::init(mcsv1Context* context,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mcsv1_UDAF::ReturnCode median::finish(mcsv1Context* context)
|
|
||||||
{
|
|
||||||
return mcsv1_UDAF::SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
mcsv1_UDAF::ReturnCode median::reset(mcsv1Context* context)
|
mcsv1_UDAF::ReturnCode median::reset(mcsv1Context* context)
|
||||||
{
|
{
|
||||||
MedianData* data = static_cast<MedianData*>(context->getUserData());
|
MedianData* data = static_cast<MedianData*>(context->getUserData());
|
||||||
|
@ -136,16 +136,6 @@ public:
|
|||||||
virtual ReturnCode init(mcsv1Context* context,
|
virtual ReturnCode init(mcsv1Context* context,
|
||||||
COL_TYPES& colTypes);
|
COL_TYPES& colTypes);
|
||||||
|
|
||||||
/**
|
|
||||||
* finish()
|
|
||||||
*
|
|
||||||
* Mandatory. Completes the UDA(n)F. Called once per SQL
|
|
||||||
* statement. Do not free any memory allocated by
|
|
||||||
* context->setUserDataSize(). The SDK Framework owns that memory
|
|
||||||
* and will handle that. Often, there is nothing to do here.
|
|
||||||
*/
|
|
||||||
virtual ReturnCode finish(mcsv1Context* context);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* reset()
|
* reset()
|
||||||
*
|
*
|
||||||
|
@ -67,11 +67,6 @@ mcsv1_UDAF::ReturnCode ssq::init(mcsv1Context* context,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mcsv1_UDAF::ReturnCode ssq::finish(mcsv1Context* context)
|
|
||||||
{
|
|
||||||
return mcsv1_UDAF::SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
mcsv1_UDAF::ReturnCode ssq::reset(mcsv1Context* context)
|
mcsv1_UDAF::ReturnCode ssq::reset(mcsv1Context* context)
|
||||||
{
|
{
|
||||||
struct ssq_data* data = (struct ssq_data*)context->getUserData()->data;
|
struct ssq_data* data = (struct ssq_data*)context->getUserData()->data;
|
||||||
|
@ -116,16 +116,6 @@ public:
|
|||||||
virtual ReturnCode init(mcsv1Context* context,
|
virtual ReturnCode init(mcsv1Context* context,
|
||||||
COL_TYPES& colTypes);
|
COL_TYPES& colTypes);
|
||||||
|
|
||||||
/**
|
|
||||||
* finish()
|
|
||||||
*
|
|
||||||
* Mandatory. Completes the UDA(n)F. Called once per SQL
|
|
||||||
* statement. Do not free any memory allocated by
|
|
||||||
* context->createUserData(). The SDK Framework owns that memory
|
|
||||||
* and will handle that. Often, there is nothing to do here.
|
|
||||||
*/
|
|
||||||
virtual ReturnCode finish(mcsv1Context* context);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* reset()
|
* reset()
|
||||||
*
|
*
|
||||||
|
@ -229,10 +229,10 @@
|
|||||||
<Folder
|
<Folder
|
||||||
Name="Other Files"
|
Name="Other Files"
|
||||||
Filters="">
|
Filters="">
|
||||||
|
<F N="CMakeLists.txt"/>
|
||||||
<F
|
<F
|
||||||
N="Makefile"
|
N="Makefile"
|
||||||
Type="Makefile"/>
|
Type="Makefile"/>
|
||||||
<F N="mcsv1_UDAF_base"/>
|
|
||||||
</Folder>
|
</Folder>
|
||||||
</Files>
|
</Files>
|
||||||
</Project>
|
</Project>
|
||||||
|
Reference in New Issue
Block a user