Search in sources :

Example 1 with TableProviderFacet

use of io.openlineage.spark.agent.facets.TableProviderFacet in project OpenLineage by OpenLineage.

the class PlanUtils3Test method testIncludeProviderFacet.

@Test
public void testIncludeProviderFacet() {
    try (MockedStatic<CatalogUtils3> mocked = mockStatic(CatalogUtils3.class)) {
        Map<String, OpenLineage.DatasetFacet> facets = new HashMap<>();
        TableProviderFacet tableProviderFacet = new TableProviderFacet("iceberg", "parquet");
        when(CatalogUtils3.getTableProviderFacet(tableCatalog, tableProperties)).thenReturn(Optional.of(tableProviderFacet));
        PlanUtils3.includeProviderFacet(tableCatalog, tableProperties, facets);
        assertEquals(tableProviderFacet, facets.get("tableProvider"));
    }
}
Also used : HashMap(java.util.HashMap) CatalogUtils3(io.openlineage.spark3.agent.lifecycle.plan.catalog.CatalogUtils3) TableProviderFacet(io.openlineage.spark.agent.facets.TableProviderFacet) Test(org.junit.jupiter.api.Test)

Aggregations

TableProviderFacet (io.openlineage.spark.agent.facets.TableProviderFacet)1 CatalogUtils3 (io.openlineage.spark3.agent.lifecycle.plan.catalog.CatalogUtils3)1 HashMap (java.util.HashMap)1 Test (org.junit.jupiter.api.Test)1