1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-24 14:20:59 +03:00

MCOL-1201 manual rebase with develop. Obsoletes branch MCOL-1201

This commit is contained in:
David Hall
2018-05-11 09:50:10 -05:00
parent 12b1d99f51
commit 6fa7dded6f
30 changed files with 2255 additions and 1196 deletions

View File

@@ -21,13 +21,35 @@
#ifndef UTILS_WF_UDAF_H
#define UTILS_WF_UDAF_H
#include <set>
#ifndef _MSC_VER
#include <tr1/unordered_set>
#else
#include <unordered_set>
#endif
#include "windowfunctiontype.h"
#include "mcsv1_udaf.h"
namespace windowfunction
{
// Hash classes for the distinct hashmap
class DistinctHasher
{
public:
inline size_t operator()(const static_any::any& a) const
{
return a.getHash();
}
};
class DistinctEqual
{
public:
inline bool operator()(const static_any::any& lhs, static_any::any& rhs) const
{
return lhs == rhs;
}
};
// A class to control the execution of User Define Analytic Functions (UDAnF)
// as defined by a specialization of mcsv1sdk::mcsv1_UDAF
@@ -72,7 +94,8 @@ protected:
bool fDistinct;
bool bRespectNulls; // respect null | ignore null
bool bHasDropValue; // Set to false when we discover the UDAnF doesn't implement dropValue.
std::set<T> fSet; // To hold distinct values
// To hold distinct values
std::tr1::unordered_set<static_any::any, DistinctHasher, DistinctEqual> fDistinctSet;
static_any::any fValOut; // The return value
public: