@@ -241,18 +241,7 @@ class TDqsPhysicalOptProposalTransformer : public TOptimizeTransformerBase {
241
241
return DqRewriteLeftPureJoin (node, ctx, *getParents (), IsGlobal);
242
242
}
243
243
244
- TMaybeNode<TExprBase> RewriteStreamLookupJoin (TExprBase node, TExprContext& ctx) {
245
- const auto join = node.Cast <TDqJoin>();
246
- if (join.JoinAlgo ().StringValue () != " StreamLookupJoin" ) {
247
- return node;
248
- }
249
-
250
- const auto pos = node.Pos ();
251
- const auto left = join.LeftInput ().Maybe <TDqConnection>();
252
- if (!left) {
253
- return node;
254
- }
255
-
244
+ bool ValidateStreamLookupJoinFlags (const TDqJoin& join, TExprContext& ctx) {
256
245
bool leftAny = false ;
257
246
bool rightAny = false ;
258
247
if (const auto maybeFlags = join.Flags ()) {
@@ -268,17 +257,35 @@ class TDqsPhysicalOptProposalTransformer : public TOptimizeTransformerBase {
268
257
}
269
258
if (leftAny) {
270
259
ctx.AddError (TIssue (ctx.GetPosition (maybeFlags.Cast ().Pos ()), " Streamlookup ANY LEFT join is not implemented" ));
271
- return {} ;
260
+ return false ;
272
261
}
273
262
}
274
263
if (!rightAny) {
275
264
if (false ) { // Tempoarily change to waring to allow for smooth transition
276
- ctx.AddError (TIssue (ctx.GetPosition (join.Pos ()), " Streamlookup: must be LEFT JOIN ANY" ));
277
- return {} ;
265
+ ctx.AddError (TIssue (ctx.GetPosition (join.Pos ()), " Streamlookup: must be LEFT JOIN /*+streamlookup(...)*/ ANY" ));
266
+ return false ;
278
267
} else {
279
268
ctx.AddWarning (TIssue (ctx.GetPosition (join.Pos ()), " (Deprecation) Streamlookup: must be LEFT JOIN /*+streamlookup(...)*/ ANY" ));
280
269
}
281
270
}
271
+ return true ;
272
+ }
273
+
274
+ TMaybeNode<TExprBase> RewriteStreamLookupJoin (TExprBase node, TExprContext& ctx) {
275
+ const auto join = node.Cast <TDqJoin>();
276
+ if (join.JoinAlgo ().StringValue () != " StreamLookupJoin" ) {
277
+ return node;
278
+ }
279
+
280
+ const auto pos = node.Pos ();
281
+ const auto left = join.LeftInput ().Maybe <TDqConnection>();
282
+ if (!left) {
283
+ return node;
284
+ }
285
+
286
+ if (!ValidateStreamLookupJoinFlags (join, ctx)) {
287
+ return {};
288
+ }
282
289
283
290
TExprNode::TPtr ttl;
284
291
TExprNode::TPtr maxCachedRows;
0 commit comments