{
  "data": {
    "basis": "RECOMPILED",
    "compilationTrace": {
      "events": [
        {
          "confidence": "EXACT",
          "decision": "NORMALIZED",
          "details": {
            "requestedFieldCount": 3
          },
          "event": "SEMANTIC_DSL_NORMALIZED",
          "observedAt": "2026-10-20T05:18:50.027774300Z",
          "reasonCode": "DSL_NORMALIZED",
          "sequence": 1,
          "stage": "NORMALIZATION",
          "status": "EVALUATED"
        },
        {
          "confidence": "EXACT",
          "decision": "RAW",
          "details": {},
          "event": "PRE_AGGREGATION_ROUTING",
          "observedAt": "2026-10-20T05:18:50.031931400Z",
          "reasonCode": "PREAGG_NOT_CONFIGURED",
          "sequence": 2,
          "stage": "MATERIALIZATION",
          "status": "EVALUATED"
        },
        {
          "confidence": "OBSERVED",
          "decision": "RAW",
          "details": {
            "parameterCount": 2,
            "preAggApplied": false,
            "sourceOfTruth": "QueryExecutionContext.sql",
            "sqlChanged": false
          },
          "event": "FINAL_QUERY_EXECUTION_CONTEXT_CAPTURED",
          "observedAt": "2026-10-20T05:18:50.032939900Z",
          "reasonCode": "PREAGG_NOT_CONFIGURED",
          "sequence": 3,
          "stage": "SQL",
          "status": "EVALUATED"
        }
      ],
      "fieldResolution": [
        {
          "confidence": "EXACT",
          "requested": "invoiceDate$yearMonth",
          "resolved": "invoiceDate$yearMonth",
          "tableField": "invoiceDate$id",
          "tableModel": "ChinookInvoiceTimeModel"
        },
        {
          "confidence": "OBSERVED",
          "requested": "totalAmount",
          "resolved": "totalAmount"
        },
        {
          "confidence": "OBSERVED",
          "requested": "billCount",
          "resolved": "billCount"
        }
      ],
      "normalizedConditions": [
        {
          "confidence": "EXACT",
          "field": "invoiceDate$id",
          "operator": "[)",
          "origin": "USER_SLICE",
          "path": "slice[0]",
          "redactedValue": "***",
          "valueType": "LIST<String>"
        }
      ],
      "normalizedDsl": {
        "autoFixDimCaption": false,
        "autoGroupBy": true,
        "calculatedFields": [
          {
            "agg": "SUM",
            "expression": "sum(invoiceAmount)",
            "name": "totalAmount"
          },
          {
            "agg": "COUNT",
            "expression": "count(invoiceId)",
            "name": "billCount"
          }
        ],
        "columns": [
          "invoiceDate$yearMonth",
          "totalAmount",
          "billCount"
        ],
        "distinct": false,
        "groupBy": [
          {
            "agg": "null",
            "field": "invoiceDate$yearMonth"
          },
          {
            "agg": "SUM",
            "field": "totalAmount"
          },
          {
            "agg": "COUNT",
            "field": "billCount"
          }
        ],
        "optimizeAggSqlEnabled": true,
        "orderBy": [
          {
            "dir": "asc",
            "field": "invoiceDate$yearMonth",
            "nullFirst": false,
            "nullLast": false
          }
        ],
        "postAggregateCalculations": [],
        "queryModel": "ChinookInvoiceTimeQueryModel",
        "returnTotal": false,
        "slice": [
          {
            "$and": [],
            "$or": [],
            "field": "invoiceDate$id",
            "maxDepth": 0,
            "op": "[)",
            "value": "***"
          }
        ],
        "strictColumns": true,
        "withSubtotals": false
      },
      "originalDsl": {
        "captionMatchMode": "EXACT",
        "columns": [
          "invoiceDate$yearMonth",
          "sum(invoiceAmount) as totalAmount",
          "count(invoiceId) as billCount"
        ],
        "distinct": false,
        "groupBy": [
          {
            "field": "invoiceDate$yearMonth"
          }
        ],
        "limit": 100,
        "mismatchHandleStrategy": "ABORT",
        "orderBy": [
          {
            "dir": "asc",
            "field": "invoiceDate$yearMonth",
            "nullFirst": false,
            "nullLast": false
          }
        ],
        "pivotMode": false,
        "returnTotal": false,
        "slice": [
          {
            "field": "invoiceDate$id",
            "op": "[)",
            "value": "***"
          }
        ],
        "start": 0,
        "withSubtotals": false
      },
      "stagePlan": {
        "dialect": "sqlite",
        "fallbacks": [],
        "preAggOptimizationPolicy": "optimizer-allowed",
        "renderStrategy": "single",
        "returnTotalStrategy": "disabled",
        "stages": [
          {
            "filterAliases": [
              "invoiceDate$id"
            ],
            "id": "row",
            "inputAliases": [],
            "orderAliases": [],
            "outputAliases": [
              "invoiceDate$id",
              "invoiceDate$yearMonth",
              "totalAmount",
              "billCount"
            ],
            "parameterCount": 2,
            "requiresSqlBoundary": false,
            "sqlAlias": "base",
            "type": "ROW_STAGE"
          },
          {
            "filterAliases": [],
            "id": "agg",
            "inputAliases": [
              "invoiceDate$id",
              "invoiceDate$yearMonth",
              "totalAmount",
              "billCount"
            ],
            "orderAliases": [],
            "outputAliases": [
              "invoiceDate$yearMonth",
              "totalAmount",
              "billCount"
            ],
            "parameterCount": 0,
            "requiresSqlBoundary": false,
            "sqlAlias": "base",
            "type": "AGGREGATE_STAGE"
          },
          {
            "filterAliases": [],
            "id": "final",
            "inputAliases": [
              "invoiceDate$yearMonth",
              "totalAmount",
              "billCount"
            ],
            "orderAliases": [
              "invoiceDate$yearMonth"
            ],
            "outputAliases": [
              "invoiceDate$yearMonth",
              "totalAmount",
              "billCount"
            ],
            "parameterCount": 0,
            "requiresSqlBoundary": false,
            "sqlAlias": "final",
            "type": "FINAL_STAGE"
          }
        ],
        "unsupported": [],
        "version": "v1"
      }
    },
    "definitionTrace": {
      "fields": [
        {
          "dataType": "INTEGER",
          "fieldType": "property",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceTimeQueryModel.invoiceId",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "ChinookInvoiceTimeModel.invoiceId"
            },
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceTimeModel.invoiceId",
              "reasonCode": "PHYSICAL_NAME_REDACTED",
              "to": "<physical-source-redacted>"
            }
          ],
          "queryField": "ChinookInvoiceTimeQueryModel.invoiceId",
          "references": [],
          "tableField": "invoiceId",
          "tableModel": "ChinookInvoiceTimeModel"
        },
        {
          "dataType": "DAY",
          "fieldType": "dimension",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceTimeQueryModel.invoiceDate$id",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "ChinookInvoiceTimeModel.invoiceDate$id"
            },
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceTimeModel.invoiceDate$id",
              "reasonCode": "PHYSICAL_NAME_REDACTED",
              "to": "<physical-source-redacted>"
            }
          ],
          "queryField": "ChinookInvoiceTimeQueryModel.invoiceDate$id",
          "references": [],
          "tableField": "invoiceDate$id",
          "tableModel": "ChinookInvoiceTimeModel"
        },
        {
          "dataType": "DAY",
          "fieldType": "dimension",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceTimeQueryModel.invoiceDate$caption",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "ChinookInvoiceTimeModel.invoiceDate$caption"
            },
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceTimeModel.invoiceDate$caption",
              "reasonCode": "PHYSICAL_NAME_REDACTED",
              "to": "<physical-source-redacted>"
            }
          ],
          "queryField": "ChinookInvoiceTimeQueryModel.invoiceDate$caption",
          "references": [],
          "tableField": "invoiceDate$caption",
          "tableModel": "ChinookInvoiceTimeModel"
        },
        {
          "dataType": "DAY",
          "fieldType": "dimension",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceTimeQueryModel.invoiceDate",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "ChinookInvoiceTimeModel.invoiceDate$caption"
            },
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceTimeModel.invoiceDate$caption",
              "reasonCode": "PHYSICAL_NAME_REDACTED",
              "to": "<physical-source-redacted>"
            }
          ],
          "queryField": "ChinookInvoiceTimeQueryModel.invoiceDate",
          "references": [],
          "tableField": "invoiceDate$caption",
          "tableModel": "ChinookInvoiceTimeModel"
        },
        {
          "dataType": "INTEGER",
          "fieldType": "property",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceTimeQueryModel.invoiceDate$year",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "ChinookInvoiceTimeModel.invoiceDate$id"
            },
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceTimeModel.invoiceDate$id",
              "reasonCode": "PHYSICAL_NAME_REDACTED",
              "to": "<physical-source-redacted>"
            }
          ],
          "queryField": "ChinookInvoiceTimeQueryModel.invoiceDate$year",
          "references": [],
          "tableField": "invoiceDate$id",
          "tableModel": "ChinookInvoiceTimeModel"
        },
        {
          "dataType": "INTEGER",
          "fieldType": "property",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceTimeQueryModel.invoiceDate$month",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "ChinookInvoiceTimeModel.invoiceDate$id"
            },
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceTimeModel.invoiceDate$id",
              "reasonCode": "PHYSICAL_NAME_REDACTED",
              "to": "<physical-source-redacted>"
            }
          ],
          "queryField": "ChinookInvoiceTimeQueryModel.invoiceDate$month",
          "references": [],
          "tableField": "invoiceDate$id",
          "tableModel": "ChinookInvoiceTimeModel"
        },
        {
          "dataType": "STRING",
          "fieldType": "property",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceTimeQueryModel.invoiceDate$yearMonth",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "ChinookInvoiceTimeModel.invoiceDate$id"
            },
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceTimeModel.invoiceDate$id",
              "reasonCode": "PHYSICAL_NAME_REDACTED",
              "to": "<physical-source-redacted>"
            }
          ],
          "queryField": "ChinookInvoiceTimeQueryModel.invoiceDate$yearMonth",
          "references": [],
          "tableField": "invoiceDate$id",
          "tableModel": "ChinookInvoiceTimeModel"
        },
        {
          "aggregationFormula": "SUM(Total)",
          "dataType": "MONEY",
          "fieldType": "measure",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceTimeQueryModel.invoiceAmount",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "ChinookInvoiceTimeModel.invoiceAmount"
            },
            {
              "confidence": "EXACT",
              "expression": "SUM(Total)",
              "from": "ChinookInvoiceTimeModel.invoiceAmount",
              "reasonCode": "AGGREGATION_MODEL_STRUCTURE",
              "to": "SUM(Total)"
            },
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceTimeModel.invoiceAmount",
              "reasonCode": "PHYSICAL_NAME_REDACTED",
              "to": "<physical-source-redacted>"
            }
          ],
          "queryField": "ChinookInvoiceTimeQueryModel.invoiceAmount",
          "references": [],
          "tableField": "invoiceAmount",
          "tableModel": "ChinookInvoiceTimeModel"
        },
        {
          "aggregationFormula": "COUNT(InvoiceId)",
          "dataType": "INTEGER",
          "fieldType": "measure",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceTimeQueryModel.invoiceCount",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "ChinookInvoiceTimeModel.invoiceCount"
            },
            {
              "confidence": "EXACT",
              "expression": "COUNT(InvoiceId)",
              "from": "ChinookInvoiceTimeModel.invoiceCount",
              "reasonCode": "AGGREGATION_MODEL_STRUCTURE",
              "to": "COUNT(InvoiceId)"
            },
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceTimeModel.invoiceCount",
              "reasonCode": "PHYSICAL_NAME_REDACTED",
              "to": "<physical-source-redacted>"
            }
          ],
          "queryField": "ChinookInvoiceTimeQueryModel.invoiceCount",
          "references": [],
          "tableField": "invoiceCount",
          "tableModel": "ChinookInvoiceTimeModel"
        }
      ],
      "joins": [],
      "model": {
        "dependencies": [
          {
            "kind": "TABLE",
            "name": "ChinookInvoiceTimeModel"
          }
        ],
        "kind": "QUERY",
        "name": "ChinookInvoiceTimeQueryModel",
        "namespace": "chinook",
        "revision": "source:1ce0e063-902b-4150-ab27-d627a42e531b:g0:n1",
        "source": "chinook-teaching:练习目录\\lab\\models\\query\\ChinookInvoiceTimeQueryModel.qm"
      },
      "queryModel": "ChinookInvoiceTimeQueryModel"
    },
    "executionTrace": {
      "jdbc": "NOT_EVALUATED",
      "l1Cache": "NOT_EVALUATED",
      "l2Cache": "NOT_EVALUATED",
      "route": "NOT_EVALUATED"
    },
    "limitations": [
      {
        "code": "RECOMPILED_NOT_EXECUTED_TRACE",
        "confidence": "EXACT",
        "message": "This evidence was produced by a fresh governed compilation. It is not the historical trace of an earlier execution."
      },
      {
        "code": "PHYSICAL_SQL_REDACTED",
        "confidence": "EXACT",
        "message": "Physical SQL was withheld because includePhysicalNames is false; Foggy does not guess at safe SQL token redaction."
      }
    ],
    "materializationTrace": {
      "decision": "SOURCE_QUERY_RETAINED",
      "definitions": [],
      "reasonCode": "PREAGG_NOT_CONFIGURED",
      "route": "RAW",
      "status": "EVALUATED"
    },
    "schemaVersion": "foggy-semantic-explain/v1",
    "securityTrace": {
      "affectedFields": [],
      "affectsFieldVisibility": false,
      "affectsJoin": false,
      "affectsPreAggregation": false,
      "conditions": [
        {
          "confidence": "EXACT",
          "field": "invoiceDate$id",
          "operator": "[)",
          "origin": "USER_SLICE",
          "path": "slice[0]",
          "redactedValue": "***",
          "valueType": "LIST<String>"
        }
      ],
      "effect": "ALLOW",
      "policyId": "PUBLIC",
      "policyVersion": "PUBLIC",
      "publicDecision": true,
      "status": "EVALUATED"
    },
    "sqlTrace": {
      "confidence": "OBSERVED",
      "exposed": false,
      "parameters": [
        {
          "confidence": "OBSERVED",
          "index": 1,
          "origin": "USER_SLICE",
          "redactedValue": "***",
          "valueType": "String"
        },
        {
          "confidence": "OBSERVED",
          "index": 2,
          "origin": "USER_SLICE",
          "redactedValue": "***",
          "valueType": "String"
        }
      ],
      "reasonCode": "PHYSICAL_NAMES_NOT_EXPOSED",
      "sourceOfTruth": "QueryExecutionContext.sql"
    }
  },
  "diagnostics": {
    "attributes": {},
    "warnings": []
  },
  "engine": "java",
  "runtimeApiVersion": "foggy-runtime-api/v1",
  "success": true
}
