Files
openobserve/tests/api-testing/tests
Neha PandShrinath Rao 3565d4a516 test: added advanced sql queries (#8573)
### **PR Type**
Tests


___

### **Description**

SQL Query Test Coverage

- COUNT, SUM, AVG, MIN, MAX
-  approx_percentile_cont (P50, P75, P95, P99)
- histogram (time bucketing)
- str_match, str_match_ignore_case, COALESCE
- regexp_match, array_extract (regex groups)
- CASE WHEN (pattern matching)
- HAVING, LIKE, field comparisons
- GROUP BY (multi-field, time buckets)
- Kubernetes fields (kubernetes_container_name, etc.)

- Add advanced SQL E2E tests

- Validate fields and value constraints

- Cover percentiles and aggregations

- Exercise grouping, regex, and filters


___

### Diagram Walkthrough


```mermaid
flowchart LR
  tests["New E2E SQL tests"] --> errorRate["Error rate analysis"]
  tests --> percentiles["Time-bucket percentiles"]
  tests --> volume["Log volume by bucket"]
  tests --> source["Source grouping"]
  tests --> hostPerf["Host performance stats"]
  tests --> compPct["Component percentiles"]
  tests --> apiLogs["API log analysis"]
  tests --> metadata["Regex-based metadata extraction"]
```



<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>test_advanced_sql.py</strong><dd><code>Add
comprehensive E2E advanced SQL query tests</code>&nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

tests/api-testing/tests/test_advanced_sql.py

<ul><li>Add eight E2E tests posting SQL queries<br> <li> Assert HTTP 200
and presence of expected fields<br> <li> Validate rates, percentile
ordering, and counts<br> <li> Use time windows, grouping, regex
extraction</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8573/files#diff-190cc55e8b961580682e09403c997fda2e8288e5f210dec5ab41c9465c68538f">+514/-0</a>&nbsp;
</td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___

---------

Co-authored-by: Shrinath Rao <shnath@openobserve.ai>
2025-09-22 19:58:45 +05:30
..
2025-05-25 21:53:55 -07:00