{
  "type": "record",
  "Aspect": {
    "name": "semanticFieldAnnotation",
    "schemaVersion": 2
  },
  "name": "SemanticFieldAnnotation",
  "namespace": "com.linkedin.pegasus2avro.semanticmodel",
  "fields": [
    {
      "type": {
        "type": "enum",
        "symbolDocs": {
          "DIMENSION": " A grouping or filtering attribute \u2014 maps to a \"dimension\" in the semantic layer. ",
          "FILTER": " A named boolean predicate used to filter results, distinct from a dimension. ",
          "MEASURE": " An aggregatable numeric value \u2014 maps to a \"measure\" or \"fact\" in the semantic layer. ",
          "OTHER": " A field kind not yet represented as a named symbol. "
        },
        "name": "SemanticFieldType",
        "namespace": "com.linkedin.pegasus2avro.semanticmodel",
        "symbols": [
          "DIMENSION",
          "MEASURE",
          "FILTER",
          "OTHER"
        ],
        "doc": "Discriminator enum that identifies the kind of a SchemaField's SemanticFieldAnnotation\ninside a SemanticModel dataset."
      },
      "name": "type",
      "doc": "The kind of this field. Must be set for every annotated field; determines how downstream\ntools interpret the field and whether kind-specific sub-records (e.g. `dimension`) are\nrelevant."
    },
    {
      "type": {
        "type": "record",
        "name": "MetricExpression",
        "namespace": "com.linkedin.pegasus2avro.metric",
        "fields": [
          {
            "type": {
              "type": "array",
              "items": {
                "type": "record",
                "name": "DialectExpression",
                "namespace": "com.linkedin.pegasus2avro.metric",
                "fields": [
                  {
                    "type": {
                      "type": "enum",
                      "symbolDocs": {
                        "ANSI_SQL": " Standard SQL dialect. ",
                        "DATABRICKS": " Databricks SQL. ",
                        "MAQL": " GoodData MAQL (Metric Analysis and Query Language). ",
                        "MDX": " Multi-Dimensional Expressions (OLAP cubes). ",
                        "OTHER": "A dialect not yet represented as a named symbol.",
                        "SNOWFLAKE": " Snowflake SQL. ",
                        "TABLEAU": " Tableau calculations. "
                      },
                      "name": "Dialect",
                      "namespace": "com.linkedin.pegasus2avro.metric",
                      "symbols": [
                        "ANSI_SQL",
                        "SNOWFLAKE",
                        "MDX",
                        "TABLEAU",
                        "DATABRICKS",
                        "MAQL",
                        "OTHER"
                      ],
                      "doc": "The SQL or expression-language dialect that produced a metric expression.\nValue set is aligned 1:1 with the OSI (Open Semantic Interchange) spec."
                    },
                    "name": "dialect",
                    "doc": "The dialect in which this expression is written."
                  },
                  {
                    "type": "string",
                    "name": "expression",
                    "doc": "The raw expression string."
                  }
                ],
                "doc": "A metric expression in a specific SQL dialect or semantic layer language."
              }
            },
            "name": "dialects",
            "doc": "The expression in one or more dialects."
          }
        ],
        "doc": "A metric's logical expression represented across one or more SQL dialects"
      },
      "name": "expression",
      "doc": "The SQL expression that computes this field, in one or more dialects."
    },
    {
      "type": [
        "null",
        "string"
      ],
      "name": "aggregationFunction",
      "default": null,
      "doc": "The aggregation function applied to this field when used as a measure\n(e.g. \"SUM\", \"COUNT_DISTINCT\", \"AVG\"). Populated when `type == MEASURE`; ignored otherwise."
    },
    {
      "type": [
        "null",
        {
          "type": "record",
          "name": "Dimension",
          "namespace": "com.linkedin.pegasus2avro.semanticmodel",
          "fields": [
            {
              "type": "boolean",
              "name": "isTime",
              "default": false,
              "doc": "Whether this dimension represents a time axis."
            }
          ],
          "doc": "Marks a field as a time dimension within a semantic model dataset.\n\nNOTE: this record is intentionally minimal, can add more as per needs. "
        }
      ],
      "name": "dimension",
      "default": null,
      "doc": "Dimension-specific metadata. Populated when `type == DIMENSION`; ignored otherwise."
    }
  ],
  "doc": "Semantic metadata for a `schemaField` entity that is exposed by a SemanticModel dataset\n(a `dataset` with subtype `Semantic Model Dataset`). Layers dimension/measure/filter classification,\nthe computing expression, and an optional aggregation function on top of the field's\nstandard structural identity (fieldPath, type, description) and governance surface\n(tags, glossary terms), which live on the `schemaField` entity itself."
}