Table

Top-level fields

Property
Description
tableName
Specifies the name of the table. Should only contain alpha-numeric characters, hyphens (‘-‘), or underscores (‘’). (Using a double-underscore (‘_’) is not allowed and reserved for other features within Pinot)
tableType
Defines the table type - OFFLINE for offline table, REALTIME for realtime table. A hybrid table is essentially 2 table configs one of each type, with the same table name.
isDimTable
Boolean field to indicate whether the table is a dimension table.
quota
This section defines properties related to quotas, such as storage quota and query quota. For more details scroll down to quota.
task
This section defines the enabled minion tasks for the table. See Minion for more details.
routing
This section defines the properties related to configuring how the broker selects the servers to route, and how segments can be pruned by the broker based on segment metadata. For more details, scroll down to routing.
query
This section defines the properties related to query execution. For more details scroll down to query.
segmentsConfig
This section defines the properties related to the segments of the table, such as segment push frequency, type, retention, schema, time column etc. For more details scroll down to segmentsConfig.
tableIndexConfig
This section defines the indexing related information for the Pinot table. For more details head over to Table indexing config.
fieldConfigList
This section specifies the columns and the type of indices to be created on those columns. Currently, only Text search columns can be specified using this property. We will be migrating the rest of the indices to this field in future releases. See Field config list for sub-properties.
tenants
Define the server and broker tenant used for this table. More details about tenant can be found in Tenant.
ingestionConfig
This section defines the configs needed for ingestion level transformations. More details in Ingestion Level Transformations.
upsertConfig
This section defines the configs related to the upsert feature.
tierConfigs
This section defines configs needed to setup tiered storage. More details in Tiered Storage.
metadata
This section is for keeping custom configs, which are expressed as key-value pairs.

Second level fields

The following properties can be nested inside the top-level configs.

Quota

Property
Description
storage
The maximum storage space the table is allowed to use, before replication. For example, in the above table, the storage is 140G and replication is 3. Therefore, the maximum storage the table is allowed to use is 140*3=420G. The space used by the table is calculated by adding up the sizes of all segments from every server hosting this table. Once this limit is reached, offline segment push throws a 403 exception with message, Quota check failed for segment: segment_0 of table: pinotTable.
maxQueriesPerSecond
The maximum queries per second allowed to execute on this table. If query volume exceeds this, a 429 exception with message Request 123 exceeds query quota for table:pinotTable, query:select count(*) from pinotTable will be sent, and a BrokerMetric QUERY_QUOTA_EXCEEDED will be recorded. The application should build an exponential backoff and retry mechanism to react to this exception.

Routing

Property
Description
segmentPrunerTypes
The list of segment pruners to be enabled.
The segment pruner prunes the selected segments based on the query. Supported values currently are partition - prunes segments based on the partition metadata stored in zookeeper. By default, there is no pruner. For more details on how to configure this check out Querying All Segments
instanceSelectorType
The instance selector selects server instances to serve the query based on selected segments. Supported values are balanced - balances the number of segments served by each selected instance. Default. replicaGroup - instance selector for replica group routing strategy. For more details on how to configure this check out Querying All Servers

Query

Property
Description
timeoutMs
Query timeout in milliseconds

Segments Config

Property
Description
schemaName
Name of the schema associated with the table
timeColumnName
The name of the time column for this table. This must match with the time column name in the schema. This is mandatory for tables with push type APPEND, optional for REFRESH. timeColumnName along with timeColumnType is used to manage segment retention and time boundary for offline vs realtime.
allowNullTimeValue
Boolean to indicate whether null value in time column is allowed. By default, false i.e. data source needs to make sure the value is not null in time column. When this flag is enabled, a default value based on machine time will be filled in if time column is null.
replication
Number of replicas
retentionTimeUnit
Unit for the retention. e.g. HOURS, DAYS. This in combination with retentionTimeValue decides the duration for which to retain the segments e.g. 365 DAYS in the example means that segments containing data older than 365 days will be deleted periodically. This is done by the RetentionManager Controller periodic task. By default, no retention is set.
retentionTimeValue
A numeric value for the retention. This in combination with retentionTimeUnit decides the duration for which to retain the segments
segmentPushType
(Deprecated starting 0.7.0 or commit 9eaea9. Use IngestionConfig -> BatchIngestionConfig -> segmentPushType )
This can be either APPEND - new data segments pushed periodically, to append to the existing data eg. daily or hourly REFRESH - the entire data is replaced every time during a data push. Refresh tables have no retention.
segmentPushFrequency
(Deprecated starting 0.7.0 or commit 9eaea9. Use IngestionConfig -> BatchIngestionConfig -> segmentPushFrequency )
The cadence at which segments are pushed eg. HOURLY, DAILY

