@@ -38,6 +38,7 @@ use parquet::{
38
38
} ;
39
39
40
40
use crate :: {
41
+ event:: DEFAULT_TIMESTAMP_KEY ,
41
42
metrics,
42
43
option:: CONFIG ,
43
44
storage:: OBJECT_STORE_DATA_GRANULARITY ,
@@ -47,6 +48,9 @@ use crate::{
47
48
} ,
48
49
} ;
49
50
51
+ const ARROW_FILE_EXTENSION : & str = "data.arrows" ;
52
+ const PARQUET_FILE_EXTENSION : & str = "data.parquet" ;
53
+
50
54
// in mem global that hold all the in mem buffer that are ready to convert
51
55
pub static MEMORY_READ_BUFFERS : Lazy < RwLock < HashMap < String , Vec < ReadBuf > > > > =
52
56
Lazy :: new ( RwLock :: default) ;
@@ -93,7 +97,7 @@ impl StorageDir {
93
97
format ! (
94
98
"{}.{}" ,
95
99
stream_hash,
96
- Self :: file_time_suffix( time, "data.arrows" )
100
+ Self :: file_time_suffix( time, ARROW_FILE_EXTENSION )
97
101
)
98
102
}
99
103
@@ -140,8 +144,8 @@ impl StorageDir {
140
144
& self ,
141
145
exclude : NaiveDateTime ,
142
146
) -> HashMap < PathBuf , Vec < PathBuf > > {
143
- let hot_filename = StorageDir :: file_time_suffix ( exclude, "data.arrow" ) ;
144
- // hashmap <time, vec[paths]> but exclude where hotfilename matches
147
+ let hot_filename = StorageDir :: file_time_suffix ( exclude, ARROW_FILE_EXTENSION ) ;
148
+ // hashmap <time, vec[paths]> but exclude where hot filename matches
145
149
let mut grouped_arrow_file: HashMap < PathBuf , Vec < PathBuf > > = HashMap :: new ( ) ;
146
150
let mut arrow_files = self . arrow_files ( ) ;
147
151
arrow_files. retain ( |path| {
@@ -185,7 +189,7 @@ impl StorageDir {
185
189
186
190
pub fn to_parquet_path ( stream_name : & str , time : NaiveDateTime ) -> PathBuf {
187
191
let data_path = CONFIG . parseable . local_stream_data_path ( stream_name) ;
188
- let dir = StorageDir :: file_time_suffix ( time, "data.parquet" ) ;
192
+ let dir = StorageDir :: file_time_suffix ( time, PARQUET_FILE_EXTENSION ) ;
189
193
190
194
data_path. join ( dir)
191
195
}
@@ -278,7 +282,7 @@ fn parquet_writer_props() -> WriterPropertiesBuilder {
278
282
. set_max_row_group_size ( CONFIG . parseable . row_group_size )
279
283
. set_compression ( CONFIG . parseable . parquet_compression . into ( ) )
280
284
. set_column_encoding (
281
- ColumnPath :: new ( vec ! [ "p_timestamp" . to_string( ) ] ) ,
285
+ ColumnPath :: new ( vec ! [ DEFAULT_TIMESTAMP_KEY . to_string( ) ] ) ,
282
286
Encoding :: DELTA_BINARY_PACKED ,
283
287
)
284
288
}
0 commit comments