mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Split has.
This commit is contained in:
parent
715b1a41ed
commit
bc1031be9b
@ -52,7 +52,26 @@ ColumnArray::MutablePtr sliceFromRightConstantOffsetBounded(IArraySource & src,
|
||||
ColumnArray::MutablePtr sliceDynamicOffsetUnbounded(IArraySource & src, const IColumn & offset_column);
|
||||
ColumnArray::MutablePtr sliceDynamicOffsetBounded(IArraySource & src, const IColumn & offset_column, const IColumn & length_column);
|
||||
|
||||
void sliceHas(IArraySource & first, IArraySource & second, ArraySearchType search_type, ColumnUInt8 & result);
|
||||
void sliceHasAny(IArraySource & first, IArraySource & second, ColumnUInt8 & result);
|
||||
void sliceHasAll(IArraySource & first, IArraySource & second, ColumnUInt8 & result);
|
||||
void sliceHasSubstr(IArraySource & first, IArraySource & second, ColumnUInt8 & result);
|
||||
|
||||
void sliceHas(IArraySource & first, IArraySource & second, ArraySearchType search_type, ColumnUInt8 & result)
|
||||
{
|
||||
switch (search_type)
|
||||
{
|
||||
case ArraySearchType::All:
|
||||
sliceHasAny(first, second, result);
|
||||
break;
|
||||
case ArraySearchType::Any:
|
||||
sliceHasAll(first, second, result);
|
||||
break;
|
||||
case ArraySearchType::Substr:
|
||||
sliceHasSubstr(first, second, result);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void push(IArraySource & array_source, IValueSource & value_source, IArraySink & sink, bool push_front);
|
||||
|
||||
|
@ -1,35 +0,0 @@
|
||||
#include "GatherUtils.h"
|
||||
#include "Selectors.h"
|
||||
#include "Algorithms.h"
|
||||
|
||||
namespace DB::GatherUtils
|
||||
{
|
||||
|
||||
struct ArrayHasSelectArraySourcePair : public ArraySourcePairSelector<ArrayHasSelectArraySourcePair>
|
||||
{
|
||||
template <typename FirstSource, typename SecondSource>
|
||||
static void selectSourcePair(FirstSource && first, SecondSource && second, ArraySearchType search_type, ColumnUInt8 & result)
|
||||
{
|
||||
switch (search_type)
|
||||
{
|
||||
case ArraySearchType::All:
|
||||
arrayAllAny<ArraySearchType::All>(first, second, result);
|
||||
break;
|
||||
case ArraySearchType::Any:
|
||||
arrayAllAny<ArraySearchType::Any>(first, second, result);
|
||||
break;
|
||||
case ArraySearchType::Substr:
|
||||
arrayAllAny<ArraySearchType::Substr>(first, second, result);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void sliceHas(IArraySource & first, IArraySource & second, ArraySearchType search_type, ColumnUInt8 & result)
|
||||
{
|
||||
ArrayHasSelectArraySourcePair::select(first, second, search_type, result);
|
||||
}
|
||||
|
||||
}
|
23
src/Functions/GatherUtils/has_all.cpp
Normal file
23
src/Functions/GatherUtils/has_all.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include "GatherUtils.h"
|
||||
#include "Selectors.h"
|
||||
#include "Algorithms.h"
|
||||
|
||||
namespace DB::GatherUtils
|
||||
{
|
||||
|
||||
struct ArrayHasAllSelectArraySourcePair : public ArraySourcePairSelector<ArrayHasSelectArraySourcePair>
|
||||
{
|
||||
template <typename FirstSource, typename SecondSource>
|
||||
static void selectSourcePair(FirstSource && first, SecondSource && second, ArraySearchType search_type, ColumnUInt8 & result)
|
||||
{
|
||||
arrayAllAny<ArraySearchType::All>(first, second, result);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void sliceHasAll(IArraySource & first, IArraySource & second, ColumnUInt8 & result)
|
||||
{
|
||||
ArrayHasAllSelectArraySourcePair::select(first, second, result);
|
||||
}
|
||||
|
||||
}
|
23
src/Functions/GatherUtils/has_any.cpp
Normal file
23
src/Functions/GatherUtils/has_any.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include "GatherUtils.h"
|
||||
#include "Selectors.h"
|
||||
#include "Algorithms.h"
|
||||
|
||||
namespace DB::GatherUtils
|
||||
{
|
||||
|
||||
struct ArrayHasAnySelectArraySourcePair : public ArraySourcePairSelector<ArrayHasSelectArraySourcePair>
|
||||
{
|
||||
template <typename FirstSource, typename SecondSource>
|
||||
static void selectSourcePair(FirstSource && first, SecondSource && second, ArraySearchType search_type, ColumnUInt8 & result)
|
||||
{
|
||||
arrayAllAny<ArraySearchType::Any>(first, second, result);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void sliceHasAny(IArraySource & first, IArraySource & second, ColumnUInt8 & result)
|
||||
{
|
||||
ArrayHasAnySelectArraySourcePair::select(first, second, result);
|
||||
}
|
||||
|
||||
}
|
23
src/Functions/GatherUtils/has_substr.cpp
Normal file
23
src/Functions/GatherUtils/has_substr.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include "GatherUtils.h"
|
||||
#include "Selectors.h"
|
||||
#include "Algorithms.h"
|
||||
|
||||
namespace DB::GatherUtils
|
||||
{
|
||||
|
||||
struct ArrayHasSubstrSelectArraySourcePair : public ArraySourcePairSelector<ArrayHasSelectArraySourcePair>
|
||||
{
|
||||
template <typename FirstSource, typename SecondSource>
|
||||
static void selectSourcePair(FirstSource && first, SecondSource && second, ArraySearchType search_type, ColumnUInt8 & result)
|
||||
{
|
||||
arrayAllAny<ArraySearchType::Substr>(first, second, result);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void sliceHasSubstr(IArraySource & first, IArraySource & second, ColumnUInt8 & result)
|
||||
{
|
||||
ArrayHasSubstrSelectArraySourcePair::select(first, second, result);
|
||||
}
|
||||
|
||||
}
|
@ -190,7 +190,9 @@ SRCS(
|
||||
GatherUtils/createArraySink.cpp
|
||||
GatherUtils/createArraySource.cpp
|
||||
GatherUtils/createValueSource.cpp
|
||||
GatherUtils/has.cpp
|
||||
GatherUtils/has_all.cpp
|
||||
GatherUtils/has_any.cpp
|
||||
GatherUtils/has_substr.cpp
|
||||
GatherUtils/push.cpp
|
||||
GatherUtils/resizeConstantSize.cpp
|
||||
GatherUtils/resizeDynamicSize.cpp
|
||||
|
Loading…
Reference in New Issue
Block a user