Table Index Config

Property
Description
invertedIndexColumns
The list of columns that inverted index should be created on. The name of columns should match the schema. e.g. in the table above, inverted index has been created on 3 columns foo, bar, moo
createInvertedIndexDuringSegmentGeneration
Boolean to indicate whether to create inverted indexes during the segment creation. By default, false i.e. inverted indexes are created when the segments are loaded on the server
sortedColumn
The column which is sorted in the data and hence will have a sorted index. This does not need to be specified for the offline table, as the segment generation job will automatically detect the sorted column in the data and create a sorted index for it.
bloomFilterColumns
The list of columns to apply bloom filter on. The names of the columns should match the schema. For more details about using bloom filters refer to Bloom Filter.
bloomFilterConfigs
The map from the column to the bloom filter config. The names of the columns should match the schema. For more details about using bloom filters refer to Bloom Filter.
rangeIndexColumns
The list of columns that range index should be created on. Typically used for numeric columns and mostly on metrics. e.g. select count(*) from T where latency > 3000 will be faster if you enable range index for latency
starTreeIndexConfigs
The list of star-tree indexing configs for creating star-tree indexes. For more details on how to configure this, go to Star-tree
enableDefaultStarTree
Boolean to indicate whether to create a default star-tree index for the segment. For more details about this, go to Star-tree
enableDynamicStarTreeCreation
Boolean to indicate whether to allow creating star-tree when server loads the segment. Star-tree creation could potentially consume a lot of system resources, so this config should be enabled when the servers have the free system resources to create the star-tree.
noDictionaryColumns
The set of columns that should not be dictionary encoded. The name of columns should match the schema. NoDictionary dimension columns are Snappy compressed, while the metrics are not compressed.
onHeapDictionaryColumns
The list of columns for which the dictionary should be created on heap
varLengthDictionaryColumns
The list of columns for which the variable length dictionary needs to be enabled in offline segments. This is only valid for string and bytes columns and has no impact for columns of other data types.
segmentPartitionConfig
The map from column to partition function, which indicates how the segment is partitioned.
Currently 4 types of partition functions are supported:
Murmur - murmur2 hash function
Modulo - modulo on integer values
HashCode - java hashCode() function
ByteArray - java hashCode() on deserialized byte array
Example:
{ "foo": { "functionName": "Murmur", "numPartitions": 32 } }
loadMode
Indicates how the segments will be loaded onto the server heap - load data directly into direct memory mmap - load data segments to off-heap memory
columnMinMaxValueGeneratorMode
Generate min max values for columns. Supported values are NONE - do not generate for any columns ALL - generate for all columns TIME - generate for only time column NON_METRIC - generate for time and dimension columns
nullHandlingEnabled
Boolean to indicate whether to keep track of null values as part of the segment generation. This is required when using IS NULL or IS NOT NULL predicates in the query. Enabling this will lead to additional memory and storage usage per segment. By default, this is set to false.
aggregateMetrics
(only applicable for stream) set to true to pre-aggregate the metrics

Field Config List

Specify the columns and the type of indices to be created on those columns. Currently, only Text search columns can be specified using this property. We will be migrating the rest of the indices to this field in future releases.
Property
name
name of the column
encodingType
Should be one of RAW or DICTIONARY
indexType
index to create on this column. currently only TEXT is supported.
properties
JSON of key-value pairs containing additional properties associated with the index. The following properties are supported currently -
    enableQueryCacheForTextIndex - set to true to enable caching for text index in Lucene
    rawIndexWriterVersion
    deriveNumDocsPerChunkForRawIndex

Realtime Table Config

We will now discuss the sections that are only applicable to realtime tables.

segmentsConfig

Property
Description
replicasPerPartition
The number of replicas per partition for the stream
completionMode
determines if segment should be downloaded from other server or built in memory. can be DOWNLOAD or empty
peerSegmentDownloadScheme
protocol to use to download segments from server. can be on of http or https

Indexing config

