{
  "data": {
    "basis": "RECOMPILED",
    "compilationTrace": {
      "events": [
        {
          "confidence": "EXACT",
          "decision": "NORMALIZED",
          "details": {
            "requestedFieldCount": 3
          },
          "event": "SEMANTIC_DSL_NORMALIZED",
          "observedAt": "2026-10-20T05:19:57.273910900Z",
          "reasonCode": "DSL_NORMALIZED",
          "sequence": 1,
          "stage": "NORMALIZATION",
          "status": "EVALUATED"
        },
        {
          "confidence": "EXACT",
          "decision": "RAW",
          "details": {},
          "event": "PRE_AGGREGATION_ROUTING",
          "observedAt": "2026-10-20T05:19:57.275421400Z",
          "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:19:57.275421400Z",
          "reasonCode": "PREAGG_NOT_CONFIGURED",
          "sequence": 3,
          "stage": "SQL",
          "status": "EVALUATED"
        }
      ],
      "fieldResolution": [
        {
          "confidence": "OBSERVED",
          "requested": "totalAmount",
          "resolved": "totalAmount"
        },
        {
          "confidence": "OBSERVED",
          "requested": "lineCount",
          "resolved": "lineCount"
        },
        {
          "confidence": "OBSERVED",
          "requested": "quantity",
          "resolved": "quantity"
        }
      ],
      "normalizedConditions": [
        {
          "confidence": "EXACT",
          "field": "invoice$invoiceDate",
          "operator": "[)",
          "origin": "USER_SLICE",
          "path": "slice[0]",
          "redactedValue": "***",
          "valueType": "LIST<String>"
        }
      ],
      "normalizedDsl": {
        "autoFixDimCaption": false,
        "autoGroupBy": true,
        "calculatedFields": [
          {
            "agg": "SUM",
            "expression": "sum(lineAmount)",
            "name": "totalAmount"
          },
          {
            "agg": "COUNT",
            "expression": "count(invoiceLineId)",
            "name": "lineCount"
          },
          {
            "agg": "SUM",
            "expression": "sum(salesQuantity)",
            "name": "quantity"
          }
        ],
        "columns": [
          "totalAmount",
          "lineCount",
          "quantity"
        ],
        "distinct": false,
        "groupBy": [
          {
            "agg": "SUM",
            "field": "totalAmount"
          },
          {
            "agg": "COUNT",
            "field": "lineCount"
          },
          {
            "agg": "SUM",
            "field": "quantity"
          }
        ],
        "optimizeAggSqlEnabled": true,
        "postAggregateCalculations": [],
        "queryModel": "ChinookInvoiceLineQueryModel",
        "returnTotal": false,
        "slice": [
          {
            "$and": [],
            "$or": [],
            "field": "invoice$invoiceDate",
            "maxDepth": 0,
            "op": "[)",
            "value": "***"
          }
        ],
        "strictColumns": true,
        "withSubtotals": false
      },
      "originalDsl": {
        "captionMatchMode": "EXACT",
        "columns": [
          "sum(lineAmount) as totalAmount",
          "count(invoiceLineId) as lineCount",
          "sum(salesQuantity) as quantity"
        ],
        "distinct": false,
        "limit": 2,
        "mismatchHandleStrategy": "ABORT",
        "pivotMode": false,
        "returnTotal": false,
        "slice": [
          {
            "field": "invoice$invoiceDate",
            "op": "[)",
            "value": "***"
          }
        ],
        "start": 0,
        "withSubtotals": false
      },
      "stagePlan": {
        "dialect": "sqlite",
        "fallbacks": [],
        "preAggOptimizationPolicy": "optimizer-allowed",
        "renderStrategy": "single",
        "returnTotalStrategy": "disabled",
        "stages": [
          {
            "filterAliases": [
              "invoice$invoiceDate"
            ],
            "id": "row",
            "inputAliases": [],
            "orderAliases": [],
            "outputAliases": [
              "invoice$invoiceDate",
              "totalAmount",
              "lineCount",
              "quantity"
            ],
            "parameterCount": 2,
            "requiresSqlBoundary": false,
            "sqlAlias": "base",
            "type": "ROW_STAGE"
          },
          {
            "filterAliases": [],
            "id": "agg",
            "inputAliases": [
              "invoice$invoiceDate",
              "totalAmount",
              "lineCount",
              "quantity"
            ],
            "orderAliases": [],
            "outputAliases": [
              "totalAmount",
              "lineCount",
              "quantity"
            ],
            "parameterCount": 0,
            "requiresSqlBoundary": false,
            "sqlAlias": "base",
            "type": "AGGREGATE_STAGE"
          },
          {
            "filterAliases": [],
            "id": "final",
            "inputAliases": [
              "totalAmount",
              "lineCount",
              "quantity"
            ],
            "orderAliases": [],
            "outputAliases": [
              "totalAmount",
              "lineCount",
              "quantity"
            ],
            "parameterCount": 0,
            "requiresSqlBoundary": false,
            "sqlAlias": "final",
            "type": "FINAL_STAGE"
          }
        ],
        "unsupported": [],
        "version": "v1"
      }
    },
    "definitionTrace": {
      "fields": [
        {
          "dataType": "INTEGER",
          "fieldType": "property",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceLineQueryModel.invoiceLineId",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "ChinookInvoiceLineModel.invoiceLineId"
            },
            {
              "column": "InvoiceLineId",
              "confidence": "EXACT",
              "from": "ChinookInvoiceLineModel.invoiceLineId",
              "reasonCode": "TABLE_COLUMN_MODEL_STRUCTURE",
              "relation": "InvoiceLine",
              "to": "InvoiceLine.InvoiceLineId"
            }
          ],
          "queryField": "ChinookInvoiceLineQueryModel.invoiceLineId",
          "references": [],
          "tableField": "invoiceLineId",
          "tableModel": "ChinookInvoiceLineModel"
        },
        {
          "dataType": "INTEGER",
          "fieldType": "property",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceLineQueryModel.invoiceId",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "ChinookInvoiceLineModel.invoiceId"
            },
            {
              "column": "InvoiceId",
              "confidence": "EXACT",
              "from": "ChinookInvoiceLineModel.invoiceId",
              "reasonCode": "TABLE_COLUMN_MODEL_STRUCTURE",
              "relation": "InvoiceLine",
              "to": "InvoiceLine.InvoiceId"
            }
          ],
          "queryField": "ChinookInvoiceLineQueryModel.invoiceId",
          "references": [],
          "tableField": "invoiceId",
          "tableModel": "ChinookInvoiceLineModel"
        },
        {
          "dataType": "INTEGER",
          "fieldType": "property",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceLineQueryModel.trackId",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "ChinookInvoiceLineModel.trackId"
            },
            {
              "column": "TrackId",
              "confidence": "EXACT",
              "from": "ChinookInvoiceLineModel.trackId",
              "reasonCode": "TABLE_COLUMN_MODEL_STRUCTURE",
              "relation": "InvoiceLine",
              "to": "InvoiceLine.TrackId"
            }
          ],
          "queryField": "ChinookInvoiceLineQueryModel.trackId",
          "references": [],
          "tableField": "trackId",
          "tableModel": "ChinookInvoiceLineModel"
        },
        {
          "dataType": "MONEY",
          "fieldType": "property",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceLineQueryModel.unitPrice",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "ChinookInvoiceLineModel.unitPrice"
            },
            {
              "column": "UnitPrice",
              "confidence": "EXACT",
              "from": "ChinookInvoiceLineModel.unitPrice",
              "reasonCode": "TABLE_COLUMN_MODEL_STRUCTURE",
              "relation": "InvoiceLine",
              "to": "InvoiceLine.UnitPrice"
            }
          ],
          "queryField": "ChinookInvoiceLineQueryModel.unitPrice",
          "references": [],
          "tableField": "unitPrice",
          "tableModel": "ChinookInvoiceLineModel"
        },
        {
          "dataType": "DATETIME",
          "fieldType": "property",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceLineQueryModel.invoice$invoiceDate",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "unresolved-tm.invoice$id"
            },
            {
              "column": "InvoiceDate",
              "confidence": "EXACT",
              "from": "unresolved-tm.invoice$id",
              "reasonCode": "TABLE_COLUMN_MODEL_STRUCTURE",
              "relation": "Invoice",
              "to": "Invoice.InvoiceDate"
            }
          ],
          "queryField": "ChinookInvoiceLineQueryModel.invoice$invoiceDate",
          "references": [],
          "tableField": "invoice$id"
        },
        {
          "dataType": "STRING",
          "fieldType": "property",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceLineQueryModel.invoice$billingCountry",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "unresolved-tm.invoice$id"
            },
            {
              "column": "BillingCountry",
              "confidence": "EXACT",
              "from": "unresolved-tm.invoice$id",
              "reasonCode": "TABLE_COLUMN_MODEL_STRUCTURE",
              "relation": "Invoice",
              "to": "Invoice.BillingCountry"
            }
          ],
          "queryField": "ChinookInvoiceLineQueryModel.invoice$billingCountry",
          "references": [],
          "tableField": "invoice$id"
        },
        {
          "dataType": "INTEGER",
          "fieldType": "property",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceLineQueryModel.invoice$customerId",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "unresolved-tm.invoice$id"
            },
            {
              "column": "CustomerId",
              "confidence": "EXACT",
              "from": "unresolved-tm.invoice$id",
              "reasonCode": "TABLE_COLUMN_MODEL_STRUCTURE",
              "relation": "Invoice",
              "to": "Invoice.CustomerId"
            }
          ],
          "queryField": "ChinookInvoiceLineQueryModel.invoice$customerId",
          "references": [],
          "tableField": "invoice$id"
        },
        {
          "dataType": "STRING",
          "fieldType": "property",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceLineQueryModel.invoice_customer$fullName",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "unresolved-tm.customer$id"
            },
            {
              "column": "FirstName",
              "confidence": "EXACT",
              "from": "unresolved-tm.customer$id",
              "reasonCode": "TABLE_COLUMN_MODEL_STRUCTURE",
              "relation": "Customer",
              "to": "Customer.FirstName"
            }
          ],
          "queryField": "ChinookInvoiceLineQueryModel.invoice_customer$fullName",
          "references": [],
          "tableField": "customer$id"
        },
        {
          "dataType": "STRING",
          "fieldType": "property",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceLineQueryModel.track$title",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "unresolved-tm.track$id"
            },
            {
              "column": "Name",
              "confidence": "EXACT",
              "from": "unresolved-tm.track$id",
              "reasonCode": "TABLE_COLUMN_MODEL_STRUCTURE",
              "relation": "Track",
              "to": "Track.Name"
            }
          ],
          "queryField": "ChinookInvoiceLineQueryModel.track$title",
          "references": [],
          "tableField": "track$id"
        },
        {
          "dataType": "INTEGER",
          "fieldType": "property",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceLineQueryModel.track_genre$genreId",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "unresolved-tm.genre$id"
            },
            {
              "column": "GenreId",
              "confidence": "EXACT",
              "from": "unresolved-tm.genre$id",
              "reasonCode": "TABLE_COLUMN_MODEL_STRUCTURE",
              "relation": "Genre",
              "to": "Genre.GenreId"
            }
          ],
          "queryField": "ChinookInvoiceLineQueryModel.track_genre$genreId",
          "references": [],
          "tableField": "genre$id"
        },
        {
          "dataType": "STRING",
          "fieldType": "property",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceLineQueryModel.track_genre$genreName",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "unresolved-tm.genre$id"
            },
            {
              "column": "Name",
              "confidence": "EXACT",
              "from": "unresolved-tm.genre$id",
              "reasonCode": "TABLE_COLUMN_MODEL_STRUCTURE",
              "relation": "Genre",
              "to": "Genre.Name"
            }
          ],
          "queryField": "ChinookInvoiceLineQueryModel.track_genre$genreName",
          "references": [],
          "tableField": "genre$id"
        },
        {
          "dataType": "MONEY",
          "fieldType": "measure",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceLineQueryModel.lineAmount",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "ChinookInvoiceLineModel.lineAmount"
            },
            {
              "confidence": "OPAQUE",
              "from": "ChinookInvoiceLineModel.lineAmount",
              "reasonCode": "FORMULA_BUILDER_OPAQUE",
              "to": "<opaque-formula-builder>"
            },
            {
              "confidence": "OPAQUE",
              "from": "<opaque-formula-builder>",
              "reasonCode": "FORMULA_BUILDER_SOURCE_OPAQUE",
              "to": "<opaque-formula-source>"
            }
          ],
          "queryField": "ChinookInvoiceLineQueryModel.lineAmount",
          "references": [],
          "tableField": "lineAmount",
          "tableModel": "ChinookInvoiceLineModel"
        },
        {
          "aggregationFormula": "SUM(Quantity)",
          "dataType": "INTEGER",
          "fieldType": "measure",
          "lineage": [
            {
              "confidence": "EXACT",
              "from": "ChinookInvoiceLineQueryModel.salesQuantity",
              "reasonCode": "QM_TO_TM_MODEL_STRUCTURE",
              "to": "ChinookInvoiceLineModel.salesQuantity"
            },
            {
              "confidence": "EXACT",
              "expression": "SUM(Quantity)",
              "from": "ChinookInvoiceLineModel.salesQuantity",
              "reasonCode": "AGGREGATION_MODEL_STRUCTURE",
              "to": "SUM(Quantity)"
            },
            {
              "column": "Quantity",
              "confidence": "EXACT",
              "from": "ChinookInvoiceLineModel.salesQuantity",
              "reasonCode": "TABLE_COLUMN_MODEL_STRUCTURE",
              "relation": "InvoiceLine",
              "to": "InvoiceLine.Quantity"
            }
          ],
          "queryField": "ChinookInvoiceLineQueryModel.salesQuantity",
          "references": [],
          "tableField": "salesQuantity",
          "tableModel": "ChinookInvoiceLineModel"
        }
      ],
      "joins": [
        {
          "confidence": "EXACT",
          "foreignKey": "InvoiceId",
          "fromModel": "ChinookInvoiceLineModel",
          "joinType": "LEFT",
          "reasonCode": "JOIN_FOREIGN_KEY_MODEL_STRUCTURE"
        },
        {
          "confidence": "EXACT",
          "foreignKey": "TrackId",
          "fromModel": "ChinookInvoiceLineModel",
          "joinType": "LEFT",
          "reasonCode": "JOIN_FOREIGN_KEY_MODEL_STRUCTURE"
        },
        {
          "confidence": "EXACT",
          "foreignKey": "CustomerId",
          "joinType": "LEFT",
          "reasonCode": "JOIN_FOREIGN_KEY_MODEL_STRUCTURE"
        },
        {
          "confidence": "EXACT",
          "foreignKey": "GenreId",
          "joinType": "LEFT",
          "reasonCode": "JOIN_FOREIGN_KEY_MODEL_STRUCTURE"
        }
      ],
      "model": {
        "dependencies": [
          {
            "kind": "TABLE",
            "name": "ChinookInvoiceLineModel"
          }
        ],
        "kind": "QUERY",
        "name": "ChinookInvoiceLineQueryModel",
        "namespace": "chinook",
        "revision": "source:1ce0e063-902b-4150-ab27-d627a42e531b:g0:n1",
        "source": "chinook-teaching:练习目录\\lab\\models\\query\\ChinookInvoiceLineQueryModel.qm"
      },
      "queryModel": "ChinookInvoiceLineQueryModel"
    },
    "executionTrace": {
      "jdbc": "NOT_EVALUATED",
      "l1Cache": "NOT_EVALUATED",
      "l2Cache": "NOT_EVALUATED",
      "route": "NOT_EVALUATED"
    },
    "limitations": [
      {
        "code": "FORMULA_BUILDER_OPAQUE",
        "confidence": "OPAQUE",
        "message": "An arbitrary formulaDef.builder participated; its source code and undeclared physical lineage were not inspected or exposed."
      },
      {
        "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."
      }
    ],
    "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": "invoice$invoiceDate",
          "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": true,
      "finalPhysicalSql": "select\tSUM(t1.UnitPrice * t1.Quantity) \"totalAmount\",\tCOUNT(t1.InvoiceLineId) \"lineCount\",\tSUM(t1.Quantity) \"quantity\"\tfrom InvoiceLine t1\t left join Invoice d1  on t1.InvoiceId=d1.InvoiceId where  1=1  and \td1.InvoiceDate >=?  and \td1.InvoiceDate <? ",
      "logicalSql": "select\tSUM(t1.UnitPrice * t1.Quantity) \"totalAmount\",\tCOUNT(t1.InvoiceLineId) \"lineCount\",\tSUM(t1.Quantity) \"quantity\"\tfrom InvoiceLine t1\t left join Invoice d1  on t1.InvoiceId=d1.InvoiceId where  1=1  and \td1.InvoiceDate >=?  and \td1.InvoiceDate <? ",
      "parameters": [
        {
          "confidence": "OBSERVED",
          "index": 1,
          "origin": "USER_SLICE",
          "redactedValue": "***",
          "valueType": "String"
        },
        {
          "confidence": "OBSERVED",
          "index": 2,
          "origin": "USER_SLICE",
          "redactedValue": "***",
          "valueType": "String"
        }
      ],
      "reasonCode": "SQL_CAPTURED_FROM_QUERY_EXECUTION_CONTEXT",
      "sourceOfTruth": "QueryExecutionContext.sql"
    }
  },
  "diagnostics": {
    "attributes": {},
    "warnings": []
  },
  "engine": "java",
  "runtimeApiVersion": "foggy-runtime-api/v1",
  "success": true
}
