Skip to content

Commit

Permalink
make partial collections of multi datasets idempotent
Browse files Browse the repository at this point in the history
  • Loading branch information
sslivkoff committed Jan 22, 2024
1 parent 21503ed commit 0a36dac
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
16 changes: 8 additions & 8 deletions crates/freeze/src/multi_datasets/state_reads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ impl CollectByBlock for StateReads {
query.schemas.get(&Datatype::NonceReads),
query.schemas.get(&Datatype::StorageReads),
) {
(Some(schema), _, _, _)
| (_, Some(schema), _, _)
| (_, _, Some(schema), _)
| (_, _, _, Some(schema)) => schema.has_column("transaction_hash"),
(Some(schema), _, _, _) |
(_, Some(schema), _, _) |
(_, _, Some(schema), _) |
(_, _, _, Some(schema)) => schema.has_column("transaction_hash"),
_ => false,
};
source.geth_debug_trace_block_prestate(request.block_number()? as u32, include_txs).await
Expand All @@ -74,10 +74,10 @@ impl CollectByTransaction for StateReads {
query.schemas.get(&Datatype::NonceReads),
query.schemas.get(&Datatype::StorageReads),
) {
(Some(schema), _, _, _)
| (_, Some(schema), _, _)
| (_, _, Some(schema), _)
| (_, _, _, Some(schema)) => schema.has_column("block_number"),
(Some(schema), _, _, _) |
(_, Some(schema), _, _) |
(_, _, Some(schema), _) |
(_, _, _, Some(schema)) => schema.has_column("block_number"),
_ => false,
};
let tx = request.transaction_hash()?;
Expand Down
4 changes: 3 additions & 1 deletion crates/freeze/src/types/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ impl FileOutput {
};
for meta_datatype in meta_datatypes.iter() {
for datatype in meta_datatype.datatypes().into_iter() {
paths.insert(datatype, self.get_path(query, partition, datatype)?);
if query.schemas.get(&datatype).is_some() {
paths.insert(datatype, self.get_path(query, partition, datatype)?);
}
}
}
Ok(paths)
Expand Down
5 changes: 2 additions & 3 deletions crates/freeze/src/types/summaries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ use colored::Colorize;
use thousands::Separable;

use crate::{
chunks::chunk_ops::ValueToString, ChunkData, ChunkStats, CollectError, ColumnType,
Datatype, Dim, ExecutionEnv, FileOutput, MetaDatatype, MultiDatatype, Partition, Query, Source,
Table,
chunks::chunk_ops::ValueToString, ChunkData, ChunkStats, CollectError, ColumnType, Datatype,
Dim, ExecutionEnv, FileOutput, MetaDatatype, MultiDatatype, Partition, Query, Source, Table,
};
use std::path::PathBuf;

Expand Down

0 comments on commit 0a36dac

Please sign in to comment.