Skip to content

Commit

Permalink
Add DataBackendSession file sort order
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Oct 14, 2023
1 parent e54d8b9 commit 92c9763
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion nautilus_core/persistence/src/backend/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
use std::{collections::HashMap, sync::Arc, vec::IntoIter};

use compare::Compare;
use datafusion::{error::Result, physical_plan::SendableRecordBatchStream, prelude::*};
use datafusion::{
error::Result,
logical_expr::{col, expr::Sort},
physical_plan::SendableRecordBatchStream,
prelude::*,
};
use futures::StreamExt;
use nautilus_core::{cvec::CVec, python::to_pyruntime_err};
use nautilus_model::data::{
Expand Down Expand Up @@ -112,6 +117,11 @@ impl DataBackendSession {
{
let parquet_options = ParquetReadOptions::<'_> {
skip_metadata: Some(false),
file_sort_order: vec![vec![Expr::Sort(Sort {
expr: Box::new(col("ts_init")),
asc: true,
nulls_first: true,
})]],
..Default::default()
};
self.runtime.block_on(self.session_ctx.register_parquet(
Expand Down

0 comments on commit 92c9763

Please sign in to comment.