Skip to content

docs: add Query Cache guide and Chinese translation#3439

Merged
zclllyybb merged 5 commits into
apache:masterfrom
HappenLee:docs
Mar 12, 2026
Merged

docs: add Query Cache guide and Chinese translation#3439
zclllyybb merged 5 commits into
apache:masterfrom
HappenLee:docs

Conversation

@HappenLee
Copy link
Copy Markdown
Contributor

Add Query Cache documentation and its Chinese localization; update sidebars.json to include the new page. This documents Query Cache behavior, configuration, limitations and examples.

Versions

  • dev
  • 4.x
  • 3.x
  • 2.1

Languages

  • Chinese
  • English

Docs Checklist

  • Checked by AI
  • Test Cases Built

Copilot AI review requested due to automatic review settings March 9, 2026 03:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds end-user documentation for Apache Doris Query Cache (English + Chinese) and attempts to expose the page in the docs sidebar.

Changes:

  • Add a new English Query Cache guide under docs/query-acceleration/.
  • Add a new Chinese (zh-CN) translation of the Query Cache guide under i18n/.../current/query-acceleration/.
  • Add query-acceleration/query-cache to the version-4.x sidebar.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
versioned_sidebars/version-4.x-sidebars.json Adds Query Cache doc to the 4.x sidebar navigation.
i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/query-cache.md Introduces the zh-CN translation for the new Query Cache doc.
docs/query-acceleration/query-cache.md Introduces the English Query Cache documentation page.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +154 to +157
| 参数 | 说明 | 默认值 |
|------|------|--------|
| `query_cache_size` | 每个 BE 上 Query Cache 的总内存容量,单位为 MB | `512` |

Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The BE configuration table is malformed because rows start with || instead of a single |, which breaks Markdown table rendering. Please change it to standard pipe-table syntax (single leading/trailing | per row).

Copilot uses AI. Check for mistakes.
]
},
"query-acceleration/sql-cache-manual",
"query-acceleration/query-cache",
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sidebar entry adds query-acceleration/query-cache to the 4.x version, but there is no corresponding doc in versioned_docs/version-4.x/query-acceleration/query-cache.md (and no versioned zh-CN translation either). This will break the 4.x docs build/navigation; either add the versioned doc (and translation) or remove this entry and instead add the page to the current sidebar if it’s only meant for docs/ (dev).

Suggested change
"query-acceleration/query-cache",

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +5
# Query Cache

## Introduction

In analytical workloads, the same aggregation query is often executed repeatedly on data that has not changed, for example:
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new doc is missing the standard front matter block (JSON between ---) used by other pages in docs/query-acceleration/ for title, language, and description. Without it, metadata (title/description) and consistency with the rest of the docs may be lost—please add the front matter like the neighboring Query Acceleration docs.

