WHAT IT ANSWERS
这张表适合回答什么
- 判断某日是否交易日
- 生成市场交易日序列
- 将日历日转换为下一个交易日
DATASET · ref
ref.calendar
定义各市场日期是否开市及相关会话信息,是按交易日对齐、补齐和计算 T+N 的基础表。
trade_dateWHAT IT ANSWERS
GRAIN & TIME
KEY FIELDS
markettrade_dateRECOMMENDED JOINS
该表主要按自身业务键使用,目前没有推荐的跨表主键联接。
HOW TO QUERY SAFELY
先用 catalog 确认当前契约;可按 catalog 中列出的 filters 进一步缩小范围;单页最多 5000 行,该表不提供稳定 cursor,结果过大时必须缩小标的、日期或其他筛选。
MACHINE CONTRACT
trade_date, market—canonical_final_activemarket→ market · stringPOINT IN TIME
该资产没有 PIT 契约。普通 rows 端点仍按当前公开读模式返回数据;不要把它表述成历史时点快照。
COPY-READY CALLS
同一数据集可用 HTTP、Python SDK、CLI 或 MCP;Key 始终只通过环境变量/Bearer Header 传递。
curl --fail-with-body -H "Authorization: Bearer $FRIENDS_DATA_API_KEY" "https://api.alphahubs.uk/api/v1/data/datasets/ref/calendar/rows?limit=100&market=CN&start=2026-08-01&end=2026-08-01"from friends_data_api import FriendsDataClient, Settings
async with FriendsDataClient(Settings.from_env()) as client:
page = await client.get_dataset_rows('ref', 'calendar', limit=100, start='2026-08-01', end='2026-08-01', filters={'market': 'CN'})
print(page.data)
if page.has_more:
print("next cursor:", page.next_cursor)friends-data get-dataset-rows ref calendar --limit 100 --start 2026-08-01 --end 2026-08-01 --filter market=CN{
"arguments": {
"dataset": "calendar",
"end": "2026-08-01",
"filters": {
"market": "CN"
},
"limit": 100,
"namespace": "ref",
"start": "2026-08-01"
},
"tool": "get_dataset_rows"
}FIELD DICTIONARY
descriptionSource 可在 JSON 中区分仓库注释、标准术语表和名称推导说明。
| # | 字段 | ClickHouse 类型 | JSON | 可空 | 角色 | 说明 |
|---|---|---|---|---|---|---|
| 1 | market | LowCardinality(String) | string | no | filter, default_order, warehouse_primary_key | Canonical market or country-market code.标准术语表 |
| 2 | trade_datedate | Date | string / date | no | time, default_order, warehouse_primary_key | Trading-session date in the dataset's market calendar.标准术语表 |
| 3 | is_trading_day | UInt8 | integer | no | value | Whether trading day applies to the row.名称推导 |
| 4 | provider | LowCardinality(String) | string | no | provenance | Upstream data provider identifier.标准术语表 |
| 5 | source_url | String | string | no | provenance | URL of the upstream evidence or record when distributable.标准术语表 |
| 6 | source_record_id | String | string | no | provenance | Provider-side identifier for the source record.标准术语表 |
| 7 | raw_payload_hash | String | string | no | provenance | Opaque fingerprint of the normalized source payload for provenance checks.标准术语表 |
| 8 | parser_version | LowCardinality(String) | string | no | provenance | Version of the parser or normalizer that produced the row.标准术语表 |
| 9 | quality_status | LowCardinality(String) | string | no | provenance | Machine-readable data-quality classification.标准术语表 |
| 10 | license_scope | LowCardinality(String) | string | no | provenance | License or redistribution scope attached to the row.标准术语表 |
| 11 | visibility_tier | LowCardinality(String) | string | no | provenance | Serving visibility tier attached to the row.标准术语表 |
| 12 | ingest_run_id | String | string | no | provenance | Identifier of the ingestion run that produced the row.标准术语表 |
| 13 | version | UInt64 | integer | no | provenance | Monotonic row version used for correction-aware reads.标准术语表 |
| 14 | is_deleted | UInt8 | integer | no | value | Soft-delete marker; public serving excludes current tombstones.标准术语表 |
| 15 | created_atUTC_datetime | DateTime64(3, 'UTC') | string / date-time | no | value | UTC timestamp when the warehouse row was first created.标准术语表 |
| 16 | updated_atUTC_datetime | DateTime64(3, 'UTC') | string / date-time | no | value | UTC timestamp when the warehouse row was last updated.标准术语表 |
换一个字段名、类型或角色。
结构来自 Friends 只读身份可见的真实 serving relation;权限、过滤、排序、PIT 与分页来自可执行 DatasetSpec。Schema observed at 2026-10-06T18:08:52Z。