quantdb-data-structure

Documents QuantDB parquet directory layout, Hive partitions, and DuckDB query conventions.

1.5k|337|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/qusong0627/QuantMind --skill quantdb-data-structure-qusong0627
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: quantdb-data-structure
Source: https://github.com/qusong0627/QuantMind/tree/main/skills/quantdb-data-structure
Command: npx skills add https://github.com/qusong0627/QuantMind --skill quantdb-data-structure-qusong0627

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? QuantDB stores market data across six dataset directories with mixed layouts (Hive-partitioned vs single-file parquet) and two conflicting stock code formats, so engineers frequently write queries that silently return empty results or scan the wrong partitions. This Skill provides the authoritative reference for where data lives, how it is organized, and how to read it correctly. ## Core Features & Use Cases - Directory & Partition Map: Documents the six top-level datasets (1_kline_data through 6_ml_datasets), the integer dt=YYYYMMDD Hive partition convention, and single-file vs partitioned storage rules. - Code Format Conversion Rules: Explains the suffix-style format (600519.SH) used in QuantDB parquet versus the prefix-style format (SH600519) used in PostgreSQL internal tables, and the conversion utilities that prevent silent empty-query failures. - Read Entry Points: Lists the quantdb_hub.py single read entry, all qdb_* DuckDB views, server path mappings (/opt/quantmind/data/quantdb to container /data/quantdb), and a pre-coding self-check checklist. - Use Case: When a DuckDB query against daily kline data returns zero rows, use this Skill to verify the dt filter is an integer, the symbol is suffix-style, and the partition directory actually exists on the server. ## Quick Start Ask the AI to explain where QuantDB stores forward-adjusted daily kline data and how to query it for symbol 600519.SH between two dates.

Frequently Asked Questions about quantdb-data-structure

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query QuantDB parquet data with DuckDB?

Use the quantdb_hub.py entry point, which mounts partitioned datasets as qdb_* DuckDB views with hive_partitioning enabled. Filter partitions with integer dt values like WHERE dt BETWEEN 20260101 AND 20260828 to enable predicate pushdown.

How is the QuantDB data directory organized?

QuantDB uses six top-level dataset directories: 1_kline_data, 2_base_sector, 3_financial_data, 4_bond_etf, 5_technical_derived, and 6_ml_datasets. Partitioned datasets use dt=YYYYMMDD subdirectories, while financial reports and minute klines are stored as single per-symbol parquet files.

Why does my QuantDB parquet query return empty results?

The most common cause is a stock code format mismatch: QuantDB parquet uses suffix-style codes like 600519.SH, while internal PostgreSQL tables use prefix-style like SH600519. Passing the wrong format silently returns empty results without errors, so convert codes with StockCodeUtil.to_suffix first.

What is the difference between quantdb and quantcustom directories?

quantdb holds official read-only market data, while quantcustom is the write area for user-generated outputs such as mined factors from RD-Agent or the factor factory. Both share the same six-category structure, but writes must never go into quantdb.

Where is QuantDB data located on the server and in containers?

On the production host the data lives at /opt/quantmind/data/quantdb, which is bind-mounted into containers as /data/quantdb. The directory resolution also checks the QM_QUANTDB_DATA_DIR environment variable and several fallback paths.