A valid request URL is required to generate request examples{
"results": {
"errors": [
{
"message": "<string>",
"fieldIds": [
"<string>"
],
"sourceId": "<string>",
"kind": "too_few_sources"
}
],
"requiresCompose": true,
"fieldIdByColumn": {},
"usedParametersValues": {},
"parameterReferences": [
"<string>"
],
"fieldOrigins": {},
"itemsMap": {},
"fields": [
{
"sourceFieldId": "<string>",
"sourceId": "<string>",
"type": "<string>",
"kind": "dimension",
"label": "<string>",
"column": "<string>"
}
],
"columns": {
"valueColumnBySourceColumn": {},
"joinKeyColumns": [
"<string>"
]
},
"sorts": [
{
"descending": true,
"fieldId": "<string>",
"pivotValues": [
{
"value": "<string>",
"reference": "<string>"
}
],
"nullsFirst": true
}
],
"terminalWrapper": {
"sourceLimitExceededSql": "<string>",
"limit": 123,
"orderBy": [
"<string>"
]
},
"typedColumns": [
{
"origin": {
"sourceFieldId": "<string>",
"sourceId": "<string>",
"kind": "source"
},
"type": "string",
"reference": "<string>"
}
],
"coreSql": "<string>",
"legs": [
{
"metricQuery": {
"tableCalculations": [
{
"displayName": "<string>",
"name": "<string>",
"sql": "<string>",
"totalMode": "formula",
"type": "number",
"format": {
"type": "default",
"round": 123,
"separator": "default",
"currency": "<string>",
"compact": "auto",
"prefix": "<string>",
"suffix": "<string>",
"timeInterval": "RAW",
"custom": "<string>"
},
"index": 123
}
],
"limit": 123,
"sorts": [
{
"descending": true,
"fieldId": "<string>",
"pivotValues": [
{
"value": "<string>",
"reference": "<string>"
}
],
"nullsFirst": true
}
],
"filters": {
"tableCalculations": {
"or": [
{
"operator": "isNull",
"id": "<string>",
"target": {
"fieldId": "<string>"
},
"includeNull": true,
"values": [
"<unknown>"
],
"settings": "<unknown>",
"disabled": true,
"required": true,
"caseSensitive": true
}
],
"id": "<string>"
},
"metrics": {
"or": [
{
"operator": "isNull",
"id": "<string>",
"target": {
"fieldId": "<string>"
},
"includeNull": true,
"values": [
"<unknown>"
],
"settings": "<unknown>",
"disabled": true,
"required": true,
"caseSensitive": true
}
],
"id": "<string>"
},
"dimensions": {
"or": [
{
"operator": "isNull",
"id": "<string>",
"target": {
"fieldId": "<string>"
},
"includeNull": true,
"values": [
"<unknown>"
],
"settings": "<unknown>",
"disabled": true,
"required": true,
"caseSensitive": true
}
],
"id": "<string>"
}
},
"metrics": [
"<string>"
],
"dimensions": [
"<string>"
],
"exploreName": "<string>",
"metadata": {
"hasADateDimension": {
"name": "<string>",
"label": "<string>",
"table": "<string>"
}
},
"pivotDimensions": [
"<string>"
],
"timezone": "<string>",
"dimensionOverrides": {},
"metricOverrides": {},
"customDimensions": [
{
"id": "<string>",
"name": "<string>",
"table": "<string>",
"type": "bin",
"dimensionId": "<string>",
"binType": "fixed_number",
"binNumber": 123
}
],
"additionalMetrics": [
{
"type": "percentile",
"sql": "<string>",
"table": "<string>",
"name": "<string>",
"label": "<string>",
"description": "<string>",
"hidden": true,
"round": 123,
"compact": "auto",
"format": "km",
"separator": "default",
"index": 123,
"filters": [
{
"operator": "isNull",
"id": "<string>",
"target": {
"fieldRef": "<string>"
},
"includeNull": true,
"values": [
"<unknown>"
],
"settings": "<unknown>",
"disabled": true,
"required": true,
"caseSensitive": true
}
],
"baseDimensionName": "<string>",
"baseMetricName": "<string>",
"uuid": "<string>",
"percentile": 123,
"distinctKeys": [
"<string>"
],
"formatOptions": {
"type": "default",
"round": 123,
"separator": "default",
"currency": "<string>",
"compact": "auto",
"prefix": "<string>",
"suffix": "<string>",
"timeInterval": "RAW",
"custom": "<string>"
},
"generationType": "periodOverPeriod",
"baseMetricId": "<string>",
"timeDimensionId": "<string>",
"granularity": "RAW",
"periodOffset": 123
}
]
},
"sql": "<string>",
"sourceId": "<string>"
}
],
"sql": "<string>"
},
"status": "ok"
}{
"error": {
"name": "<string>",
"statusCode": 123,
"data": "<unknown>",
"message": "<string>"
},
"status": "error"
}Compile merge query
Compile several queries into a single merged warehouse statement.
Returns the statement and the fields it produces, without running it.
Use it to validate a merge while it is being built: a merge that would
produce wrong numbers comes back with errors and a null sql — most
importantly the fan-out case, where a query still carries a dimension
that is neither joined on nor pivoted. Run a valid merge with
POST /mergeQuery/run.
A valid request URL is required to generate request examples{
"results": {
"errors": [
{
"message": "<string>",
"fieldIds": [
"<string>"
],
"sourceId": "<string>",
"kind": "too_few_sources"
}
],
"requiresCompose": true,
"fieldIdByColumn": {},
"usedParametersValues": {},
"parameterReferences": [
"<string>"
],
"fieldOrigins": {},
"itemsMap": {},
"fields": [
{
"sourceFieldId": "<string>",
"sourceId": "<string>",
"type": "<string>",
"kind": "dimension",
"label": "<string>",
"column": "<string>"
}
],
"columns": {
"valueColumnBySourceColumn": {},
"joinKeyColumns": [
"<string>"
]
},
"sorts": [
{
"descending": true,
"fieldId": "<string>",
"pivotValues": [
{
"value": "<string>",
"reference": "<string>"
}
],
"nullsFirst": true
}
],
"terminalWrapper": {
"sourceLimitExceededSql": "<string>",
"limit": 123,
"orderBy": [
"<string>"
]
},
"typedColumns": [
{
"origin": {
"sourceFieldId": "<string>",
"sourceId": "<string>",
"kind": "source"
},
"type": "string",
"reference": "<string>"
}
],
"coreSql": "<string>",
"legs": [
{
"metricQuery": {
"tableCalculations": [
{
"displayName": "<string>",
"name": "<string>",
"sql": "<string>",
"totalMode": "formula",
"type": "number",
"format": {
"type": "default",
"round": 123,
"separator": "default",
"currency": "<string>",
"compact": "auto",
"prefix": "<string>",
"suffix": "<string>",
"timeInterval": "RAW",
"custom": "<string>"
},
"index": 123
}
],
"limit": 123,
"sorts": [
{
"descending": true,
"fieldId": "<string>",
"pivotValues": [
{
"value": "<string>",
"reference": "<string>"
}
],
"nullsFirst": true
}
],
"filters": {
"tableCalculations": {
"or": [
{
"operator": "isNull",
"id": "<string>",
"target": {
"fieldId": "<string>"
},
"includeNull": true,
"values": [
"<unknown>"
],
"settings": "<unknown>",
"disabled": true,
"required": true,
"caseSensitive": true
}
],
"id": "<string>"
},
"metrics": {
"or": [
{
"operator": "isNull",
"id": "<string>",
"target": {
"fieldId": "<string>"
},
"includeNull": true,
"values": [
"<unknown>"
],
"settings": "<unknown>",
"disabled": true,
"required": true,
"caseSensitive": true
}
],
"id": "<string>"
},
"dimensions": {
"or": [
{
"operator": "isNull",
"id": "<string>",
"target": {
"fieldId": "<string>"
},
"includeNull": true,
"values": [
"<unknown>"
],
"settings": "<unknown>",
"disabled": true,
"required": true,
"caseSensitive": true
}
],
"id": "<string>"
}
},
"metrics": [
"<string>"
],
"dimensions": [
"<string>"
],
"exploreName": "<string>",
"metadata": {
"hasADateDimension": {
"name": "<string>",
"label": "<string>",
"table": "<string>"
}
},
"pivotDimensions": [
"<string>"
],
"timezone": "<string>",
"dimensionOverrides": {},
"metricOverrides": {},
"customDimensions": [
{
"id": "<string>",
"name": "<string>",
"table": "<string>",
"type": "bin",
"dimensionId": "<string>",
"binType": "fixed_number",
"binNumber": 123
}
],
"additionalMetrics": [
{
"type": "percentile",
"sql": "<string>",
"table": "<string>",
"name": "<string>",
"label": "<string>",
"description": "<string>",
"hidden": true,
"round": 123,
"compact": "auto",
"format": "km",
"separator": "default",
"index": 123,
"filters": [
{
"operator": "isNull",
"id": "<string>",
"target": {
"fieldRef": "<string>"
},
"includeNull": true,
"values": [
"<unknown>"
],
"settings": "<unknown>",
"disabled": true,
"required": true,
"caseSensitive": true
}
],
"baseDimensionName": "<string>",
"baseMetricName": "<string>",
"uuid": "<string>",
"percentile": 123,
"distinctKeys": [
"<string>"
],
"formatOptions": {
"type": "default",
"round": 123,
"separator": "default",
"currency": "<string>",
"compact": "auto",
"prefix": "<string>",
"suffix": "<string>",
"timeInterval": "RAW",
"custom": "<string>"
},
"generationType": "periodOverPeriod",
"baseMetricId": "<string>",
"timeDimensionId": "<string>",
"granularity": "RAW",
"periodOffset": 123
}
]
},
"sql": "<string>",
"sourceId": "<string>"
}
],
"sql": "<string>"
},
"status": "ok"
}{
"error": {
"name": "<string>",
"statusCode": 123,
"data": "<unknown>",
"message": "<string>"
},
"status": "error"
}Path Parameters
Body
Response
Success
What the compile endpoint returns. sql is null exactly when errors is
non-empty: a merge that would produce wrong numbers is reported, not run.
A merge runs as a composition: each metric source runs on its own as a
leg, and the join runs on the compose engine over the legs' results, which
it reads as merge_source_N tables in source order. legs and sql
together are the SQL that runs.
Show child attributes
Show child attributes
ok Was this page helpful?