From 13260349b08c2b0f625d0c9db414de3bc4a734be Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Sat, 20 Sep 2025 20:34:24 -0300 Subject: [PATCH] Return a parse error for a non-equality join We currently don't handle non equality, but end up just returning a bogus result. Let's parse error. --- core/incremental/compiler.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/incremental/compiler.rs b/core/incremental/compiler.rs index 8c8189261..7c215f2f1 100644 --- a/core/incremental/compiler.rs +++ b/core/incremental/compiler.rs @@ -1204,6 +1204,20 @@ impl DbspCompiler { .map(|col| col.name.clone()) .collect(); + // Check if there are any non-equijoin conditions in the filter + if join.filter.is_some() { + return Err(LimboError::ParseError( + "Non-equijoin conditions are not supported in materialized views. Only equality joins (=) are allowed.".to_string() + )); + } + + // Check if we have at least one equijoin condition + if join.on.is_empty() { + return Err(LimboError::ParseError( + "Joins in materialized views must have at least one equality condition.".to_string() + )); + } + // Extract join key indices from join conditions // For now, we only support equijoin conditions let mut left_key_indices = Vec::new();