Quantela Data Connector
The QuantelaData provider is used to connect to the internal Quantela platform database and retrieve real-time or historical data for use in Adapters or Datasets.
To add a Quantela Data provider to the data flow for an adapter or dataset, drag the corresponding provider icon from the palette on the left of the studio canvas.

Enter the following settings to configure the Quantela Data provider:
Configuration | Description |
---|---|
What data do you need? | Select one of the following to determine what type of data should be returned from the Quantela platform database:
|
Choose Layer | Select an application domain from the displayed list of domains that have been configured for this deployment of the Quantela platform. |
Metrics | If you have chosen to return Metrics or MetricsV3 data then this configuration option allows you to select which type of aggregation is required, which fields to aggregate and to give a custom label name. The following aggregate functions are available:
|
Metric Interval | If you have chosen to return Metrics or MetricsV3 data then this configuration option allows you to select what time interval to use for aggregate calculations. The following options are available:
|
BUILDER/RAW | If you have chosen to return TimeSeries data then this configuration option allows you to select how you can get the data from the Quantela platform database by toggling between the following:
|
Select Table (A) | If you have chosen to return TimeSeries data through BUILDER then select a table having an alias as 'A', from the list of displayed tables from which the data has to be returned. The list of tables displayed are the ones that belong to the domains which the user has access to by following Role-based Access Control (RBAC) and Data Access Control (DAC). TipIf the table name ends with "_entity" it is from a real-time table and if it ends with "_metric" it is from a metric table. Also, global table names begin with "gbl_". |
Joins | If you have chosen to return TimeSeries data then this configuration option allows you to select which type of join is required, which second table having an alias as 'B' to join, which column from the second table 'B' to join along with which column from the first table 'A'. The following types of joins are available:
You can also add multiple conditions in joins and multiple-layered condition filters using the And and Or conditions. |
Group By | If you have chosen to return TimeSeries data then this configuration option allows you to group the entities by the columns of the table. |
Metrics | If you have chosen to return TimeSeries data then this configuration option allows you to select which type of aggregation is required, which fields to aggregate and to give a custom label name. The following aggregate functions are available:
|
Enable Streams | Select whether or not the data can be sent in streams. If this option is selected then the data is sent in blocks as it is received so that the data can be processed a record at a time. If the data is formatted as CSV then it is sent one record at a time; if it is in JSON format then it will be sent one object at a time. The dataset can either process each record/object individually and pass it on to the consumer, or it can accumulate all of the fragments and construct a complete CSV file or JSON structure before passing this on to the consumer. |
Reference For Tables | If you have chosen to return TimeSeries data through RAW then select a table from the list of displayed tables from which the data has to be returned. The list of tables displayed are the ones that belong to the domains which the user has access to by following Role-based Access Control (RBAC) and Data Access Control (DAC). TipIf the table name ends with "_entity" it is from a real-time table and if it ends with "_metric" it is from a metric table. Also, global table names begin with "gbl_". |
Reference For Columns | If you have chosen to return TimeSeries data through RAW then select a column from the list of displayed columns based on the table selected in Reference For Tables. |
Date Range | Select the date range to be used for historical reports. You can either select one of the pre-configured quick-access date ranges, or you can specify the start and end dates for a custom date range. |
Type of Boundary | Select one of the following to query the entities by geographical region:
|
Entity ID | Optionally specify the ID of an individual entity to return data for this one device. |
Event ID | Optionally specify the ID of an individual event. |
Event Types | Select the type of events from the displayed list of event types that are shown based on the layer that was previously selected. |
GeoSpatial | For RealTime and Events data, indicate if the data is to be returned in GeoJSON format. |
Query Builder | If you have selected Real-Time, Metrics, MetricsV3, Event or TimeSeries data then the interactive query builder allows you to select attributes related to the entity types in the chosen layer, and to specify corresponding filter values. For example, you can select only Lights whose Intensity is greater than 50 AND whose powerConsumption is less than or equal to 20. In the Column Selection list-box, you can select one or more columns to be returned in the dataset. The list of columns would depend on which functional layers have been selected. If you have chosen to return TimeSeries data then the Distinct By option allows you to select one or more columns without duplicate values. Also, the Order By option allows you to select a column and sort the values in it either by ASC or DESC order from the Order drop-down. You can also specify a Limit for the number of records to be returned by the query, and an Offset if you do not want to return the first records in the query result. If you have chosen to return Real-Time data then the Extended limit option allows you to specify an Entity Id and Last Updated value of the previous page’s last entity along with the Limit. The default limit is 10,000. Query builder allows three types of values for filters:
|
Query Type | If you have chosen to return Raw data then this would indicate whether the query would return Entity, Metric, Event or MetricV3 type data. |
Query | If you have chosen to return Raw data, then this panel allows you to edit a raw Elasticsearch query against the Quantela platform database. Queries must be written in Elasticsearch Query DSL format. For example, the following query would return all entities whose entity-type is "Environment". { "query": { "bool": { "must": [ {"match": { "entity_type": "Environment" }} ] } } } |
Group By | If you have chosen to return Metrics or MetricsV3 data then this configuration option allows you to group the entities by certain attributes. The following options are available:
|
Show Query | Shows the Elastic DSL query and which can be copied using the Copy Query Text icon |
Querying through TimeSeries - RAW using QDC() functions
If you have chosen to return TimeSeries - RAW data, then the Query panel allows you to enter raw queries using the following QDC() functions:
from - fetches data from a table using the syntax
QDC().from(tableName)
. For example,QDC().from("gbl_spatial_demographics_entity")
.select - selects all or the specified columns from a table.
selects specific columns from a table using the syntax
QDC().select(columns).from(tableName)
. For example,QDC().select(["location_key","name"]).from("gbl_spatial_demographics_entity")
.selects all the columns from a table using the syntax
QDC().select("*").from(tableName)
. For example,QDC().select("*").from("gbl_spatial_demographics_entity")
.
where - fetches the data from a table which satisfies a condition using the syntax
QDC().from(tableName).where(key, operator, value)
. For example,QDC().from("gbl_spatial_demographics_entity").where("name","=","India")
.andWhere - fetches the data from a table which satisfies two conditions using the syntax
QDC().from(tableName).andWhere(key, operator, value)
. For example,QDC().from("gbl_spatial_demographics_entity").andWhere("name","=","India")
.orWhere - fetches the data from a table which satisfies any of the two conditions using the syntax
QDC().from(tableName).orWhere(key, operator, value)
. For example,QDC().from("gbl_spatial_demographics_entity").orWhere("name","=","India")
.offset - limits the number of records to be returned and doesn't fetch the ones before the offset using the syntax
QDC().from(tableName).limit(value).offset(value)
. For example,QDC().from("gbl_spatial_demographics_entity").limit(10).offset(1)
.limit - limits the number of records to be returned using the syntax
QDC().from(tableName).limit(value)
. For example,QDC().from("gbl_spatial_demographics_entity").limit(10)
.orderBy - sorts the values of a single column or multiple columns of a table using the syntax
QDC().from(tableName).orderBy(columns, order)
.sorts the values of a single column. For example,
QDC().from("gbl_spatial_demographics_entity").orderBy("last_updated", "desc")
.sorts the values of multiple columns. For example,
QDC ().from("gbl_spatial_demographics_entity").orderBy([{"column": "last_updated", "order": "asc"}, {"column": "name", "order": "desc"}])
.
groupBy - arranges identical data into groups using the syntax
QDC().from(tableName).groupBy(column)
. For example,QDC().from("gbl_spatial_demographics_entity").groupBy("entity_id")
.having - fetches a group of data which satisfies a condition using the syntax
QDC().from(tableName).groupBy(column).having(key, operator, value)
. For example,QDC().from("gbl_spatial_demographics_entity").groupBy("entity_id").having("name", ">", 100)
.distinct - fetches the data of a single column or multiple columns of a table without duplicates using the syntax
QDC().from(tableName).distinct(columns)
.fetches the unique values of single column. For example,
QDC().from("gbl_spatial_demographics_entity").distinct("entityId")
.fetches the unique values of multiple columns. For example,
QDC().from("gbl_spatial_demographics_entity").distinct(["entity_id", "id"])
.
distinctOn - fetches the data of a single column or multiple columns of a table without duplicates and is used in certain cases in PostgreSQL using the syntax
QDC().from(tableName).distinctOn(columns)
.fetches the unique values of a single column. For example,
QDC().from("gbl_spatial_demographics_entity").distinctOn("entityId")
.fetches the unique values of multiple columns. For example,
QDC().from("gbl_spatial_demographics_entity").distinctOn(["entity_id", "id"])
.
count - counts the number of rows in a column using the syntax
QDC().from(tableName).count(columns)
. For example,QDC().from("gbl_spatial_demographics_entity").count("entity_id")
.min - fetches the minimum value of a single column or multiple columns of a table using the syntax
QDC().from(tableName).min(columns)
.fetches the minimum value of a single column. For example,
QDC().from("gbl_spatial_demographics_entity").min("intensity")
.fetches the minimum value of multiple columns. For example,
QDC().from("gbl_spatial_demographics_entity").min({"min":["intensity", "lightId"]})
.
max - fetches the maximum value of a single column or multiple columns of a table using the syntax
QDC().from(tableName).max(columns)
.fetches the maximum value of a single column. For example,
QDC().from("gbl_spatial_demographics_entity").max("intensity")
.fetches the maximum value of multiple columns. For example,
QDC().from("gbl_spatial_demographics_entity").max({"min":["intensity", "lightId"]})
.
sum - calculates the sum of all the values of a column or multiple columns of a table using the syntax
QDC().from(tableName).sum(columns)
.calculates the sum of a single column. For example,
QDC().from("gbl_spatial_demographics_entity").sum("products")
.calculates the sum of multiple columns. For example,
QDC().from("gbl_spatial_demographics_entity").sum({"sum": ["products", "orders"]})
.
sumDistinct - adds a distinct expression inside the aggregate function using the syntax
QDC().from(tableName).sumDistinct(columns)
. For example,QDC().from("gbl_spatial_demographics_entity").sumDistinct("products")
.avgDistinct - calculates the average of a distinct expression inside the aggregate function using the syntax
QDC().from(tableName).avgDistinct(columns)
. For example,QDC().from("gbl_spatial_demographics_entity").avgDistinct("location_admin_level")
.avg - calculates the average of all the values of a column or multiple columns of a table using the syntax
QDC().from(tableName).avg(columns)
.calculates the average of a single column. For example,
QDC().from("gbl_spatial_demographics_entity").avg("products")
.calculates the average of multiple columns. For example,
QDC().from("gbl_spatial_demographics_entity").avg({"avg": ["products", "orders"]})
.
pluck - plucks the specified column from each row using the syntax
QDC().from(tableName).pluck(columns)
. For example,QDC().from("gbl_spatial_demographics_entity").pluck("entity_id")
.first - fetches the first record of the specified column using the syntax
QDC().from(tableName).first(columns)
. For example,QDC().from("gbl_spatial_demographics_entity").first("entity_id")
.join - specifies joins between tables using the syntax
QDC().from(tableName1).join(tableName2, first, operator, second)
. For example,QDC().from("gbl_spatial_geography_entity").join("geography_columns", "geography_columns.srid", "=", "table1.id)"
.innerJoin - joins rows from different tables if the join condition is satisfied using the syntax
QDC().from(tableName1).innerJoin(tableName2, first, operator, second)
. For example,QDC().from("gbl_spatial_geography_entity").innerJoin("geography_columns", "geography_columns.srid", "=", "table1.id)"
.leftJoin - returns all the records from the first table and the matched records from the second table using the syntax
QDC().from(tableName1).leftJoin(tableName2, first, operator, second)
. For example,QDC().from("gbl_spatial_geography_entity").leftJoin("geography_columns", "geography_columns.srid", "=", "table1.id)"
.leftOuterJoin - returns all the records from the first table and all the records from the second table even if they are not matched using the syntax
QDC().from(tableName1).leftOuterJoin(tableName2, first, operator, second)
. For example,QDC().from("gbl_spatial_geography_entity").leftOuterJoin("geography_columns", "geography_columns.srid", "=", "table1.id)"
.rightJoin - returns all the records from the second table and the matched records from the first table using the syntax
QDC().from(tableName1).rightJoin(tableName2, first, operator, second)
. For example,QDC().from("gbl_spatial_geography_entity").rightJoin("geography_columns", "geography_columns.srid", "=", "table1.id)"
.rightOuterJoin - returns all the records from the second table and all the records from the first table even if they are not matched using the syntax
QDC().from(tableName1).rightOuterJoin(tableName2, first, operator, second)
. For example,QDC().from("gbl_spatial_geography_entity").rightOuterJoin("geography_columns", "geography_columns.srid", "=", "table1.id)"
.fullOuterJoin - returns all the records when there is a match in the first or second table records using the syntax
QDC().from(tableName1).fullOuterJoin(tableName2, first, operator, second)
. For example,QDC().from("gbl_spatial_geography_entity").fullOuterJoin("geography_columns", "geography_columns.srid", "=", "table1.id)"
.crossJoin - combines each row of the first table with each row of the second table using the syntax
QDC().from(tableName1).crossJoin(tableName2, first, operator, second)
. For example,QDC().from("gbl_spatial_geography_entity").crossJoin("geography_columns", "geography_columns.srid", "=", "table1.id)"
.whereIn - fetches the data from a table for the values in a column using the syntax
QDC().from(tableName).whereIn(key, value)
. For example,QDC().from("gbl_spatial_geography_entity").whereIn("geography_columns.srid", ["val1","val2","val3"])
.whereNotIn - fetches the data from a table for not the exact values in a column using the syntax
QDC().from(tableName).whereNotIn(key, value)
. For example,QDC().from("gbl_spatial_geography_entity").whereNotIn("geography_columns.srid", ["val1","val2","val3"])
.whereNull - fetches the data from a table for the null values in a column using the syntax
QDC().from(tableName).whereNull(key)
. For example,QDC().from("gbl_spatial_geography_entity").whereNull("geography_columns.srid")
.whereNotNull - fetches the data from a table for the values that are not null in a column using the syntax
QDC().from(tableName).whereNotNull(key)
. For example,QDC().from("gbl_spatial_geography_entity").whereNotNull("geography_columns.srid")
.whereBetween - fetches the data from a table for the values that are between a range in a column using the syntax
QDC().from(tableName).whereBetween(key, range)
. For example,QDC().from("gbl_spatial_geography_entity").whereBetween("geography_columns.srid", [1,100])
.whereNotBetween - fetches the data from a table for the values that are not between a range in a column using the syntax
QDC().from(tableName).whereNotBetween(key, range)
. For example,QDC().from("gbl_spatial_geography_entity").whereNotBetween("geography_columns.srid", [1,100])
.orWhereIn - fetches the data from a table for the values in a column which satisfies any of the two "where" conditions using the syntax
QDC().from(tableName).orWhereIn(key, value)
. For example,QDC().from("gbl_spatial_geography_entity").orWhereIn("geography_columns.srid", ["val1","val2","val3"])
.orWhereNotIn - fetches the data from a table for not the exact values in a column which satisfies any of the two "where" conditions using the syntax
QDC().from(tableName).orWhereNotIn(key, value)
. For example,QDC().from("gbl_spatial_geography_entity").orWhereNotIn("geography_columns.srid", ["val1","val2","val3"])
.orWhereNull - fetches the data from a table for the null values in a column which satisfies any of the two "where" conditions using the syntax
QDC().from(tableName).orWhereNull(key)
. For example,QDC().from("gbl_spatial_geography_entity").orWhereNull("geography_columns.srid")
.orWhereNotNull - fetches the data from a table for the values that are not null in a column which satisfies any of the two "where" conditions using the syntax
QDC().from(tableName).orWhereNotNull(key)
. For example,QDC().from("gbl_spatial_geography_entity").orWhereNotNull("geography_columns.srid")
.orWhereBetween - fetches the data from a table for the values that are between a range in a column which satisfies any of the two "where" conditions using the syntax
QDC().from(tableName).orWhereBetween(key, range)
. For example,QDC().from("gbl_spatial_geography_entity").orWhereBetween("geography_columns.srid", [1,100])
.orWhereNotBetween - fetches the data from a table for the values that are not between a range in a column which satisfies any of the two "where" conditions using the syntax
QDC().from(tableName).orWhereNotBetween(key, range)
. For example,QDC().from("gbl_spatial_geography_entity").orWhereNotBetween("geography_columns.srid", [1,100])
.Simple Select - selects all or the specified columns from a table for the specified criterion in the select statement using the syntax
QDC().select("count(*) as total").from("tableName")
. For example,QDC().select("count(*) as total").from("gbl_abstractiontimeseries_gbllinestring_entity")
.Simple PostGIS - returns the geometry as a Geometry Javascript Object Notation (GeoJSON) element using PostGIS methods and using the syntax
QDC().select(["ST_AsGeoJSON(geometryColumnName)::json"]).from("tableName")
. For example,QDC().select(["ST_AsGeoJSON(linestring)::json"]).from("gbl_abstractiontimeseries_gbllinestring_entity")
.Multi Condition Joins - joins rows from different tables with multiple conditions using the syntax
QDC().from("table_name_1").innerJoin("table_name_2",{ "condition": "and", "rules": [ { "field": "table_name_1.table_1_column1", "operator": "=", "value": "table_name_2.table_2_column1" }, { "field": "table_name_1.table_1_column2", "operator": "=", "value": "table_name_2.table_2_column2" } ] })
.For example,
QDC().from("gbl_joins_singlecondition_metric").fullOuterJoin("gurugram_com_joins_multicondition_metric",{"condition": "and","rules":[{"field":"gbl_joins_singlecondition_metric.provider","operator": "=","value": "gurugram_com_joins_multicondition_metric.provider"},{"field": "gbl_joins_singlecondition_metric.version","operator": "=","value": "gurugram_com_joins_multicondition_metric.version"}]})
.Multi-layered Condition Filters - filters the data in a table using nested conditions and using the syntax
QDC().from("table_name_1").where({ "condition": "and", "rules": [ { "field": "column_1", "operator": "is", "value": "column_1_value" }, { "condition": "or", "rules": [ { "field": "column_2", "operator": "is", "value": "column_2_value" }, { "field": "column_3", "operator": "is", "value": "column_3_value" } ] } ] })
.For example,
QDC().from("gbl_joins_singlecondition_entity").where({"condition": "and", "rules":[{"field": "gbl_joins_singlecondition_entity", "operator": "is", "value": "humidity"}, {"field": "gbl_joins_singlecondition_entity", "operator": "is", "value": "aqi" }]})
.
Click the Save and Generate Schema button at the bottom of the Configuration panel to save the configuration with schema or Save Adapter/Dataset to save the configuration without schema.