pub struct MicroDataCollection {
pub name: String,
pub record_hierarchy: RecordHierarchy,
pub record_types: HashMap<String, RecordType>,
pub default_unit_of_analysis: RecordType,
pub metadata: Option<MetadataEntities>,
}
Expand description
Key characteristics of data collections
Fields§
§name: String
§record_hierarchy: RecordHierarchy
§record_types: HashMap<String, RecordType>
§default_unit_of_analysis: RecordType
§metadata: Option<MetadataEntities>
Implementations§
Source§impl MicroDataCollection
impl MicroDataCollection
pub fn weight_for_rectype(&self, rt: &str) -> Option<String>
pub fn sample_line_weight_for_rectype(&self, rt: &str) -> Option<String>
pub fn weight_divisor(&self, rt: &str) -> Option<usize>
pub fn sample_line_weight_divisor(&self, rt: &str) -> Option<usize>
pub fn base_filename_for_dataset(&self, dataset_name: &str) -> String
pub fn base_filename_for_dataset_and_rectype( &self, dataset_name: &str, record_type_abbrev: &str, ) -> String
pub fn default_table_name( &self, dataset_name: &str, record_type_abbrev: &str, ) -> Result<String, MdError>
Sourcepub fn load_metadata_from_layout(&mut self, _layout_file: &Path)
pub fn load_metadata_from_layout(&mut self, _layout_file: &Path)
Read one fixed-width layout file. These files contain some variable level metadata for every record type in the data product.
Sourcepub fn load_metadata_from_all_layouts(&mut self, _layouts_dir: &Path)
pub fn load_metadata_from_all_layouts(&mut self, _layouts_dir: &Path)
Read all layout files for the data root like ../output_data/current/layouts
The existence of a layout file implies existence of a dataset. The presence of
a variable in a dataset’s layout indicates availability in that dataset.
Sourcepub fn load_metadata_from_parquet(&mut self, _parquet_dataset_path: &Path)
pub fn load_metadata_from_parquet(&mut self, _parquet_dataset_path: &Path)
The path like ../output_data/current/parquet/us2019a/
Reading the schema will give approximately the same metadata information
as reading the fixed-width layout file for the same dataset.
Sourcepub fn load_metadata_for_selected_datasets_from_layouts(
&mut self,
datasets: &[&str],
data_root: &Path,
) -> Result<(), MdError>
pub fn load_metadata_for_selected_datasets_from_layouts( &mut self, datasets: &[&str], data_root: &Path, ) -> Result<(), MdError>
Using the data_root, scan the layouts and load metadata from them.
Sourcepub fn load_full_metadata_for_datasets(&mut self, _datasets: &[String])
pub fn load_full_metadata_for_datasets(&mut self, _datasets: &[String])
Uses default product_root to find metadata database and load all metadata for given datasets.
Sourcepub fn load_metadata_from_all_parquet(&mut self, _parquet_path: &Path)
pub fn load_metadata_from_all_parquet(&mut self, _parquet_path: &Path)
Takes a path like ../output_data/current/parquet/, which could be derived automatically from defaults based on data root or product root. Scans all parquet schema information.
Sourcepub fn load_full_metadata_for_selections(
&mut self,
_variables: &[String],
_datasets: &[String],
_metadata_location: Option<PathBuf>,
)
pub fn load_full_metadata_for_selections( &mut self, _variables: &[String], _datasets: &[String], _metadata_location: Option<PathBuf>, )
Load everything available for the selected variables and samples from the available metadata database file. Requires ‘allow_full_metadata’ which depends on a product root and a ‘metadata.db’ file located in the root/metadata/versions location, unless you provide a Some(metadata_location).
Sourcepub fn load_full_metadata(&mut self, _metadata_location: Option<PathBuf>)
pub fn load_full_metadata(&mut self, _metadata_location: Option<PathBuf>)
Load all variables and samples for the context and the default metadata location unless you provide Some(metadata_location) to override the default. The result of the load may be very large, into the gigabyte range.
pub fn clear_metadata(&mut self)
Trait Implementations§
Source§impl Clone for MicroDataCollection
impl Clone for MicroDataCollection
Source§fn clone(&self) -> MicroDataCollection
fn clone(&self) -> MicroDataCollection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more