@@ -290,3 +290,24 @@ dt2 = SQLite.query(db, "Select * from temp")
290
290
# There might be a better way to check this
291
291
@test dt. data[1 ][1 ]. value== dt2. data[1 ][1 ]. value
292
292
@test dt. data[1 ][2 ]. isnull== dt2. data[1 ][2 ]. isnull
293
+
294
+ # Test removeduplicates!
295
+ db = SQLite. DB () # In case the order of tests is changed
296
+ ints = Int64[1 ,1 ,2 ,2 ,3 ]
297
+ strs = UTF8String[" A" , " A" , " B" , " C" , " C" ]
298
+ nvInts = NullableArrays. NullableArray (ints)
299
+ nvStrs = NullableArrays. NullableArray (strs)
300
+ schema = DataStreams. Data. Schema ([" ints" , " strs" ], [Int64, UTF8String],5 )
301
+ d = NullableArrays. NullableVector[nvInts, nvStrs]
302
+ dt = DataStreams. Data. Table (schema, d,0 )
303
+ SQLite. drop! (db, " temp" , ifexists= true )
304
+ sink = SQLite. Sink (dt, db, " temp" )
305
+ Data. stream! (dt, sink)
306
+ SQLite. removeduplicates! (db, " temp" , [" ints" ," strs" ]) # New format
307
+ dt3 = SQLite. query (db, " Select * from temp" )
308
+ @test get (dt3[1 ,1 ]) == 1
309
+ @test get (dt3[1 ,2 ]) == " A"
310
+ @test get (dt3[2 ,1 ]) == 2
311
+ @test get (dt3[2 ,2 ]) == " B"
312
+ @test get (dt3[3 ,1 ]) == 2
313
+ @test get (dt3[3 ,2 ]) == " C"
0 commit comments