File tree 2 files changed +57
-0
lines changed
2 files changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ humantime = { version = "2.1.0" }
100
100
[dev-dependencies ]
101
101
criterion = " 0.5"
102
102
ctor = " 0"
103
+ datatest-stable = " 0.2"
103
104
deltalake-test = { path = " ../test" , features = [" datafusion" ] }
104
105
dotenvy = " 0"
105
106
fs_extra = " 1.2.0"
@@ -134,3 +135,7 @@ cloud = ["object_store/cloud"]
134
135
135
136
# enable caching some file I/O operations when scanning delta logs
136
137
delta-cache = [" foyer" , " tempfile" , " url/serde" ]
138
+
139
+ [[test ]]
140
+ name = " dat"
141
+ harness = false
Original file line number Diff line number Diff line change
1
+ use std:: path:: Path ;
2
+
3
+ use deltalake_core:: DeltaTableBuilder ;
4
+ use deltalake_test:: acceptance:: read_dat_case;
5
+
6
+ static SKIPPED_TESTS : & [ & str ; 4 ] = & [
7
+ "iceberg_compat_v1" ,
8
+ "column_mapping" ,
9
+ "check_constraints" ,
10
+ "deletion_vectors" ,
11
+ ] ;
12
+
13
+ fn reader_test_eager ( path : & Path ) -> datatest_stable:: Result < ( ) > {
14
+ let root_dir = format ! (
15
+ "{}/{}" ,
16
+ env![ "CARGO_MANIFEST_DIR" ] ,
17
+ path. parent( ) . unwrap( ) . to_str( ) . unwrap( )
18
+ ) ;
19
+ for skipped in SKIPPED_TESTS {
20
+ if root_dir. ends_with ( skipped) {
21
+ println ! ( "Skipping test: {}" , skipped) ;
22
+ return Ok ( ( ) ) ;
23
+ }
24
+ }
25
+
26
+ tokio:: runtime:: Builder :: new_current_thread ( )
27
+ . enable_all ( )
28
+ . build ( ) ?
29
+ . block_on ( async {
30
+ let case = read_dat_case ( root_dir) . unwrap ( ) ;
31
+
32
+ let table = DeltaTableBuilder :: from_uri ( case. table_root ( ) . unwrap ( ) )
33
+ . load ( )
34
+ . await
35
+ . expect ( "table" ) ;
36
+ let table_info = case. table_summary ( ) . expect ( "load summary" ) ;
37
+ let snapshot = table. snapshot ( ) . expect ( "Failed to load snapshot" ) ;
38
+ let protocol = table. protocol ( ) . expect ( "Failed to load protocol" ) ;
39
+ assert_eq ! ( snapshot. version( ) as u64 , table_info. version) ;
40
+ assert_eq ! (
41
+ ( protocol. min_reader_version, protocol. min_writer_version) ,
42
+ ( table_info. min_reader_version, table_info. min_writer_version)
43
+ ) ;
44
+ } ) ;
45
+ Ok ( ( ) )
46
+ }
47
+
48
+ datatest_stable:: harness!(
49
+ reader_test_eager,
50
+ "../../dat/v0.0.3/reader_tests/generated/" ,
51
+ r"test_case_info\.json"
52
+ ) ;
You can’t perform that action at this time.
0 commit comments