mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-05 08:09:22 +00:00
### **PR Type**
Bug fix, Enhancement
___
### **Description**
- Guard flattening for non-object JSON values
- Prevent panics by checking null/object types
- Improve timestamp handling on null values
- Tighten pipeline flattening conditions
___
### Diagram Walkthrough
```mermaid
flowchart LR
VRL["VRL result"] -- "may be null/non-object" --> Guard["Check is_object && not null"]
Guard -- "true" --> Flatten["Flatten JSON"]
Guard -- "false" --> Bypass["Use value as-is"]
Timestamp["Ingest timestamp"] -- "null" --> Now["Default to current time"]
Pipeline["Pipeline nodes"] -- "flatten only objects" --> Flatten
```
<details> <summary><h3> File Walkthrough</h3></summary>
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Bug
fix</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>multi_streams.rs</strong><dd><code>Safe flattening in
multi-stream search</code>
</dd></summary>
<hr>
src/handler/http/request/search/multi_streams.rs
<ul><li>Flatten only when value is non-null object<br> <li> Preserve
non-object items in per-query responses<br> <li> Avoid unwrap panics by
using ok()/None</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8366/files#diff-c3233cdf1e68cb2455f91457719b9c2f477e735ee16546fdfe111e76768bd054">+13/-5</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>functions.rs</strong><dd><code>Guard VRL transform
flattening</code>
</dd></summary>
<hr>
src/service/functions.rs
<ul><li>Only flatten VRL return if object<br> <li> Prevent empty-string
on non-object by-pass</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8366/files#diff-ed5611a9aa6b5c033e70d7631ba72fafad3cc842672077a7fcf965d11a4fef23">+1/-1</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>ingest.rs</strong><dd><code>Robust null timestamp
handling</code>
</dd></summary>
<hr>
src/service/logs/ingest.rs
<ul><li>Default null timestamp to now<br> <li> Keep error on unparsable
non-null timestamps</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8366/files#diff-e62118e45be183266d39ffa08491f255017954235ff0f3d6937683e314da406f">+10/-4</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>http.rs</strong><dd><code>Safe flattening in clustered
search</code>
</dd></summary>
<hr>
src/service/search/cluster/http.rs
<ul><li>Flatten array items only if objects<br> <li> Guard VRL result
flattening<br> <li> Add conditional hit flattening in query_fn path</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8366/files#diff-fe0a1bbec7ef6418120544b589a531e5144b28cd2650f99135ed8a70ac17ac03">+17/-12</a>
</td>
</tr>
</table></td></tr><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>batch_execution.rs</strong><dd><code>Pipeline: guarded
flattening and timestamp checks</code>
</dd></summary>
<hr>
src/service/pipeline/batch_execution.rs
<ul><li>Flatten only non-null objects across nodes<br> <li> Apply guards
before condition/func/destination steps<br> <li> Conditional timestamp
handling only for objects<br> <li> Improve error logging and flow
control</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8366/files#diff-3f6824a6eddaf1603e5cb0f1a4311ac6a45e1ffb967266ccc1f0bba944625e69">+26/-18</a>
</td>
</tr>
</table></td></tr></tr></tbody></table>
</details>
___