From f64e5e65769729d6f192eadaf79fa5356a2db4c0 Mon Sep 17 00:00:00 2001 From: Loakesh Indiran <66478092+Loaki07@users.noreply.github.com> Date: Wed, 25 Jun 2025 15:39:29 +0530 Subject: [PATCH] fix: stream_type for join (#7348) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### **PR Type** Bug fix ___ ### **Description** - Add fallback for empty stream_type in joins - Use `sql.stream_type` when no type provided - Retain existing mapping for provided stream types ___ ### **Changes walkthrough** 📝
Relevant files
Bug fix
http.rs
Implement stream_type fallback logic                                         

src/service/search/cluster/http.rs
  • Add conditional branch for empty stream_type
  • Fallback to sql.stream_type when missing
  • Retain original StreamType::from mapping otherwise
  • +5/-1     
    ___ >
    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • --- src/service/search/cluster/http.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/service/search/cluster/http.rs b/src/service/search/cluster/http.rs index f6b0455471..0c534ed1ce 100644 --- a/src/service/search/cluster/http.rs +++ b/src/service/search/cluster/http.rs @@ -58,7 +58,11 @@ pub async fn search( // Get the schema from `TableReference` for join queries // Since it resolves queries where stream_name is prefixed with the stream_type // e.g. `logs.my_stream`, `enrich.my_stream` - let stream_type = config::meta::stream::StreamType::from(s.stream_type()); + let stream_type = if s.stream_type().is_empty() { + sql.stream_type + } else { + config::meta::stream::StreamType::from(s.stream_type()) + }; let schema = infra::schema::get_cache(&sql.org_id, &s.stream_name(), stream_type).await?; if schema.schema().fields().is_empty() { let mut result = search::Response::new(sql.offset, sql.limit);