Create FactTable
Create a new fact table. A fact table is a description of a dataset, specifically, it describes which columns correspond to entities, dimensions and measurements. It is the basis for describing metrics.
curl --request POST \
--url https://metrics.eu.confidence.dev/v1/factTables \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sql": "<string>",
"displayName": "<string>",
"timestampColumn": {
"name": "<string>",
"repeated": true
},
"entities": [
{
"column": {
"name": "<string>",
"repeated": true
},
"entity": "<string>"
}
],
"name": "<string>",
"description": "<string>",
"measures": [
{
"column": {
"name": "<string>",
"repeated": true
},
"displayName": "<string>",
"unit": {
"baseUnitMultiplier": 123,
"currencyCode": "<string>",
"customUnit": "<string>",
"entity": "<string>",
"factTable": "<string>"
}
}
],
"dimensions": [
{
"name": "<string>",
"repeated": true
}
],
"factDataDeliveredUntilTime": {},
"labels": [
{}
],
"owner": "<string>",
"skipSqlPreview": true
}
'import requests
url = "https://metrics.eu.confidence.dev/v1/factTables"
payload = {
"sql": "<string>",
"displayName": "<string>",
"timestampColumn": {
"name": "<string>",
"repeated": True
},
"entities": [
{
"column": {
"name": "<string>",
"repeated": True
},
"entity": "<string>"
}
],
"name": "<string>",
"description": "<string>",
"measures": [
{
"column": {
"name": "<string>",
"repeated": True
},
"displayName": "<string>",
"unit": {
"baseUnitMultiplier": 123,
"currencyCode": "<string>",
"customUnit": "<string>",
"entity": "<string>",
"factTable": "<string>"
}
}
],
"dimensions": [
{
"name": "<string>",
"repeated": True
}
],
"factDataDeliveredUntilTime": {},
"labels": [{}],
"owner": "<string>",
"skipSqlPreview": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sql: '<string>',
displayName: '<string>',
timestampColumn: {name: '<string>', repeated: true},
entities: [{column: {name: '<string>', repeated: true}, entity: '<string>'}],
name: '<string>',
description: '<string>',
measures: [
{
column: {name: '<string>', repeated: true},
displayName: '<string>',
unit: {
baseUnitMultiplier: 123,
currencyCode: '<string>',
customUnit: '<string>',
entity: '<string>',
factTable: '<string>'
}
}
],
dimensions: [{name: '<string>', repeated: true}],
factDataDeliveredUntilTime: {},
labels: [{}],
owner: '<string>',
skipSqlPreview: true
})
};
fetch('https://metrics.eu.confidence.dev/v1/factTables', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://metrics.eu.confidence.dev/v1/factTables",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sql' => '<string>',
'displayName' => '<string>',
'timestampColumn' => [
'name' => '<string>',
'repeated' => true
],
'entities' => [
[
'column' => [
'name' => '<string>',
'repeated' => true
],
'entity' => '<string>'
]
],
'name' => '<string>',
'description' => '<string>',
'measures' => [
[
'column' => [
'name' => '<string>',
'repeated' => true
],
'displayName' => '<string>',
'unit' => [
'baseUnitMultiplier' => 123,
'currencyCode' => '<string>',
'customUnit' => '<string>',
'entity' => '<string>',
'factTable' => '<string>'
]
]
],
'dimensions' => [
[
'name' => '<string>',
'repeated' => true
]
],
'factDataDeliveredUntilTime' => [
],
'labels' => [
[
]
],
'owner' => '<string>',
'skipSqlPreview' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://metrics.eu.confidence.dev/v1/factTables"
payload := strings.NewReader("{\n \"sql\": \"<string>\",\n \"displayName\": \"<string>\",\n \"timestampColumn\": {\n \"name\": \"<string>\",\n \"repeated\": true\n },\n \"entities\": [\n {\n \"column\": {\n \"name\": \"<string>\",\n \"repeated\": true\n },\n \"entity\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"measures\": [\n {\n \"column\": {\n \"name\": \"<string>\",\n \"repeated\": true\n },\n \"displayName\": \"<string>\",\n \"unit\": {\n \"baseUnitMultiplier\": 123,\n \"currencyCode\": \"<string>\",\n \"customUnit\": \"<string>\",\n \"entity\": \"<string>\",\n \"factTable\": \"<string>\"\n }\n }\n ],\n \"dimensions\": [\n {\n \"name\": \"<string>\",\n \"repeated\": true\n }\n ],\n \"factDataDeliveredUntilTime\": {},\n \"labels\": [\n {}\n ],\n \"owner\": \"<string>\",\n \"skipSqlPreview\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://metrics.eu.confidence.dev/v1/factTables")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sql\": \"<string>\",\n \"displayName\": \"<string>\",\n \"timestampColumn\": {\n \"name\": \"<string>\",\n \"repeated\": true\n },\n \"entities\": [\n {\n \"column\": {\n \"name\": \"<string>\",\n \"repeated\": true\n },\n \"entity\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"measures\": [\n {\n \"column\": {\n \"name\": \"<string>\",\n \"repeated\": true\n },\n \"displayName\": \"<string>\",\n \"unit\": {\n \"baseUnitMultiplier\": 123,\n \"currencyCode\": \"<string>\",\n \"customUnit\": \"<string>\",\n \"entity\": \"<string>\",\n \"factTable\": \"<string>\"\n }\n }\n ],\n \"dimensions\": [\n {\n \"name\": \"<string>\",\n \"repeated\": true\n }\n ],\n \"factDataDeliveredUntilTime\": {},\n \"labels\": [\n {}\n ],\n \"owner\": \"<string>\",\n \"skipSqlPreview\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://metrics.eu.confidence.dev/v1/factTables")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sql\": \"<string>\",\n \"displayName\": \"<string>\",\n \"timestampColumn\": {\n \"name\": \"<string>\",\n \"repeated\": true\n },\n \"entities\": [\n {\n \"column\": {\n \"name\": \"<string>\",\n \"repeated\": true\n },\n \"entity\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"measures\": [\n {\n \"column\": {\n \"name\": \"<string>\",\n \"repeated\": true\n },\n \"displayName\": \"<string>\",\n \"unit\": {\n \"baseUnitMultiplier\": 123,\n \"currencyCode\": \"<string>\",\n \"customUnit\": \"<string>\",\n \"entity\": \"<string>\",\n \"factTable\": \"<string>\"\n }\n }\n ],\n \"dimensions\": [\n {\n \"name\": \"<string>\",\n \"repeated\": true\n }\n ],\n \"factDataDeliveredUntilTime\": {},\n \"labels\": [\n {}\n ],\n \"owner\": \"<string>\",\n \"skipSqlPreview\": true\n}"
response = http.request(request)
puts response.read_body{
"sql": "<string>",
"displayName": "<string>",
"timestampColumn": {
"name": "<string>",
"type": "COLUMN_TYPE_UNSPECIFIED",
"repeated": true
},
"entities": [
{
"column": {
"name": "<string>",
"type": "COLUMN_TYPE_UNSPECIFIED",
"repeated": true
},
"entity": "<string>"
}
],
"state": "TABLE_STATE_UNSPECIFIED",
"schemaValidationJob": "<string>",
"createTime": {},
"updateTime": {},
"creator": "<string>",
"updater": "<string>",
"name": "<string>",
"description": "<string>",
"measures": [
{
"column": {
"name": "<string>",
"type": "COLUMN_TYPE_UNSPECIFIED",
"repeated": true
},
"displayName": "<string>",
"unit": {
"baseUnitMultiplier": 123,
"baseUnit": "BASE_UNIT_UNSPECIFIED",
"currencyCode": "<string>",
"customUnit": "<string>",
"entity": "<string>",
"factTable": "<string>"
},
"declaredType": "COLUMN_TYPE_UNSPECIFIED"
}
],
"partitionedUpdateStrategyState": {
"currentPartitionLastCheckTime": {},
"existsCheckDuration": {},
"state": "STATE_UNSPECIFIED",
"usualLateness": {},
"count": 123
},
"dimensions": [
{
"name": "<string>",
"type": "COLUMN_TYPE_UNSPECIFIED",
"repeated": true
}
],
"error": {
"message": "<string>",
"details": [
"<string>"
]
},
"factDataDeliveredUntilTime": {},
"dataDeliveredUntilUpdateStrategyConfig": {
"strategy": "STRATEGY_UNSPECIFIED",
"disableEmptyPartitions": true,
"automaticUpdateConfig": {
"commitDelay": {},
"incrementDuration": {},
"changeThreshold": {
"value": "<string>"
}
},
"dailyUpdateConfig": {
"maxZeroDuration": {}
},
"hourlyUpdateConfig": {
"maxZeroDuration": {}
}
},
"deleteTime": {},
"labels": [
{}
],
"owner": "<string>",
"systemCreated": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
The id to the give the created fact table. If a not set a random one will be generated.
Body
A data warehouse-specific query to get the data of the fact table.
Human friendly name of the fact table.
The column of the fact table that represents the time the event occurred.
Show child attributes
Show child attributes
Mapping between columns and the entities involved in the event.
Show child attributes
Show child attributes
Unique identifier of the fact table.
For example: factTables/0smva5nxuhv4yts6paxt
Human readable description of the fact table.
Mapping between columns of the underlying table and measures.
Show child attributes
Show child attributes
Mapping between columns and dimensions of the entities.
Show child attributes
Show child attributes
The current maximum time point where there is available data for the fact table.
The strategy for updating fact_data_delivered_until_time in the fact
table.
Show child attributes
Show child attributes
Custom labels for this fact table.
Show child attributes
Show child attributes
The owner of the resource. If not set will default to the creator.
If set to true, skips the SQL preview query (and goes directly into TABLE_STATE_ACTIVE). When true, all columns must have their types explicitly specified.
Response
Returns a FactTable.
A set of events from some business process, for example, a sale occurred.
A data warehouse-specific query to get the data of the fact table.
Human friendly name of the fact table.
The column of the fact table that represents the time the event occurred.
Show child attributes
Show child attributes
Mapping between columns and the entities involved in the event.
Show child attributes
Show child attributes
Current state of the fact table.
TABLE_STATE_UNSPECIFIED, TABLE_STATE_CREATING, TABLE_STATE_ACTIVE, TABLE_STATE_FAILED, TABLE_STATE_UPDATING, TABLE_STATE_DELETED Resource name of the sql job that was used to validate the schema of the fact table.
Time when the fact table was first created.
Time when the fact table was last updated.
Reference to the identity that created this fact table.
Reference to the identity that last updated this fact table.
Unique identifier of the fact table.
For example: factTables/0smva5nxuhv4yts6paxt
Human readable description of the fact table.
Mapping between columns of the underlying table and measures.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Mapping between columns and dimensions of the entities.
Show child attributes
Show child attributes
Indicates whether an errors has occurred.
Show child attributes
Show child attributes
The current maximum time point where there is available data for the fact table.
The strategy for updating fact_data_delivered_until_time in the fact
table.
Show child attributes
Show child attributes
Time when the fact table table was deleted.
Custom labels for this fact table.
Show child attributes
Show child attributes
The owner of the resource. If not set will default to the creator.
If this fact table is an automatically created fact table.
Was this page helpful?
curl --request POST \
--url https://metrics.eu.confidence.dev/v1/factTables \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sql": "<string>",
"displayName": "<string>",
"timestampColumn": {
"name": "<string>",
"repeated": true
},
"entities": [
{
"column": {
"name": "<string>",
"repeated": true
},
"entity": "<string>"
}
],
"name": "<string>",
"description": "<string>",
"measures": [
{
"column": {
"name": "<string>",
"repeated": true
},
"displayName": "<string>",
"unit": {
"baseUnitMultiplier": 123,
"currencyCode": "<string>",
"customUnit": "<string>",
"entity": "<string>",
"factTable": "<string>"
}
}
],
"dimensions": [
{
"name": "<string>",
"repeated": true
}
],
"factDataDeliveredUntilTime": {},
"labels": [
{}
],
"owner": "<string>",
"skipSqlPreview": true
}
'import requests
url = "https://metrics.eu.confidence.dev/v1/factTables"
payload = {
"sql": "<string>",
"displayName": "<string>",
"timestampColumn": {
"name": "<string>",
"repeated": True
},
"entities": [
{
"column": {
"name": "<string>",
"repeated": True
},
"entity": "<string>"
}
],
"name": "<string>",
"description": "<string>",
"measures": [
{
"column": {
"name": "<string>",
"repeated": True
},
"displayName": "<string>",
"unit": {
"baseUnitMultiplier": 123,
"currencyCode": "<string>",
"customUnit": "<string>",
"entity": "<string>",
"factTable": "<string>"
}
}
],
"dimensions": [
{
"name": "<string>",
"repeated": True
}
],
"factDataDeliveredUntilTime": {},
"labels": [{}],
"owner": "<string>",
"skipSqlPreview": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sql: '<string>',
displayName: '<string>',
timestampColumn: {name: '<string>', repeated: true},
entities: [{column: {name: '<string>', repeated: true}, entity: '<string>'}],
name: '<string>',
description: '<string>',
measures: [
{
column: {name: '<string>', repeated: true},
displayName: '<string>',
unit: {
baseUnitMultiplier: 123,
currencyCode: '<string>',
customUnit: '<string>',
entity: '<string>',
factTable: '<string>'
}
}
],
dimensions: [{name: '<string>', repeated: true}],
factDataDeliveredUntilTime: {},
labels: [{}],
owner: '<string>',
skipSqlPreview: true
})
};
fetch('https://metrics.eu.confidence.dev/v1/factTables', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://metrics.eu.confidence.dev/v1/factTables",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sql' => '<string>',
'displayName' => '<string>',
'timestampColumn' => [
'name' => '<string>',
'repeated' => true
],
'entities' => [
[
'column' => [
'name' => '<string>',
'repeated' => true
],
'entity' => '<string>'
]
],
'name' => '<string>',
'description' => '<string>',
'measures' => [
[
'column' => [
'name' => '<string>',
'repeated' => true
],
'displayName' => '<string>',
'unit' => [
'baseUnitMultiplier' => 123,
'currencyCode' => '<string>',
'customUnit' => '<string>',
'entity' => '<string>',
'factTable' => '<string>'
]
]
],
'dimensions' => [
[
'name' => '<string>',
'repeated' => true
]
],
'factDataDeliveredUntilTime' => [
],
'labels' => [
[
]
],
'owner' => '<string>',
'skipSqlPreview' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://metrics.eu.confidence.dev/v1/factTables"
payload := strings.NewReader("{\n \"sql\": \"<string>\",\n \"displayName\": \"<string>\",\n \"timestampColumn\": {\n \"name\": \"<string>\",\n \"repeated\": true\n },\n \"entities\": [\n {\n \"column\": {\n \"name\": \"<string>\",\n \"repeated\": true\n },\n \"entity\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"measures\": [\n {\n \"column\": {\n \"name\": \"<string>\",\n \"repeated\": true\n },\n \"displayName\": \"<string>\",\n \"unit\": {\n \"baseUnitMultiplier\": 123,\n \"currencyCode\": \"<string>\",\n \"customUnit\": \"<string>\",\n \"entity\": \"<string>\",\n \"factTable\": \"<string>\"\n }\n }\n ],\n \"dimensions\": [\n {\n \"name\": \"<string>\",\n \"repeated\": true\n }\n ],\n \"factDataDeliveredUntilTime\": {},\n \"labels\": [\n {}\n ],\n \"owner\": \"<string>\",\n \"skipSqlPreview\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://metrics.eu.confidence.dev/v1/factTables")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sql\": \"<string>\",\n \"displayName\": \"<string>\",\n \"timestampColumn\": {\n \"name\": \"<string>\",\n \"repeated\": true\n },\n \"entities\": [\n {\n \"column\": {\n \"name\": \"<string>\",\n \"repeated\": true\n },\n \"entity\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"measures\": [\n {\n \"column\": {\n \"name\": \"<string>\",\n \"repeated\": true\n },\n \"displayName\": \"<string>\",\n \"unit\": {\n \"baseUnitMultiplier\": 123,\n \"currencyCode\": \"<string>\",\n \"customUnit\": \"<string>\",\n \"entity\": \"<string>\",\n \"factTable\": \"<string>\"\n }\n }\n ],\n \"dimensions\": [\n {\n \"name\": \"<string>\",\n \"repeated\": true\n }\n ],\n \"factDataDeliveredUntilTime\": {},\n \"labels\": [\n {}\n ],\n \"owner\": \"<string>\",\n \"skipSqlPreview\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://metrics.eu.confidence.dev/v1/factTables")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sql\": \"<string>\",\n \"displayName\": \"<string>\",\n \"timestampColumn\": {\n \"name\": \"<string>\",\n \"repeated\": true\n },\n \"entities\": [\n {\n \"column\": {\n \"name\": \"<string>\",\n \"repeated\": true\n },\n \"entity\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"measures\": [\n {\n \"column\": {\n \"name\": \"<string>\",\n \"repeated\": true\n },\n \"displayName\": \"<string>\",\n \"unit\": {\n \"baseUnitMultiplier\": 123,\n \"currencyCode\": \"<string>\",\n \"customUnit\": \"<string>\",\n \"entity\": \"<string>\",\n \"factTable\": \"<string>\"\n }\n }\n ],\n \"dimensions\": [\n {\n \"name\": \"<string>\",\n \"repeated\": true\n }\n ],\n \"factDataDeliveredUntilTime\": {},\n \"labels\": [\n {}\n ],\n \"owner\": \"<string>\",\n \"skipSqlPreview\": true\n}"
response = http.request(request)
puts response.read_body{
"sql": "<string>",
"displayName": "<string>",
"timestampColumn": {
"name": "<string>",
"type": "COLUMN_TYPE_UNSPECIFIED",
"repeated": true
},
"entities": [
{
"column": {
"name": "<string>",
"type": "COLUMN_TYPE_UNSPECIFIED",
"repeated": true
},
"entity": "<string>"
}
],
"state": "TABLE_STATE_UNSPECIFIED",
"schemaValidationJob": "<string>",
"createTime": {},
"updateTime": {},
"creator": "<string>",
"updater": "<string>",
"name": "<string>",
"description": "<string>",
"measures": [
{
"column": {
"name": "<string>",
"type": "COLUMN_TYPE_UNSPECIFIED",
"repeated": true
},
"displayName": "<string>",
"unit": {
"baseUnitMultiplier": 123,
"baseUnit": "BASE_UNIT_UNSPECIFIED",
"currencyCode": "<string>",
"customUnit": "<string>",
"entity": "<string>",
"factTable": "<string>"
},
"declaredType": "COLUMN_TYPE_UNSPECIFIED"
}
],
"partitionedUpdateStrategyState": {
"currentPartitionLastCheckTime": {},
"existsCheckDuration": {},
"state": "STATE_UNSPECIFIED",
"usualLateness": {},
"count": 123
},
"dimensions": [
{
"name": "<string>",
"type": "COLUMN_TYPE_UNSPECIFIED",
"repeated": true
}
],
"error": {
"message": "<string>",
"details": [
"<string>"
]
},
"factDataDeliveredUntilTime": {},
"dataDeliveredUntilUpdateStrategyConfig": {
"strategy": "STRATEGY_UNSPECIFIED",
"disableEmptyPartitions": true,
"automaticUpdateConfig": {
"commitDelay": {},
"incrementDuration": {},
"changeThreshold": {
"value": "<string>"
}
},
"dailyUpdateConfig": {
"maxZeroDuration": {}
},
"hourlyUpdateConfig": {
"maxZeroDuration": {}
}
},
"deleteTime": {},
"labels": [
{}
],
"owner": "<string>",
"systemCreated": true
}
