Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
duhizjame committed Jan 29, 2024
1 parent ac9b809 commit dc4c4ed
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class ITDeltaSharingClient implements DatasetComparer, ScalaUtils {
private final StorageManagerInitializer storageManagerInitializer;
private final String deltaTablePath;


public ITDeltaSharingClient() {
this.storageManagerInitializer = new StorageManagerInitializer();
this.deltaTablePath =
Expand Down Expand Up @@ -59,6 +60,30 @@ void showS3Table1withQueryTableApi() {
assertSmallDatasetEquality(ds, expectedData, true, false, false, 500);
}

@Test
void showS3IcebergTableWithQueryTableApi() {
var spark = TestSparkSession.newSparkSession();
registerAnIcebergTable();
var ds = spark.read().format("deltaSharing").load(deltaTablePath);
var expectedSchema = new StructType(new StructField[] {
new StructField("id", DataType.fromDDL("long"), true, new Metadata(emptyScalaMap()))
});
var expectedData = spark
.createDataFrame(
List.of(
new MrFoxDeltaTableSchema(0),
new MrFoxDeltaTableSchema(3),
new MrFoxDeltaTableSchema(2),
new MrFoxDeltaTableSchema(1),
new MrFoxDeltaTableSchema(4)),
MrFoxDeltaTableSchema.class)
.toDF();

assertEquals(expectedSchema, ds.schema());
assertEquals(5, ds.count());
assertSmallDatasetEquality(ds, expectedData, true, false, false, 500);
}

@Test
void registerAnIcebergTable() {
TableInfo tableInfo = storageManagerInitializer.createIcebergTableWithGlueMetastore();
Expand Down

0 comments on commit dc4c4ed

Please sign in to comment.