Below is the list of fields in streamConfigs section.
IndexingConfig -> streamConfig has been deprecated starting 0.7.0 or commit 9eaea9. Use IngestionConfig -> StreamIngestionConfig -> streamConfigMaps instead.
Property
Description
streamType
only kafka is supported at the moment
stream.[streamType].consumer.type
should be one of lowLevel or highLevel . See Stream ingestion for more details
stream.[streamType].topic.name
topic or equivalent datasource from which to consume data
stream[streamType].consumer.prop.auto.offset.reset
offset to start consuming data from. Should be one of smallest , largest or a timestamp in millis
(0.6.0 onwards) realtime.segment.flush.threshold.rows
(0.5.0 and prior) (deprecated) realtime.segment.flush.threshold.size
Maximum number of rows to consume before persisting the consuming segment. Default is 5000000
realtime.segment.flush.threshold.time
Maximum elapsed time after which a consuming segment should be persisted. The value can be set as a human readable string, such as 1d, 4h30m Default is 6 hours.
(0.6.0 onwards) realtime.segment.flush.threshold.segment.size
(0.5.0 and prior) (deprecated)
realtime.segment.flush.desired.size
Desired size of the completed segments. This value can be set as a human readable string such as 150M, or 1.1G, etc. This value is used when realtime.segment.flush.threshold.size is set to 0. Default is 200M i.e. 200 MegaBytes
realtime.segment.flush.autotune.initialRows
Initial number of rows for learning.
This value is used only if realtime.segment.flush.threshold.size is set o 0 and the consumer type is LowLevel.
Default is 100000 (ie 100K).
All the configurations that are prefixed with the streamType are expected to be used by the underlying stream. So, you can set any of the configurations described in the Kafka configuraton page can be set using the prefix stream.kafka and Kafka should pay attention to it.

Example

Here is a minimal example of what the streamConfigs section may look like:
0.6.0 onwards:
1
"streamConfigs" : {
2
"realtime.segment.flush.threshold.rows": "0",
3
"realtime.segment.flush.threshold.time": "24h",
4
"realtime.segment.flush.threshold.segment.size": "150M",
5
"streamType": "kafka",
6
"stream.kafka.consumer.type": "LowLevel",
7
"stream.kafka.topic.name": "ClickStream",
8
"stream.kafka.consumer.prop.auto.offset.reset" : "largest"
9
}
Copied!
0.5.0 and prior:
1
"streamConfigs" : {
2
"realtime.segment.flush.threshold.size": "0",
3
"realtime.segment.flush.threshold.time": "24h",
4
"realtime.segment.flush.desired.size": "150M",
5
"streamType": "kafka",
6
"stream.kafka.consumer.type": "LowLevel",
7
"stream.kafka.topic.name": "ClickStream",
8
"stream.kafka.consumer.prop.auto.offset.reset" : "largest"
9
}
Copied!

Tenants

Property
Description
broker
Broker tenant in which the segment should reside
server
Server tenant in which the segment should reside
tagOverrideConfig
Override the tenant for segment if it fulfills certain conditions. Currently, only support override on realtimeConsuming or realtimeCompleted

Example

1
"broker": "brokerTenantName",
2
"server": "serverTenantName",
3
"tagOverrideConfig" : {
4
"realtimeConsuming" : "serverTenantName_REALTIME"
5
"realtimeCompleted" : "serverTenantName_OFFLINE"
6
}
7
}
Copied!

Environment Variables Override

Pinot allows users to define environment variables in the format of ${ENV_NAME} or ${ENV_NAME:DEFAULT_VALUE}as field values in table config.
Pinot instance will override it during runtime.
Brackets are required when defining the environment variable."$ENV_NAME"is not supported.
Environment variables used without default value in table config have to be available to all Pinot components - Controller, Broker, Server, and Minion. Otherwise, querying/consumption will be affected depending on the service to which these variables are not available.
Below is an example of setting AWS credential as part of table config using environment variable.
Example:
1
{
2
...
3
"ingestionConfig": {
4
"batchIngestionConfig": {
5
"segmentIngestionType": "APPEND",
6
"segmentIngestionFrequency": "DAILY",
7
"batchConfigMaps": [
8
{
9
"inputDirURI": "s3://<my-bucket>/baseballStats/rawdata",
10
"includeFileNamePattern": "glob:**/*.csv",
11
"excludeFileNamePattern": "glob:**/*.tmp",
12
"inputFormat": "csv",
13
"outputDirURI": "s3://<my-bucket>/baseballStats/segments",
14
"input.fs.className": "org.apache.pinot.plugin.filesystem.S3PinotFS",
15
"input.fs.prop.region": "us-west-2",
16
"input.fs.prop.accessKey": "${AWS_ACCESS_KEY}",
17
"input.fs.prop.secretKey": "${AWS_SECRET_KEY}",
18
"push.mode": "tar"
19
}
20
],
21
"segmentNameSpec": {},
22
"pushSpec": {}
23
}
24
},
25
...
26
}
Copied!

