-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support metadata table "Metadata Log Entries" #846
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1002,19 +1002,21 @@ pub mod tests { | |
let table_location = tmp_dir.path().join("table1"); | ||
let manifest_list1_location = table_location.join("metadata/manifests_list_1.avro"); | ||
let manifest_list2_location = table_location.join("metadata/manifests_list_2.avro"); | ||
// This is a past metadata location in the metadata log | ||
let table_metadata1_location = table_location.join("metadata/v1.json"); | ||
// This is the actual location of current metadata | ||
let template_json_location = format!( | ||
"{}/testdata/example_table_metadata_v2.json", | ||
env!("CARGO_MANIFEST_DIR") | ||
); | ||
|
||
let file_io = FileIO::from_path(table_location.as_os_str().to_str().unwrap()) | ||
.unwrap() | ||
.build() | ||
.unwrap(); | ||
|
||
let table_metadata = { | ||
let template_json_str = fs::read_to_string(format!( | ||
"{}/testdata/example_table_metadata_v2.json", | ||
env!("CARGO_MANIFEST_DIR") | ||
)) | ||
.unwrap(); | ||
let template_json_str = fs::read_to_string(&template_json_location).unwrap(); | ||
let mut context = Context::new(); | ||
context.insert("table_location", &table_location); | ||
context.insert("manifest_list_1_location", &manifest_list1_location); | ||
|
@@ -1029,7 +1031,7 @@ pub mod tests { | |
.metadata(table_metadata) | ||
.identifier(TableIdent::from_strs(["db", "table1"]).unwrap()) | ||
.file_io(file_io.clone()) | ||
.metadata_location(table_metadata1_location.as_os_str().to_str().unwrap()) | ||
.metadata_location(template_json_location) | ||
Comment on lines
-1032
to
+1034
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before this change, the location in the metadata log and the current location would both be I wanted to have a distinction so we can assert that |
||
.build() | ||
.unwrap(); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ use std::sync::Arc; | |
use crate::arrow::ArrowReaderBuilder; | ||
use crate::io::object_cache::ObjectCache; | ||
use crate::io::FileIO; | ||
use crate::metadata_scan::MetadataTable; | ||
use crate::metadata_table::MetadataTable; | ||
use crate::scan::TableScanBuilder; | ||
use crate::spec::{TableMetadata, TableMetadataRef}; | ||
use crate::{Error, ErrorKind, Result, TableIdent}; | ||
|
@@ -203,7 +203,7 @@ impl Table { | |
|
||
/// Creates a metadata table which provides table-like APIs for inspecting metadata. | ||
/// See [`MetadataTable`] for more details. | ||
pub fn metadata_table(self) -> MetadataTable { | ||
pub fn metadata_table(&self) -> MetadataTable<'_> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Follow-up to this comment: #822 (comment) Also not necessary to do in this PR. |
||
MetadataTable::new(self) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow-up to this comment: #822 (comment)
Don't need to do in this PR. Up to you.