Copilot uses AI. Check for mistakes.
---
{
"title": "Query Cache",
"language": "zh-CN"
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The front matter here omits a description field, but other zh-CN docs in this section consistently provide one for SEO/search and sidebar previews. Consider adding a concise Chinese description to match the established docs front matter pattern.

Suggested change
"language": "zh-CN"
"language": "zh-CN",
"description": "介绍 Apache Doris Query Cache 机制的工作原理、使用方式和限制。"

Copilot uses AI. Check for mistakes.
Comment on lines +122 to +127
| 条件 | 原因 |
|------|------|
| Fragment 是 Runtime Filter 的目标 | Runtime Filter 的值是动态的,在规划时未知;缓存会产生错误结果 |
| 包含非确定性表达式(`rand()`、`now()`、`uuid()`、UDF 等) | 即使输入相同,结果也会因执行次数不同而变化 |
| 缓存子树中包含 JOIN、SORT、UNION 或 WINDOW 节点 | 仅支持聚合-扫描模式 |
| 扫描节点不是 `OlapScanNode`(例如外部表扫描) | 缓存依赖于 Tablet ID 和版本,外部表不存在这些概念 |
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This markdown table is malformed: rows start with || instead of a single |, so it won’t render as a table in Markdown/Docusaurus. Please change the header/separator/data rows to standard pipe-table syntax (single leading/trailing |).

Copilot uses AI. Check for mistakes.
Comment on lines +145 to +149
| 参数 | 说明 | 默认值 |
|------|------|--------|
| `enable_query_cache` | 启用或禁用 Query Cache 的总开关 | `false` |
| `query_cache_force_refresh` | 设为 `true` 时,忽略缓存结果并重新执行查询;新结果仍会写入缓存 | `false` |
| `query_cache_entry_max_bytes` | 单个缓存条目的最大字节数。如果聚合结果超过此限制,该 Fragment 的结果将不会被缓存 | `5242880`(5 MB) |
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Session Variables (FE) table is malformed because rows start with || instead of a single |, so it won’t render as a table in Markdown/Docusaurus. Please convert it to standard pipe-table syntax (single leading/trailing | per row).

Copilot uses AI. Check for mistakes.
@zclllyybb
Copy link
Copy Markdown
Contributor

/review

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary — PR #3439: Add Query Cache Guide

Overview

This PR adds a new Query Cache documentation page (English + Chinese) for the current (dev) and 4.x versions, and updates the version-4.x-sidebars.json to include it. The documentation is well-structured and covers the feature comprehensively.

Critical Checkpoint Conclusions

  1. Goal vs. Implementation: The goal is to document the Query Cache feature. The documentation content is thorough and well-organized. However, the implementation has two issues that prevent the goal from being fully achieved — the current version sidebar is not updated, so the page is unreachable in dev docs navigation, and the English files are missing front matter.

  2. Change size and focus: The change is appropriately scoped — new doc files for 2 versions × 2 languages + sidebar update. Focused and clear.

  3. Documentation information architecture: Issue found. The sidebars.ts file (which controls current/dev version navigation) was not updated to include query-acceleration/query-cache. The page exists on disk at docs/query-acceleration/query-cache.md but is orphaned from navigation. Users browsing the dev docs cannot reach it via the sidebar. The version-4.x-sidebars.json was correctly updated.

  4. Sidebar/navigation consistency: As noted above, sidebars.ts is missing the entry. The version-4.x-sidebars.json change is correct — the new entry is placed in the "Caching" category alongside sql-cache-manual and condition-cache.

  5. Front matter: Issue found. Both English files (docs/query-acceleration/query-cache.md and versioned_docs/version-4.x/query-acceleration/query-cache.md) are missing the JSON front matter block. Every sibling file in the same directory (e.g., sql-cache-manual.md, condition-cache.md, colocation-join.md) has front matter with title, language, and description fields. The Chinese files do have front matter. This inconsistency affects SEO metadata and Docusaurus title/description resolution.

  6. Version/locale consistency:

    • English current and 4.x files are identical — correct.
    • Chinese current and 4.x files are identical — correct.
    • English and Chinese content is semantically consistent — correct.
    • The PR description checks dev and unchecks 4.x, but the 4.x version files are included in the PR. This is fine (the sidebar was updated for 4.x), but the checkbox is misleading.
    • Absence from 3.x and 2.1 appears intentional — Query Cache is a newer pipeline-level feature.
  7. Link validity: The relative link [SQL Cache](./sql-cache-manual.md) resolves correctly in all four file locations. No broken links detected.

  8. Content quality: The documentation follows feature doc standards well — has overview, working principle explanation, configuration reference with defaults, usage examples, applicable/not-applicable scenarios, and notes. The content is technically detailed and clear.

  9. Validation: No build was run, but structural checks were performed. The sidebar omission would cause the page to be unreachable in dev docs.

Issues Found

# Severity File Issue
1 High sidebars.ts Missing query-acceleration/query-cache entry in the Caching category. The dev/current version page is unreachable through navigation.
2 Medium docs/query-acceleration/query-cache.md Missing JSON front matter (title, language, description). All sibling files have it.
3 Medium versioned_docs/version-4.x/query-acceleration/query-cache.md Same: missing JSON front matter.

@@ -0,0 +1,231 @@
# Query Cache

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing front matter. Every sibling file in this directory (sql-cache-manual.md, condition-cache.md, colocation-join.md, etc.) has a JSON front matter block with title, language, and description fields. This file should have one too, for example:

---
{
    "title": "Query Cache",
    "language": "en",
    "description": "Query Cache caches intermediate aggregation results in the pipeline execution engine to accelerate repeated analytical queries on internal OLAP tables."
}
---

Without front matter, Docusaurus may not set the correct page title and meta description for SEO.

@@ -0,0 +1,231 @@
# Query Cache

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing front matter — same issue as the docs/ copy. This file should include JSON front matter with title, language, and description to match every other file in this directory.

"items": [
"query-acceleration/sql-cache-manual",
"query-acceleration/query-cache",
"query-acceleration/condition-cache",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version-4.x-sidebars.json is correctly updated, but sidebars.ts (the current/dev version sidebar) was not updated. The file docs/query-acceleration/query-cache.md exists on disk but is orphaned from navigation — users browsing the dev docs cannot reach it via the sidebar.

Please add 'query-acceleration/query-cache' to the Caching category in sidebars.ts (around line 630), matching the placement here:

{
    type: 'category',
    label: 'Caching',
    items: [
        'query-acceleration/sql-cache-manual',
        'query-acceleration/query-cache',  // <-- add this
        'query-acceleration/condition-cache',
        'query-acceleration/tuning/tuning-plan/accelerating-queries-with-sql-cache',
    ],
},

@zclllyybb zclllyybb merged commit b0144e5 into apache:master Mar 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants