From ebd79b75bda174b5de8a0f6ea0e175a8863f9d0c Mon Sep 17 00:00:00 2001 From: zhaoawd Date: Mon, 8 Dec 2025 23:17:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E7=9F=A5=E8=AF=86=E7=94=9F?= =?UTF-8?q?=E6=88=90=E9=93=BE=E8=B7=AF=E8=8A=82=E7=82=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- file/tableschema/action_results.sql | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 file/tableschema/action_results.sql diff --git a/file/tableschema/action_results.sql b/file/tableschema/action_results.sql new file mode 100644 index 0000000..d09e6a1 --- /dev/null +++ b/file/tableschema/action_results.sql @@ -0,0 +1,40 @@ +CREATE TABLE `action_results` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键', + `table_id` bigint NOT NULL COMMENT '表ID', + `version_ts` bigint NOT NULL COMMENT '版本时间戳(版本号)', + `action_type` enum('ge_profiling','ge_result_desc','snippet','snippet_alias') COLLATE utf8mb4_bin NOT NULL COMMENT '动作类型', + `status` enum('pending','running','success','failed','partial') COLLATE utf8mb4_bin NOT NULL DEFAULT 'pending' COMMENT '执行状态', + `llm_usage` json DEFAULT NULL COMMENT 'LLM token usage统计', + `error_code` varchar(128) COLLATE utf8mb4_bin DEFAULT NULL, + `error_message` text COLLATE utf8mb4_bin, + `started_at` datetime DEFAULT NULL, + `finished_at` datetime DEFAULT NULL, + `duration_ms` int DEFAULT NULL, + `table_schema_version_id` varchar(19) COLLATE utf8mb4_bin NOT NULL, + `table_schema` json NOT NULL, + `ge_profiling_json` json DEFAULT NULL COMMENT 'Profiling完整结果JSON', + `ge_profiling_json_size_bytes` bigint DEFAULT NULL, + `ge_profiling_summary` json DEFAULT NULL COMMENT 'Profiling摘要(剔除大value_set等)', + `ge_profiling_summary_size_bytes` bigint DEFAULT NULL, + `ge_profiling_total_size_bytes` bigint DEFAULT NULL COMMENT '上两者合计', + `ge_profiling_html_report_url` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'GE报告HTML路径/URL', + `ge_result_desc_json` json DEFAULT NULL COMMENT '表描述结果JSON', + `ge_result_desc_json_size_bytes` bigint DEFAULT NULL, + `snippet_json` json DEFAULT NULL COMMENT 'SQL知识片段结果JSON', + `snippet_json_size_bytes` bigint DEFAULT NULL, + `snippet_alias_json` json DEFAULT NULL COMMENT 'SQL片段改写/丰富结果JSON', + `snippet_alias_json_size_bytes` bigint DEFAULT NULL, + `callback_url` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, + `result_checksum` varbinary(32) DEFAULT NULL COMMENT '对当前action有效载荷计算的MD5/xxhash', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `model` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '模型名称', + `model_provider` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '模型渠道', + `model_params` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '模型参数,如温度', + PRIMARY KEY (`id`), + UNIQUE KEY `uq_table_ver_action` (`table_id`,`version_ts`,`action_type`), + KEY `idx_status` (`status`), + KEY `idx_table` (`table_id`,`updated_at`), + KEY `idx_action_time` (`action_type`,`version_ts`), + KEY `idx_schema_version` (`table_schema_version_id`) +) ENGINE=InnoDB AUTO_INCREMENT=113 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='数据分析知识片段表'; \ No newline at end of file