Support per-query cache policies for file-based analytics queries
維護者通常 3 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 45/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- sql, typescript
研究方向
首先追蹤 useAnalyticsQuery 進入點和 analytics 外掛程式設定,然後檢查以檔案為基礎的查詢如何在 JSON 和 Arrow 執行路徑中進行快取。定義每個查詢的停用策略或 TTL 策略如何保留現有預設值和執行隔離,並驗證已停用的查詢會在沒有 nonce 參數的情況下重新執行。
由索引模型根據 Issue 內容生成。
描述
Problem
AppKit's analytics plugin caches identical file-based SQL queries for one hour by default. Some queries are intentionally non-deterministic or calculate against current data and must execute every time the user submits them.
In AppKit 0.65.0, useAnalyticsQuery supports:
formatmaxParametersSizeautoStart
There is no per-query cache option. Caching can be disabled globally with:
createApp({
cache: {
enabled: false,
},
});
However, this disables caching for every AppKit plugin and analytics query in the application.
Example
-- config/queries/fresh_value.sql
SELECT current_timestamp() AS calculated_at
const { data } = useAnalyticsQuery('fresh_value');
After unmounting and remounting the component, the same cached timestamp is returned for up to an hour instead of executing the SQL again.
A more significant use case is a parameterized, non-deterministic table-valued function:
SELECT result_json
FROM IDENTIFIER(:functionName)(
:input,
:assumption
)
Submitting the same parameters again should deliberately recalculate against current source data.
Current workaround
We add a unique nonce to every submission:
-- @param queryNonce STRING
SELECT ...
WHERE length(:queryNonce) > 0
const [queryNonce] = useState(() => crypto.randomUUID());
const parameters = useMemo(
() => ({
input: sql.string(input),
queryNonce: sql.string(queryNonce),
}),
[input, queryNonce]
);
This works because parameters are part of the cache key, but it pollutes the SQL contract and creates cache entries that can never be reused.
Requested capability
Please support a server-controlled cache policy for individual file-based queries.
For example, a query directive:
-- @cache disabled
SELECT ...
Or configurable TTL:
-- @cache ttl=60
SELECT ...
Alternatively, plugin configuration could define the policy:
analytics({
queries: {
fresh_value: {
cache: false,
},
summary: {
cache: { ttl: 60 },
},
},
});
A client-side option such as the following would also be useful, although a server-owned policy would prevent clients from bypassing caching for arbitrary expensive queries:
useAnalyticsQuery('fresh_value', parameters, {
cache: 'no-store',
});
Expected behavior
- Existing queries remain cached by default.
- An individual query can disable caching or select a custom TTL.
- The policy applies consistently to JSON and Arrow execution paths.
- Service-principal and on-behalf-of-user execution retain their existing cache isolation.
- Disabled queries execute against the warehouse on every request without requiring dummy parameters.
- 主要語言
- TypeScript
- 星號
- 119
- 分支
- 36
- 平均合併
- 4 天 16 小時
- 30 天內合併 PR
- 37
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
databricks/appkit 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 55/100
databricks/appkit#729 ·
維護者通常 3 天內回覆
-
@databricks/lakebase: pool drops maxLifetimeSeconds and other pg options, so connections never recycle and Unity Catalog claims access fails after 4 hours可能已有人在做 @billmcmillin 於 5 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 20/100
databricks/appkit#718 ·
維護者通常 3 天內回覆
-
難度 4/5 3-5 天 新手友好度 48/100
databricks/appkit#699 ·
維護者通常 3 天內回覆
-
難度 3/5 半天 新手友好度 42/100
databricks/appkit#656 · 1 則留言 ·
維護者通常 3 天內回覆
-
難度 4/5 3-5 天 新手友好度 28/100
databricks/appkit#648 · 2 則留言 ·
維護者通常 3 天內回覆
查看 databricks/appkit 的全部 Issue
相似的 Issue
-
Add "append" and "prepend" slots for vue-vuetify extended renderers可能已有人在做 @simeyc 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 75/100
eclipsesource/jsonforms#2668 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
README の通知条件を実際の判定処理に合わせる可能已有人在做 @unhappychoice 今天認領。 未關閉factory:in-progress priority:medium
難度 1/5 1 小時以內 新手友好度 90/100
unhappychoice/oss-issue-opener#395 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug Website
難度 2/5 1-3 小時 新手友好度 77/100
OWASP/OWASP-Hunting#88 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