@@ -93,7 +93,7 @@ void testTieringWriteTable(boolean isPartitioned) throws Exception {
9393 customProperties ,
9494 tablePath .getDatabaseName (),
9595 tablePath .getTableName ());
96- Schema schema = createTable (tablePath , isPartitioned , null , config );
96+ Schema schema = createTable (config );
9797
9898 List <LanceWriteResult > lanceWriteResults = new ArrayList <>();
9999 SimpleVersionedSerializer <LanceWriteResult > writeResultSerializer =
@@ -118,7 +118,7 @@ void testTieringWriteTable(boolean isPartitioned) throws Exception {
118118 }
119119 }
120120 : Collections .singletonMap (null , null );
121- List <String > partitionKeys = new ArrayList <>( partitionIdAndName . values ()) ;
121+ List <String > partitionKeys = isPartitioned ? List . of ( "c3" ) : null ;
122122 Map <TableBucket , Long > tableBucketOffsets = new HashMap <>();
123123 // first, write data
124124 for (int bucket = 0 ; bucket < bucketNum ; bucket ++) {
@@ -196,8 +196,8 @@ void testTieringWriteTable(boolean isPartitioned) throws Exception {
196196 Map <Tuple2 <Long , Integer >, Long > offsets = committedLakeSnapshot .getLogEndOffsets ();
197197 for (int bucket = 0 ; bucket < 3 ; bucket ++) {
198198 for (Long partitionId : partitionIdAndName .keySet ()) {
199- // we only write 10 records, so expected log offset should be 9
200- assertThat (offsets .get (Tuple2 .of (partitionId , bucket ))).isEqualTo (9 );
199+ // we only write 10 records, so expected log offset should be 10
200+ assertThat (offsets .get (Tuple2 .of (partitionId , bucket ))).isEqualTo (10 );
201201 }
202202 }
203203 assertThat (committedLakeSnapshot .getLakeSnapshotId ()).isOne ();
@@ -303,24 +303,18 @@ private Tuple2<List<LogRecord>, List<LogRecord>> genLogTableRecords(
303303 return Tuple2 .of (logRecords , logRecords );
304304 }
305305
306- private Schema createTable (
307- TablePath tablePath ,
308- boolean isPartitioned ,
309- @ Nullable Integer numBuckets ,
310- LanceConfig config )
311- throws Exception {
306+ private Schema createTable (LanceConfig config ) throws Exception {
312307 List <Schema .Column > columns = new ArrayList <>();
313308 columns .add (new Schema .Column ("c1" , DataTypes .INT ()));
314309 columns .add (new Schema .Column ("c2" , DataTypes .STRING ()));
315310 columns .add (new Schema .Column ("c3" , DataTypes .STRING ()));
316311 Schema .Builder schemaBuilder = Schema .newBuilder ().fromColumns (columns );
317312 Schema schema = schemaBuilder .build ();
318- doCreateLanceTable (tablePath , schema , config );
313+ doCreateLanceTable (schema , config );
319314 return schema ;
320315 }
321316
322- private void doCreateLanceTable (TablePath tablePath , Schema schema , LanceConfig config )
323- throws Exception {
317+ private void doCreateLanceTable (Schema schema , LanceConfig config ) throws Exception {
324318 WriteParams params = LanceConfig .genWriteParamsFromConfig (config );
325319 LanceDatasetAdapter .createDataset (
326320 config .getDatasetUri (), LanceArrowUtils .toArrowSchema (schema .getRowType ()), params );
0 commit comments