# Druid 加载 Kafka 流数据的 索引属性（IndexSpec）

**URL:** <https://www.isharkfly.com/t/druid-kafka-indexspec/13673>\
**Category:** BigData\
**Tags:** druid\
**Created:** [August 11, 2021, 6:54pm UTC](https://www.isharkfly.com/t/druid-kafka-indexspec/13673 "2021-08-11T18:54:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [August 11, 2021, 6:54pm UTC](https://www.isharkfly.com/t/druid-kafka-indexspec/13673/1 "2021-08-11T18:54:33Z")

</div>

下面的表格主要对加载 Kafka 流数据的索引属性进行参数描述。

![wide2-1024x482](https://www.isharkfly.com/images/transparent.png)

| 字段（Field） | 类型（Type） | 描述（Description） | 是否必须（Required） |
| --- | --- | --- | --- |
| bitmap | Object | 针对 bitmap indexes 使用的是压缩格式。应该是一个 JSON 对象，请参考 [Bitmap types](https://druid.ossez.com/#/development/extensions-core/kafka-ingestion?id=bitmap-types) 来了解更多 | N（默认=Roaring） |
| dimensionCompression | String | 针对维度（dimension）列使用的压缩算法，请从 `LZ4，` `LZF，`或者 `uncompressed 中选择。` | N（默认= `LZ4）` |
| metricCompression | String | 针对主要类型 metric 列使用的压缩算法，请从 `LZ4，` `LZF，`或者 `uncompressed 中选择。` | N（默认= `LZ4）` |
| longEncoding | String | 类型为 long 的 metric 列和 维度（dimension）的编码格式。从 `auto` 或 `long` 中进行选择。`auto` 编码是根据列基数使用偏移量或查找表对值进行编码，并以可变大小存储它们。`longs` 将会按照，每个值 8 字节来进行存储。 | N（默认= `longs`) |
