Skip to content

Commit 360b46c

Browse files
authored
Use delta encoding for timestamp (#341)
1 parent 30b4353 commit 360b46c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

server/src/storage/object_storage.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ use crate::{
3232
use actix_web_prometheus::PrometheusMetrics;
3333
use async_trait::async_trait;
3434
use bytes::Bytes;
35-
use datafusion::arrow::datatypes::Schema;
35+
use datafusion::{
36+
arrow::datatypes::Schema,
37+
parquet::{basic::Encoding, schema::types::ColumnPath},
38+
};
3639
use datafusion::{
3740
arrow::{
3841
array::TimestampMillisecondArray, ipc::reader::StreamReader, record_batch::RecordBatch,
@@ -324,6 +327,10 @@ pub trait ObjectStorage: Sync + 'static {
324327
let props = WriterProperties::builder()
325328
.set_max_row_group_size(CONFIG.parseable.row_group_size)
326329
.set_compression(CONFIG.parseable.parquet_compression.into())
330+
.set_column_encoding(
331+
ColumnPath::new(vec!["p_timestamp".to_string()]),
332+
Encoding::DELTA_BINARY_PACKED,
333+
)
327334
.build();
328335
let schema = Arc::new(record_reader.merged_schema());
329336
let mut writer = ArrowWriter::try_new(parquet_file, schema.clone(), Some(props))?;

0 commit comments

Comments
 (0)