Skip to content

Commit 2ea2cbf

Browse files
committed
Removing functions not needed.
1 parent 02feaca commit 2ea2cbf

2 files changed

Lines changed: 0 additions & 113 deletions

File tree

extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/IcebergCatalog.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -169,21 +169,4 @@ public List<String> extractSnapshotDataFiles(
169169
}
170170
return dataFilePaths;
171171
}
172-
173-
public List<String> extractSnapshotDataFiles(
174-
String tableNamespace,
175-
String tableName,
176-
IcebergFilter icebergFilter,
177-
DateTime snapshotTime,
178-
ResidualFilterMode residualFilterMode
179-
) {
180-
return extractSnapshotDataFiles(
181-
tableNamespace,
182-
tableName,
183-
icebergFilter,
184-
snapshotTime,
185-
residualFilterMode,
186-
null
187-
);
188-
}
189172
}

extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/IcebergInputSourceTest.java

Lines changed: 0 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -405,102 +405,6 @@ public void testResidualFilterModeFailWithPartitionedTableNonPartitionColumn() t
405405
);
406406
}
407407

408-
@Test
409-
public void testInputSourceWithColumnProjection() throws IOException
410-
{
411-
IcebergInputSource inputSource = new IcebergInputSource(
412-
TABLENAME,
413-
NAMESPACE,
414-
null,
415-
testCatalog,
416-
new LocalInputSourceFactory(),
417-
null,
418-
null
419-
);
420-
Stream<InputSplit<List<String>>> splits = inputSource.createSplits(null, new MaxSizeSplitHintSpec(null, null));
421-
List<File> localInputSourceList = splits.map(inputSource::withSplit)
422-
.map(inpSource -> (LocalInputSource) inpSource)
423-
.map(LocalInputSource::getFiles)
424-
.flatMap(List::stream)
425-
.collect(Collectors.toList());
426-
427-
Assert.assertEquals(1, inputSource.estimateNumSplits(null, new MaxSizeSplitHintSpec(1L, null)));
428-
Assert.assertEquals(1, localInputSourceList.size());
429-
430-
// First, read all columns without projection
431-
List<Record> allRecords = new ArrayList<>();
432-
CloseableIterable<Record> fullDataReader = Parquet.read(Files.localInput(localInputSourceList.get(0)))
433-
.project(tableSchema)
434-
.createReaderFunc(fileSchema -> GenericParquetReaders.buildReader(
435-
tableSchema,
436-
fileSchema
437-
))
438-
.build();
439-
440-
for (Record record : fullDataReader) {
441-
allRecords.add(record);
442-
}
443-
fullDataReader.close();
444-
445-
Assert.assertEquals(1, allRecords.size());
446-
Record fullRecord = allRecords.get(0);
447-
Assert.assertEquals(2, fullRecord.size()); // Should have 2 columns
448-
Assert.assertEquals(tableData.get("id"), fullRecord.get(0));
449-
Assert.assertEquals(tableData.get("name"), fullRecord.get(1));
450-
451-
// Read with projection - only 'id' column
452-
453-
// Create schema with only the 'id' column for projection
454-
Schema idProjectedSchema = new Schema(
455-
Types.NestedField.required(1, "id", Types.StringType.get())
456-
);
457-
458-
List<Record> idProjectedRecords = new ArrayList<>();
459-
CloseableIterable<Record> idProjectedReader = Parquet.read(Files.localInput(localInputSourceList.get(0)))
460-
.project(idProjectedSchema)
461-
.createReaderFunc(fileSchema -> GenericParquetReaders.buildReader(
462-
idProjectedSchema,
463-
fileSchema
464-
))
465-
.build();
466-
467-
for (Record record : idProjectedReader) {
468-
idProjectedRecords.add(record);
469-
}
470-
idProjectedReader.close();
471-
472-
Assert.assertEquals(1, idProjectedRecords.size());
473-
Record idRecord = idProjectedRecords.get(0);
474-
Assert.assertEquals(1, idRecord.size()); // Should have only 1 column
475-
Assert.assertEquals(fullRecord.get(0), idRecord.get(0)); // Id should match full record
476-
477-
// Read with projection - only 'name' column
478-
479-
// Create schema with only the 'name' column for projection
480-
Schema nameProjectedSchema = new Schema(
481-
Types.NestedField.required(2, "name", Types.StringType.get())
482-
);
483-
484-
List<Record> nameProjectedRecords = new ArrayList<>();
485-
CloseableIterable<Record> nameProjectedReader = Parquet.read(Files.localInput(localInputSourceList.get(0)))
486-
.project(nameProjectedSchema)
487-
.createReaderFunc(fileSchema -> GenericParquetReaders.buildReader(
488-
nameProjectedSchema,
489-
fileSchema
490-
))
491-
.build();
492-
493-
for (Record record : nameProjectedReader) {
494-
nameProjectedRecords.add(record);
495-
}
496-
nameProjectedReader.close();
497-
498-
Assert.assertEquals(1, nameProjectedRecords.size());
499-
Record nameRecord = nameProjectedRecords.get(0);
500-
Assert.assertEquals(1, nameRecord.size()); // Should have only 1 column
501-
Assert.assertEquals(fullRecord.get(1), nameRecord.get(0)); // Name should match full record
502-
}
503-
504408
@After
505409
public void tearDown()
506410
{

0 commit comments

Comments
 (0)