File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -3289,6 +3289,30 @@ def write_fragments(target_path):
32893289 fi = tiledb .array_fragments (path3 )
32903290 self .assertEqual (fi .unconsolidated_metadata_num , 0 )
32913291
3292+ # array #4
3293+ path4 = self .path ("test_array_vacuum_commits" )
3294+ create_array (path4 )
3295+ write_fragments (path4 )
3296+
3297+ fi = tiledb .array_fragments (path4 )
3298+ # Count the number of files that are present under __commits folder of the array
3299+ # Should be equal to the number of writes
3300+ self .assertEqual (len (os .listdir (os .path .join (path4 , "__commits" ))), num_writes )
3301+ tiledb .consolidate (
3302+ path4 ,
3303+ ctx = tiledb .Ctx (config = tiledb .Config ({"sm.consolidation.mode" : "commits" })),
3304+ )
3305+ # Should be +1 after consolidation
3306+ self .assertEqual (
3307+ len (os .listdir (os .path .join (path4 , "__commits" ))), num_writes + 1
3308+ )
3309+
3310+ tiledb .vacuum (
3311+ path4 , ctx = tiledb .Ctx (config = tiledb .Config ({"sm.vacuum.mode" : "commits" }))
3312+ )
3313+ # After vacuuming should be just 1
3314+ self .assertEqual (len (os .listdir (os .path .join (path4 , "__commits" ))), 1 )
3315+
32923316 def test_array_consolidate_with_timestamp (self ):
32933317 dshape = (1 , 3 )
32943318 num_writes = 10
You can’t perform that action at this time.
0 commit comments