Files
data-ge/demo/水务/水务-qwen3-coder-480b-snippet.json
2025-11-14 00:58:00 +08:00

235 lines
8.2 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[
{
"id": "snpt_water_meter_top_supply_office",
"desc": "统计各供水管理所下辖水表数量并排序",
"type": "topn",
"title": "供水管理所水表数量排行",
"examples": [
"列出水表最多的前10个供水管理所",
"各供水所水表数量排名"
],
"variables": [
{
"name": "top_n",
"type": "int",
"default": 10
}
],
"dialect_sql": {
"mysql": "SELECT supply_office AS dim_value, COUNT(*) AS metric_value FROM `data-ge.water_meter_info` GROUP BY supply_office ORDER BY metric_value DESC LIMIT {{top_n}}"
},
"applicability": {
"constraints": {
"notes": [],
"fk_join_available": false,
"dim_cardinality_hint": 11
},
"time_column": "nullable",
"required_columns": [
"supply_office"
]
},
"business_caliber": "按供水管理所维度聚合水表总数,粒度=供水管理所"
},
{
"id": "snpt_water_meter_top_station",
"desc": "统计各个站点下辖水表数量并排序",
"type": "topn",
"title": "站点水表数量排行",
"examples": [
"列出水表最多的前10个站点",
"各站点水表数量排名"
],
"variables": [
{
"name": "top_n",
"type": "int",
"default": 10
}
],
"dialect_sql": {
"mysql": "SELECT station AS dim_value, COUNT(*) AS metric_value FROM `data-ge.water_meter_info` GROUP BY station ORDER BY metric_value DESC LIMIT {{top_n}}"
},
"applicability": {
"constraints": {
"notes": [
"高基数维度建议LIMIT<=50"
],
"fk_join_available": false,
"dim_cardinality_hint": 36
},
"time_column": "nullable",
"required_columns": [
"station"
]
},
"business_caliber": "按站点维度聚合水表总数,粒度=站点"
},
{
"id": "snpt_water_meter_top_district",
"desc": "统计各区水表数量并排序",
"type": "topn",
"title": "区域水表数量排行",
"examples": [
"列出各区水表数量排名",
"哪个区的水表最多?"
],
"variables": [
{
"name": "top_n",
"type": "int",
"default": 10
}
],
"dialect_sql": {
"mysql": "SELECT district AS dim_value, COUNT(*) AS metric_value FROM `data-ge.water_meter_info` GROUP BY district ORDER BY metric_value DESC LIMIT {{top_n}}"
},
"applicability": {
"constraints": {
"notes": [],
"fk_join_available": false,
"dim_cardinality_hint": 13
},
"time_column": "nullable",
"required_columns": [
"district"
]
},
"business_caliber": "按行政区划维度聚合水表总数,粒度=区"
},
{
"id": "snpt_water_meter_share_by_type",
"desc": "计算各类水表占总水表的比例",
"type": "ratio",
"title": "水表类型占比分布",
"examples": [
"各类水表占比是多少?",
"哪种类型的水表使用最广泛?"
],
"variables": [],
"dialect_sql": {
"mysql": "SELECT meter_type AS dim_value, COUNT(*) * 100.0 / (SELECT COUNT(*) FROM `data-ge.water_meter_info`) AS ratio_percent FROM `data-ge.water_meter_info` GROUP BY meter_type ORDER BY ratio_percent DESC"
},
"applicability": {
"constraints": {
"notes": [],
"fk_join_available": false,
"dim_cardinality_hint": 5
},
"time_column": "nullable",
"required_columns": [
"meter_type"
]
},
"business_caliber": "按水表类型分类计算其占比,粒度=水表类型"
},
{
"id": "snpt_water_meter_subtype_distribution",
"desc": "展示不同水表子类型的数量及比例",
"type": "aggregate",
"title": "水表子类型分布情况",
"examples": [
"各种子类型水表的数量和占比",
"哪种子类型水表最多?"
],
"variables": [],
"dialect_sql": {
"mysql": "SELECT meter_subtype AS dim_value, COUNT(*) AS count_value, ROUND(COUNT(*) * 100.0 / (SELECT COUNT(*) FROM `data-ge.water_meter_info`), 2) AS percentage FROM `data-ge.water_meter_info` GROUP BY meter_subtype ORDER BY count_value DESC"
},
"applicability": {
"constraints": {
"notes": [],
"fk_join_available": false,
"dim_cardinality_hint": 9
},
"time_column": "nullable",
"required_columns": [
"meter_subtype"
]
},
"business_caliber": "按水表子类型进行计数和百分比统计,粒度=水表子类型"
},
{
"id": "snpt_water_meter_installation_position_stats",
"desc": "统计不同安装位置下的水表数量",
"type": "aggregate",
"title": "安装位置分布统计",
"examples": [
"各种安装位置的水表数量",
"哪种安装位置最为常见?"
],
"variables": [],
"dialect_sql": {
"mysql": "SELECT installation_position AS dim_value, COUNT(*) AS count_value FROM `data-ge.water_meter_info` GROUP BY installation_position ORDER BY count_value DESC"
},
"applicability": {
"constraints": {
"notes": [],
"fk_join_available": false,
"dim_cardinality_hint": 4
},
"time_column": "nullable",
"required_columns": [
"installation_position"
]
},
"business_caliber": "按安装位置对水表进行分组计数,粒度=安装位置"
},
{
"id": "snpt_water_meter_grain_check",
"desc": "验证 account_id 和 service_point_id 是否构成唯一组合",
"type": "quality",
"title": "主键粒度校验",
"examples": [
"这张表的数据粒度是否正确?",
"是否存在重复的服务点记录?"
],
"variables": [],
"dialect_sql": {
"mysql": "SELECT IF(COUNT(*) = COUNT(DISTINCT account_id, service_point_id), 'PASS', 'FAIL') AS grain_check_result FROM `data-ge.water_meter_info`"
},
"applicability": {
"constraints": {
"notes": [],
"fk_join_available": false,
"dim_cardinality_hint": null
},
"time_column": "nullable",
"required_columns": [
"account_id",
"service_point_id"
]
},
"business_caliber": "检验数据是否符合预期的主键粒度account_id + service_point_id"
},
{
"id": "snpt_water_meter_sample_records",
"desc": "随机抽取部分水表信息用于查看结构",
"type": "sample",
"title": "样本抽取",
"examples": [
"给我看几条水表数据的例子",
"抽查一些原始数据看看格式"
],
"variables": [
{
"name": "limit_rows",
"type": "int",
"default": 5
}
],
"dialect_sql": {
"mysql": "SELECT * FROM `data-ge.water_meter_info` ORDER BY RAND() LIMIT {{limit_rows}}"
},
"applicability": {
"constraints": {
"notes": [],
"fk_join_available": false,
"dim_cardinality_hint": null
},
"time_column": "nullable",
"required_columns": []
},
"business_caliber": "从全量数据中随机采样若干条记录供参考"
}
]