summaryrefslogtreecommitdiffstats
path: root/yql/essentials/sql/v1/select.cpp
diff options
context:
space:
mode:
authorvvvv <[email protected]>2025-02-21 21:51:34 +0300
committervvvv <[email protected]>2025-02-21 22:33:18 +0300
commita3da80a1d278964b44086f8b500ed09bad0f165f (patch)
tree368b6985119a89ba99279100dbb8adf7f4bda951 /yql/essentials/sql/v1/select.cpp
parent005b8a9fd31e325164fdaad9ccde51222d9dc1c7 (diff)
YQL-19129 soft WITHOUT
commit_hash:563aebc32ae87bc18e5e3e38babc034e5e89e2c1
Diffstat (limited to 'yql/essentials/sql/v1/select.cpp')
-rw-r--r--yql/essentials/sql/v1/select.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/yql/essentials/sql/v1/select.cpp b/yql/essentials/sql/v1/select.cpp
index f44e328ba2c..98029daa511 100644
--- a/yql/essentials/sql/v1/select.cpp
+++ b/yql/essentials/sql/v1/select.cpp
@@ -1489,6 +1489,7 @@ public:
const TVector<TNodePtr>& terms,
bool distinct,
const TVector<TNodePtr>& without,
+ bool forceWithout,
bool selectStream,
const TWriteSettings& settings,
TColumnsSets&& uniqueSets,
@@ -1506,6 +1507,7 @@ public:
, WinSpecs(winSpecs)
, Terms(terms)
, Without(without)
+ , ForceWithout(forceWithout)
, Distinct(distinct)
, LegacyHoppingWindowSpec(legacyHoppingWindowSpec)
, SelectStream(selectStream)
@@ -1924,7 +1926,7 @@ public:
if (Source && Source->GetJoin()) {
name = DotJoin(*without->GetSourceName(), name);
}
- terms = L(terms, Y("let", "row", Y("RemoveMember", "row", Q(name))));
+ terms = L(terms, Y("let", "row", Y(ForceWithout ? "ForceRemoveMember" : "RemoveMember", "row", Q(name))));
}
}
@@ -1941,7 +1943,7 @@ public:
return new TSelectCore(Pos, Source->CloneSource(), CloneContainer(GroupByExpr),
CloneContainer(GroupBy), CompactGroupBy, GroupBySuffix, AssumeSorted, CloneContainer(OrderBy),
SafeClone(Having), CloneContainer(WinSpecs), SafeClone(LegacyHoppingWindowSpec),
- CloneContainer(Terms), Distinct, Without, SelectStream, Settings, TColumnsSets(UniqueSets), TColumnsSets(DistinctSets));
+ CloneContainer(Terms), Distinct, Without, ForceWithout, SelectStream, Settings, TColumnsSets(UniqueSets), TColumnsSets(DistinctSets));
}
private:
@@ -2301,6 +2303,7 @@ private:
TNodePtr CompositeTerms;
TVector<TNodePtr> Terms;
TVector<TNodePtr> Without;
+ const bool ForceWithout;
const bool Distinct;
bool OrderByInit = false;
TLegacyHoppingWindowSpecPtr LegacyHoppingWindowSpec;
@@ -2715,6 +2718,7 @@ TSourcePtr DoBuildSelectCore(
TVector<TNodePtr>&& terms,
bool distinct,
TVector<TNodePtr>&& without,
+ bool forceWithout,
bool selectStream,
const TWriteSettings& settings,
TColumnsSets&& uniqueSets,
@@ -2722,7 +2726,7 @@ TSourcePtr DoBuildSelectCore(
) {
if (groupBy.empty() || !groupBy.front()->ContentListPtr()) {
return new TSelectCore(pos, std::move(source), groupByExpr, groupBy, compactGroupBy, groupBySuffix, assumeSorted,
- orderBy, having, winSpecs, legacyHoppingWindowSpec, terms, distinct, without, selectStream, settings, std::move(uniqueSets), std::move(distinctSets));
+ orderBy, having, winSpecs, legacyHoppingWindowSpec, terms, distinct, without, forceWithout, selectStream, settings, std::move(uniqueSets), std::move(distinctSets));
}
if (groupBy.size() == 1) {
/// actualy no big idea to use grouping function in this case (result allways 0)
@@ -2730,7 +2734,7 @@ TSourcePtr DoBuildSelectCore(
source = new TNestedProxySource(pos, *contentPtr, source);
return DoBuildSelectCore(ctx, pos, originalSource, source, groupByExpr, *contentPtr, compactGroupBy, groupBySuffix,
assumeSorted, orderBy, having, std::move(winSpecs),
- legacyHoppingWindowSpec, std::move(terms), distinct, std::move(without), selectStream, settings, std::move(uniqueSets), std::move(distinctSets));
+ legacyHoppingWindowSpec, std::move(terms), distinct, std::move(without), forceWithout, selectStream, settings, std::move(uniqueSets), std::move(distinctSets));
}
/// \todo some smart merge logic, generalize common part of grouping (expr, flatten, etc)?
TIntrusivePtr<TCompositeSelect> compositeSelect = new TCompositeSelect(pos, std::move(source), originalSource->CloneSource(), settings);
@@ -2757,7 +2761,7 @@ TSourcePtr DoBuildSelectCore(
totalGroups += contentPtr->size();
TSelectCore* selectCore = new TSelectCore(pos, std::move(proxySource), CloneContainer(groupByExpr),
CloneContainer(*contentPtr), compactGroupBy, groupBySuffix, assumeSorted, orderBy, SafeClone(having), CloneContainer(winSpecs),
- legacyHoppingWindowSpec, terms, distinct, without, selectStream, settings, TColumnsSets(uniqueSets), TColumnsSets(distinctSets));
+ legacyHoppingWindowSpec, terms, distinct, without, forceWithout, selectStream, settings, TColumnsSets(uniqueSets), TColumnsSets(distinctSets));
subselects.emplace_back(selectCore);
}
if (totalGroups > ctx.PragmaGroupByLimit) {
@@ -2786,6 +2790,7 @@ TSourcePtr BuildSelectCore(
TVector<TNodePtr>&& terms,
bool distinct,
TVector<TNodePtr>&& without,
+ bool forceWithout,
bool selectStream,
const TWriteSettings& settings,
TColumnsSets&& uniqueSets,
@@ -2793,7 +2798,7 @@ TSourcePtr BuildSelectCore(
)
{
return DoBuildSelectCore(ctx, pos, source, source, groupByExpr, groupBy, compactGroupBy, groupBySuffix, assumeSorted, orderBy,
- having, std::move(winSpecs), legacyHoppingWindowSpec, std::move(terms), distinct, std::move(without), selectStream, settings, std::move(uniqueSets), std::move(distinctSets));
+ having, std::move(winSpecs), legacyHoppingWindowSpec, std::move(terms), distinct, std::move(without), forceWithout, selectStream, settings, std::move(uniqueSets), std::move(distinctSets));
}
class TUnion: public IRealSource {