Sample Configurations

Offline Table

pinot-table-offline.json
1
"OFFLINE": {
2
"tableName": "pinotTable",
3
"tableType": "OFFLINE",
4
"quota": {
5
"maxQueriesPerSecond": 300,
6
"storage": "140G"
7
},
8
"routing": {
9
"segmentPrunerTypes": ["partition"],
10
"instanceSelectorType": "replicaGroup"
11
},
12
"segmentsConfig": {
13
"schemaName": "pinotTable",
14
"timeColumnName": "daysSinceEpoch",
15
"timeType": "DAYS",
16
"allowNullTimeValue": false,
17
"replication": "3",
18
"retentionTimeUnit": "DAYS",
19
"retentionTimeValue": "365",
20
"segmentPushFrequency": "DAILY",
21
"segmentPushType": "APPEND"
22
},
23
"tableIndexConfig": {
24
"invertedIndexColumns": ["foo", "bar", "moo"],
25
"createInvertedIndexDuringSegmentGeneration": false,
26
"sortedColumn": ["pk"],
27
"bloomFilterColumns": [],
28
"starTreeIndexConfigs": [],
29
"noDictionaryColumns": [],
30
"rangeIndexColumns": [],
31
"onHeapDictionaryColumns": [],
32
"varLengthDictionaryColumns": [],
33
"segmentPartitionConfig": {
34
"pk": {
35
"functionName": "Murmur",
36
"numPartitions": 32
37
}
38
}
39
"loadMode": "MMAP",
40
"columnMinMaxValueGeneratorMode": null,
41
"nullHandlingEnabled": false
42
},
43
"tenants": {
44
"broker": "myBrokerTenant",
45
"server": "myServerTenant"
46
},
47
"ingestionConfig": {
48
"filterConfig": {
49
"filterFunction": "Groovy({foo == \"VALUE1\"}, foo)"
50
},
51
"transformConfigs": [{
52
"columnName": "bar",
53
"transformFunction": "lower(moo)"
54
},
55
{
56
"columnName": "hoursSinceEpoch",
57
"transformFunction": "toEpochHours(millis)"
58
}]
59
}
60
"metadata": {
61
"customConfigs": {
62
"key": "value",
63
"key": "value"
64
}
65
}
66
}
67
}
Copied!

Realtime Table

Here's an example table config for a realtime table. All the fields from the offline table config are valid for the realtime table. Additionally, realtime tables use some extra fields.
pinot-table-realtime.json
1
"REALTIME": {
2
"tableName": "pinotTable",
3
"tableType": "REALTIME",
4
"segmentsConfig": {
5
"schemaName": "pinotTable",
6
"timeColumnName": "daysSinceEpoch",
7
"timeType": "DAYS",
8
"allowNullTimeValue": true,
9
"replicasPerPartition": "3",
10
"retentionTimeUnit": "DAYS",
11
"retentionTimeValue": "5",
12
"segmentPushType": "APPEND",
13
"completionConfig": {
14
"completionMode": "DOWNLOAD"
15
}
16
},
17
"tableIndexConfig": {
18
"invertedIndexColumns": ["foo", "bar", "moo"],
19
"sortedColumn": ["column1"],
20
"noDictionaryColumns": ["metric1", "metric2"],
21
"loadMode": "MMAP",
22
"aggregateMetrics": true,
23
"nullHandlingEnabled": false,
24
"streamConfigs": {
25
"realtime.segment.flush.threshold.size": "0",
26
"realtime.segment.flush.threshold.time": "24h",
27
"realtime.segment.flush.desired.size": "150M",
28
"stream.kafka.broker.list": "XXXX",
29
"stream.kafka.consumer.factory.class.name": "XXXX",
30
"stream.kafka.consumer.prop.auto.offset.reset": "largest",
31
"stream.kafka.consumer.type": "XXXX",
32
"stream.kafka.decoder.class.name": "XXXX",
33
"stream.kafka.decoder.prop.schema.registry.rest.url": "XXXX",
34
"stream.kafka.decoder.prop.schema.registry.schema.name": "XXXX",
35
"stream.kafka.hlc.zk.connect.string": "XXXX",
36
"stream.kafka.topic.name": "XXXX",
37
"stream.kafka.zk.broker.url": "XXXX",
38
"streamType": "kafka"
39
}
40
},
41
"tenants": {
42
"broker": "myBrokerTenant",
43
"server": "myServerTenant",
44
"tagOverrideConfig": {}
45
},
46
"metadata": {
47
}
48
}
Copied!
Last modified 1mo ago