Skip to content

Commit

Permalink
Fix dataset Reference to have dataset optional properties
Browse files Browse the repository at this point in the history
  • Loading branch information
prasar-ashutosh committed Oct 29, 2024
1 parent d6dd8d5 commit 60c3282
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import org.immutables.value.Value.Immutable;
import org.immutables.value.Value.Style;

import java.util.Optional;

@Immutable
@Style(
typeAbstract = "*Abstract",
Expand All @@ -27,4 +29,5 @@
)
public interface DatasetReferenceImplAbstract extends DatasetReference
{
Optional<DatasetAdditionalProperties> datasetAdditionalProperties();
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
import org.finos.legend.engine.persistence.components.ingestmode.audit.DateTimeAuditing;
import org.finos.legend.engine.persistence.components.ingestmode.deduplication.FilterDuplicates;
import org.finos.legend.engine.persistence.components.ingestmode.digest.UserProvidedDigestGenStrategy;
import org.finos.legend.engine.persistence.components.logicalplan.datasets.DatasetDefinition;
import org.finos.legend.engine.persistence.components.logicalplan.datasets.DatasetReference;
import org.finos.legend.engine.persistence.components.logicalplan.datasets.DatasetReferenceImpl;
import org.finos.legend.engine.persistence.components.logicalplan.datasets.*;
import org.finos.legend.engine.persistence.components.relational.CaseConversion;
import org.finos.legend.engine.persistence.components.relational.api.RelationalSchemaEvolutionService;
import org.finos.legend.engine.persistence.components.relational.api.SchemaEvolutionServiceResult;
Expand Down Expand Up @@ -98,7 +96,13 @@ void testAddColumnUpperCase() throws Exception
{
DatasetDefinition mainTable = TestUtils.getSchemaEvolutionAddColumnMainTableUpperCase(); // This is only used to create a database table in upper case
DatasetDefinition stagingTable = TestUtils.getBasicStagingTable();
DatasetReference mainTableDatasetReference = DatasetReferenceImpl.builder().group(testSchemaName).name(mainTableName).build(); // This is the model user has
DatasetReference mainTableDatasetReference = DatasetReferenceImpl.builder().group(testSchemaName)
.name(mainTableName)
.datasetAdditionalProperties(DatasetAdditionalProperties.builder().tableOrigin(TableOrigin.ICEBERG).build())
.build(); // This is the model user has

Assertions.assertEquals(DatasetAdditionalProperties.builder().tableOrigin(TableOrigin.ICEBERG).build(),
mainTableDatasetReference.datasetAdditionalProperties().get());

// Create staging table
createStagingTable(stagingTable);
Expand Down

0 comments on commit 60c3282

Please sign in to comment.