Search in sources :

Example 1 with IChecked

use of org.finos.legend.engine.plan.dependencies.domain.dataQuality.IChecked in project legend-engine by finos.

the class ExecutionNodeExecutor method visit.

@Override
public Result visit(GlobalGraphFetchExecutionNode globalGraphFetchExecutionNode) {
    final Span topSpan = GlobalTracer.get().activeSpan();
    final boolean isGraphRoot = globalGraphFetchExecutionNode.parentIndex == null;
    if (isGraphRoot) {
        final boolean enableConstraints = globalGraphFetchExecutionNode.enableConstraints == null ? false : globalGraphFetchExecutionNode.enableConstraints;
        final boolean checked = globalGraphFetchExecutionNode.checked == null ? false : globalGraphFetchExecutionNode.checked;
        // Handle batching at root level
        final AtomicLong rowCount = new AtomicLong(0L);
        final AtomicLong objectCount = new AtomicLong(0L);
        final DoubleSummaryStatistics memoryStatistics = new DoubleSummaryStatistics();
        GraphFetchResult graphFetchResult = (GraphFetchResult) globalGraphFetchExecutionNode.localGraphFetchExecutionNode.accept(new ExecutionNodeExecutor(this.profiles, this.executionState));
        Stream<?> objectStream = graphFetchResult.getGraphObjectsBatchStream().map(batch -> {
            List<?> parentObjects = batch.getObjectsForNodeIndex(0);
            boolean nonEmptyObjectList = !parentObjects.isEmpty();
            ExecutionState newState = new ExecutionState(this.executionState).setGraphObjectsBatch(batch);
            if (globalGraphFetchExecutionNode.children != null && !globalGraphFetchExecutionNode.children.isEmpty() && nonEmptyObjectList) {
                globalGraphFetchExecutionNode.children.forEach(c -> c.accept(new ExecutionNodeExecutor(this.profiles, newState)));
            }
            rowCount.addAndGet(batch.getRowCount());
            if (nonEmptyObjectList) {
                long currentObjectCount = objectCount.addAndGet(parentObjects.size());
                memoryStatistics.accept(batch.getTotalObjectMemoryUtilization() / (parentObjects.size() * 1.0));
                if (graphFetchResult.getGraphFetchSpan() != null) {
                    Span graphFetchSpan = graphFetchResult.getGraphFetchSpan();
                    graphFetchSpan.setTag("batchCount", memoryStatistics.getCount());
                    graphFetchSpan.setTag("objectCount", currentObjectCount);
                    graphFetchSpan.setTag("avgMemoryUtilizationInBytesPerObject", memoryStatistics.getAverage());
                }
            }
            if (!nonEmptyObjectList) {
                if (topSpan != null && rowCount.get() > 0) {
                    topSpan.setTag("lastQueryRowCount", rowCount);
                }
            }
            if (checked) {
                return parentObjects.stream().map(x -> (IChecked<?>) x).map(x -> x.getValue() instanceof Constrained ? ((Constrained<?>) x.getValue()).toChecked(x.getSource(), enableConstraints) : x).collect(Collectors.toList());
            }
            if (enableConstraints) {
                return parentObjects.stream().map(x -> x instanceof Constrained ? ((Constrained<?>) x).withConstraintsApplied() : x).collect(Collectors.toList());
            }
            return parentObjects;
        }).flatMap(Collection::stream);
        boolean realizeAsConstant = this.executionState.inAllocation && ExecutionNodeResultHelper.isResultSizeRangeSet(globalGraphFetchExecutionNode) && ExecutionNodeResultHelper.isSingleRecordResult(globalGraphFetchExecutionNode);
        if (realizeAsConstant) {
            return new ConstantResult(objectStream.findFirst().orElseThrow(() -> new RuntimeException("Constant value not found")));
        }
        return new StreamingObjectResult<>(objectStream, new PartialClassBuilder(globalGraphFetchExecutionNode), graphFetchResult);
    } else {
        GraphObjectsBatch graphObjectsBatch = this.executionState.graphObjectsBatch;
        List<?> parentObjects = graphObjectsBatch.getObjectsForNodeIndex(globalGraphFetchExecutionNode.parentIndex);
        if ((parentObjects != null) && !parentObjects.isEmpty()) {
            if (globalGraphFetchExecutionNode.xStorePropertyFetchDetails != null && globalGraphFetchExecutionNode.xStorePropertyFetchDetails.supportsCaching && this.executionState.graphFetchCaches != null) {
                graphObjectsBatch.setXStorePropertyCachesForNodeIndex(globalGraphFetchExecutionNode.localGraphFetchExecutionNode.nodeIndex, findGraphFetchCacheByTargetCrossKeys(globalGraphFetchExecutionNode));
            }
            globalGraphFetchExecutionNode.localGraphFetchExecutionNode.accept(new ExecutionNodeExecutor(this.profiles, this.executionState));
            if (globalGraphFetchExecutionNode.children != null && !globalGraphFetchExecutionNode.children.isEmpty()) {
                globalGraphFetchExecutionNode.children.forEach(c -> c.accept(new ExecutionNodeExecutor(this.profiles, this.executionState)));
            }
        }
        return new ConstantResult(parentObjects);
    }
}
Also used : Maps(org.eclipse.collections.impl.factory.Maps) ExecutionNodeVisitor(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.ExecutionNodeVisitor) Arrays(java.util.Arrays) DefaultExecutionNodeContext(org.finos.legend.engine.plan.execution.nodes.helpers.platform.DefaultExecutionNodeContext) Spliterators(java.util.Spliterators) GraphFetchCacheKey(org.finos.legend.engine.plan.execution.cache.graphFetch.GraphFetchCacheKey) ExecutionNodeSerializerHelper(org.finos.legend.engine.plan.execution.nodes.helpers.ExecutionNodeSerializerHelper) DoubleSummaryStatistics(java.util.DoubleSummaryStatistics) MutableList(org.eclipse.collections.api.list.MutableList) InMemoryCrossStoreGraphFetchExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.graphFetch.store.inMemory.InMemoryCrossStoreGraphFetchExecutionNode) ErrorExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.ErrorExecutionNode) IPlatformPureExpressionExecutionNodeSerializeSpecifics(org.finos.legend.engine.plan.dependencies.store.platform.IPlatformPureExpressionExecutionNodeSerializeSpecifics) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) StoreStreamReadingExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.graphFetch.store.inMemory.StoreStreamReadingExecutionNode) Map(java.util.Map) ConstantResult(org.finos.legend.engine.plan.execution.result.ConstantResult) ExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.ExecutionNode) FunctionParametersValidationNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.FunctionParametersValidationNode) AppliedFunction(org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction) AllocationExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.AllocationExecutionNode) ConstantExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.ConstantExecutionNode) Collection(java.util.Collection) GraphExecutionState(org.finos.legend.engine.plan.execution.nodes.state.GraphExecutionState) FunctionParametersParametersValidation(org.finos.legend.engine.plan.execution.validation.FunctionParametersParametersValidation) SerializationConfig(org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.SerializationConfig) Collectors(java.util.stream.Collectors) Constrained(org.finos.legend.engine.plan.dependencies.domain.dataQuality.Constrained) IExecutionNodeContext(org.finos.legend.engine.plan.dependencies.store.shared.IExecutionNodeContext) Objects(java.util.Objects) InMemoryRootGraphFetchExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.graphFetch.store.inMemory.InMemoryRootGraphFetchExecutionNode) List(java.util.List) Stream(java.util.stream.Stream) Lists(org.eclipse.collections.impl.factory.Lists) Span(io.opentracing.Span) Scope(io.opentracing.Scope) FreeMarkerConditionalExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.FreeMarkerConditionalExecutionNode) Spliterator(java.util.Spliterator) FreeMarkerExecutor(org.finos.legend.engine.plan.execution.nodes.helpers.freemarker.FreeMarkerExecutor) IPlatformPureExpressionExecutionNodeGraphFetchUnionSpecifics(org.finos.legend.engine.plan.dependencies.store.platform.IPlatformPureExpressionExecutionNodeGraphFetchUnionSpecifics) StoreType(org.finos.legend.engine.plan.execution.stores.StoreType) MultiResultSequenceExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.MultiResultSequenceExecutionNode) CommonProfile(org.pac4j.core.profile.CommonProfile) ExecutionState(org.finos.legend.engine.plan.execution.nodes.state.ExecutionState) GraphFetchCache(org.finos.legend.engine.plan.execution.cache.graphFetch.GraphFetchCache) AggregationAwareExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.AggregationAwareExecutionNode) IPlatformPureExpressionExecutionNodeGraphFetchMergeSpecifics(org.finos.legend.engine.plan.dependencies.store.platform.IPlatformPureExpressionExecutionNodeGraphFetchMergeSpecifics) PartialClassBuilder(org.finos.legend.engine.plan.execution.result.builder._class.PartialClassBuilder) GraphFetchResult(org.finos.legend.engine.plan.execution.result.graphFetch.GraphFetchResult) GraphFetchM2MExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.GraphFetchM2MExecutionNode) ExecutionNodeResultHelper(org.finos.legend.engine.plan.execution.nodes.helpers.ExecutionNodeResultHelper) GraphFetchCrossAssociationKeys(org.finos.legend.engine.plan.execution.cache.graphFetch.GraphFetchCrossAssociationKeys) ExecutionCache(org.finos.legend.engine.plan.execution.cache.ExecutionCache) PureExpressionPlatformExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.PureExpressionPlatformExecutionNode) GraphFetchExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.graphFetch.GraphFetchExecutionNode) StreamingObjectResult(org.finos.legend.engine.plan.execution.result.object.StreamingObjectResult) JavaHelper(org.finos.legend.engine.plan.execution.nodes.helpers.platform.JavaHelper) StreamSupport(java.util.stream.StreamSupport) IChecked(org.finos.legend.engine.plan.dependencies.domain.dataQuality.IChecked) JavaPlatformImplementation(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.JavaPlatformImplementation) ErrorResult(org.finos.legend.engine.plan.execution.result.ErrorResult) SequenceExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.SequenceExecutionNode) Result(org.finos.legend.engine.plan.execution.result.Result) ResultVisitor(org.finos.legend.engine.plan.execution.result.ResultVisitor) XStorePropertyFetchDetails(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.graphFetch.XStorePropertyFetchDetails) GraphFetchCacheByTargetCrossKeys(org.finos.legend.engine.plan.execution.cache.graphFetch.GraphFetchCacheByTargetCrossKeys) ExecutionNodeJavaPlatformHelper(org.finos.legend.engine.plan.execution.nodes.helpers.platform.ExecutionNodeJavaPlatformHelper) GlobalTracer(io.opentracing.util.GlobalTracer) GraphObjectsBatch(org.finos.legend.engine.plan.execution.result.graphFetch.GraphObjectsBatch) InMemoryPropertyGraphFetchExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.graphFetch.store.inMemory.InMemoryPropertyGraphFetchExecutionNode) ProfileManager(org.pac4j.core.profile.ProfileManager) Consumer(java.util.function.Consumer) AtomicLong(java.util.concurrent.atomic.AtomicLong) MultiResult(org.finos.legend.engine.plan.execution.result.MultiResult) GlobalGraphFetchExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.graphFetch.GlobalGraphFetchExecutionNode) LocalGraphFetchExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.graphFetch.LocalGraphFetchExecutionNode) GraphExecutionState(org.finos.legend.engine.plan.execution.nodes.state.GraphExecutionState) ExecutionState(org.finos.legend.engine.plan.execution.nodes.state.ExecutionState) PartialClassBuilder(org.finos.legend.engine.plan.execution.result.builder._class.PartialClassBuilder) GraphObjectsBatch(org.finos.legend.engine.plan.execution.result.graphFetch.GraphObjectsBatch) ConstantResult(org.finos.legend.engine.plan.execution.result.ConstantResult) StreamingObjectResult(org.finos.legend.engine.plan.execution.result.object.StreamingObjectResult) DoubleSummaryStatistics(java.util.DoubleSummaryStatistics) GraphFetchResult(org.finos.legend.engine.plan.execution.result.graphFetch.GraphFetchResult) Span(io.opentracing.Span) AtomicLong(java.util.concurrent.atomic.AtomicLong) IChecked(org.finos.legend.engine.plan.dependencies.domain.dataQuality.IChecked) Constrained(org.finos.legend.engine.plan.dependencies.domain.dataQuality.Constrained) Collection(java.util.Collection) MutableList(org.eclipse.collections.api.list.MutableList) List(java.util.List)

Example 2 with IChecked

use of org.finos.legend.engine.plan.dependencies.domain.dataQuality.IChecked in project legend-engine by finos.

the class TestXmlDeserializer method testDeserializeFirmsWithElements.

@Test
public void testDeserializeFirmsWithElements() {
    XmlReader reader = reader("<world>", "  <firms>", "    <firm>", "      <name>Acme Inc.</name>", "      <ranking>2</ranking>", "    </firm>", "    <firm>", "      <ranking>1</ranking>", "      <name>Widget Engineering</name>", "    </firm>", "    <firm>", "      <name>Globex Corp</name>", "    </firm>", "  </firms>", "</world>");
    List<IChecked<Firm>> firms = new ArrayList<>();
    DeserializeContext<Firm> context = new DeserializeContext<>(reader, firms::add);
    ReadFirmWithoutSchema firmReader = new ReadFirmWithoutSchema();
    firmReader.read(context);
    Assert.assertFalse(reader.hasNext());
    Assert.assertEquals(3, firms.size());
    Assert.assertEquals(Arrays.asList("Acme Inc.", "Widget Engineering", "Globex Corp"), firms.stream().map(IChecked::getValue).map(Firm::getName).collect(Collectors.toList()));
    Assert.assertEquals(Arrays.asList(2L, 1L, null), firms.stream().map(IChecked::getValue).map(Firm::getRanking).collect(Collectors.toList()));
    List<XmlDataRecord> sources = firms.stream().map(IChecked::getSource).map(XmlDataRecord.class::cast).collect(Collectors.toList());
    Assert.assertEquals(Arrays.asList("<firm><name>Acme Inc.</name><ranking>2</ranking></firm>", "<firm><ranking>1</ranking><name>Widget Engineering</name></firm>", "<firm><name>Globex Corp</name></firm>"), sources.stream().map(XmlDataRecord::getRecord).collect(Collectors.toList()));
    Assert.assertEquals(Arrays.asList(1L, 2L, 3L), sources.stream().map(XmlDataRecord::getNumber).collect(Collectors.toList()));
}
Also used : IChecked(org.finos.legend.engine.plan.dependencies.domain.dataQuality.IChecked) ArrayList(java.util.ArrayList) XmlReader(org.finos.legend.engine.external.format.xml.shared.XmlReader) DeserializeContext(org.finos.legend.engine.external.format.xml.read.DeserializeContext) XmlDataRecord(org.finos.legend.engine.external.format.xml.read.XmlDataRecord) ReadFirmWithoutSchema(org.finos.legend.engine.external.format.xml.fixtures.ReadFirmWithoutSchema) Firm(org.finos.legend.engine.external.shared.runtime.fixtures.firmModel.Firm) Test(org.junit.Test)

Example 3 with IChecked

use of org.finos.legend.engine.plan.dependencies.domain.dataQuality.IChecked in project legend-engine by finos.

the class TestXmlDeserializer method testDeserializeFirmWithEmployeesWithElementsNested.

@Test
public void testDeserializeFirmWithEmployeesWithElementsNested() {
    XmlReader reader = reader("<firm name=\"Acme Inc.\" ranking=\"2\">", "  <name>Acme Inc.</name>", "  <ranking>2</ranking>", "  <employees>", "    <employee>", "      <firstName>John</firstName>", "      <lastName>Doe</lastName>", "      <dateOfBirth>1991-02-10</dateOfBirth>", "      <isAlive>true</isAlive>", "      <heightInMeters>1.78</heightInMeters>", "    </employee>", "    <employee>", "      <firstName>Fred</firstName>", "      <lastName>Bloggs</lastName>", "      <dateOfBirth>1983-12-13</dateOfBirth>", "      <isAlive>false</isAlive>", "      <heightInMeters>1.65</heightInMeters>", "    </employee>", "  </employees>", "</firm>");
    List<IChecked<Firm>> firms = new ArrayList<>();
    DeserializeContext<Firm> context = new DeserializeContext<>(reader, firms::add);
    ReadFirmWithoutSchema firmReader = new ReadFirmWithoutSchema();
    firmReader.read(context);
    Assert.assertFalse(reader.hasNext());
    Assert.assertEquals(1, firms.size());
    Firm firm = firms.get(0).getValue();
    Assert.assertEquals("Acme Inc.", firm.getName());
    Assert.assertEquals(2L, firm.getRanking().longValue());
    Assert.assertEquals(2, firm.getEmployees().size());
    Assert.assertEquals(Arrays.asList("John", "Fred"), firm.getEmployees().stream().map(Person::getFirstName).collect(Collectors.toList()));
    Assert.assertEquals(Arrays.asList("Doe", "Bloggs"), firm.getEmployees().stream().map(Person::getLastName).collect(Collectors.toList()));
    Assert.assertEquals(Arrays.asList("1991-02-10", "1983-12-13"), firm.getEmployees().stream().map(Person::getDateOfBirth).map(Object::toString).collect(Collectors.toList()));
    Assert.assertEquals(Arrays.asList(true, false), firm.getEmployees().stream().map(Person::getIsAlive).collect(Collectors.toList()));
    Assert.assertEquals(Arrays.asList(1.78, 1.65), firm.getEmployees().stream().map(Person::getHeightInMeters).collect(Collectors.toList()));
}
Also used : IChecked(org.finos.legend.engine.plan.dependencies.domain.dataQuality.IChecked) ArrayList(java.util.ArrayList) XmlReader(org.finos.legend.engine.external.format.xml.shared.XmlReader) DeserializeContext(org.finos.legend.engine.external.format.xml.read.DeserializeContext) ReadFirmWithoutSchema(org.finos.legend.engine.external.format.xml.fixtures.ReadFirmWithoutSchema) Person(org.finos.legend.engine.external.shared.runtime.fixtures.firmModel.Person) Firm(org.finos.legend.engine.external.shared.runtime.fixtures.firmModel.Firm) Test(org.junit.Test)

Example 4 with IChecked

use of org.finos.legend.engine.plan.dependencies.domain.dataQuality.IChecked in project legend-engine by finos.

the class TestXmlDeserializer method testDeserializeFirmWithEmployeesWithElements.

@Test
public void testDeserializeFirmWithEmployeesWithElements() {
    XmlReader reader = reader("<firm name=\"Acme Inc.\" ranking=\"2\">", "  <name>Acme Inc.</name>", "  <ranking>2</ranking>", "  <employees>", "    <firstName>John</firstName>", "    <lastName>Doe</lastName>", "    <dateOfBirth>1991-02-10</dateOfBirth>", "    <isAlive>true</isAlive>", "    <heightInMeters>1.78</heightInMeters>", "  </employees>", "  <employees>", "    <firstName>Fred</firstName>", "    <lastName>Bloggs</lastName>", "    <dateOfBirth>1983-12-13</dateOfBirth>", "    <isAlive>false</isAlive>", "    <heightInMeters>1.65</heightInMeters>", "  </employees>", "</firm>");
    List<IChecked<Firm>> firms = new ArrayList<>();
    DeserializeContext<Firm> context = new DeserializeContext<>(reader, firms::add);
    ReadFirmWithoutSchema firmReader = new ReadFirmWithoutSchema();
    firmReader.read(context);
    Assert.assertFalse(reader.hasNext());
    Assert.assertEquals(1, firms.size());
    Firm firm = firms.get(0).getValue();
    Assert.assertEquals("Acme Inc.", firm.getName());
    Assert.assertEquals(2L, firm.getRanking().longValue());
    Assert.assertEquals(2, firm.getEmployees().size());
    Assert.assertEquals(Arrays.asList("John", "Fred"), firm.getEmployees().stream().map(Person::getFirstName).collect(Collectors.toList()));
    Assert.assertEquals(Arrays.asList("Doe", "Bloggs"), firm.getEmployees().stream().map(Person::getLastName).collect(Collectors.toList()));
    Assert.assertEquals(Arrays.asList("1991-02-10", "1983-12-13"), firm.getEmployees().stream().map(Person::getDateOfBirth).map(Object::toString).collect(Collectors.toList()));
    Assert.assertEquals(Arrays.asList(true, false), firm.getEmployees().stream().map(Person::getIsAlive).collect(Collectors.toList()));
    Assert.assertEquals(Arrays.asList(1.78, 1.65), firm.getEmployees().stream().map(Person::getHeightInMeters).collect(Collectors.toList()));
}
Also used : IChecked(org.finos.legend.engine.plan.dependencies.domain.dataQuality.IChecked) ArrayList(java.util.ArrayList) XmlReader(org.finos.legend.engine.external.format.xml.shared.XmlReader) DeserializeContext(org.finos.legend.engine.external.format.xml.read.DeserializeContext) ReadFirmWithoutSchema(org.finos.legend.engine.external.format.xml.fixtures.ReadFirmWithoutSchema) Person(org.finos.legend.engine.external.shared.runtime.fixtures.firmModel.Person) Firm(org.finos.legend.engine.external.shared.runtime.fixtures.firmModel.Firm) Test(org.junit.Test)

Example 5 with IChecked

use of org.finos.legend.engine.plan.dependencies.domain.dataQuality.IChecked in project legend-engine by finos.

the class TestXmlDeserializer method testDeserializeFirmsWithAttributes.

@Test
public void testDeserializeFirmsWithAttributes() {
    XmlReader reader = reader("<world>", "  <firms>", "    <firm name=\"Acme Inc.\" ranking=\"2\"/>", "    <firm name=\"Widget Engineering\" ranking=\"1\"/>", "    <firm name=\"Globex Corp\"/>", "  </firms>", "</world>");
    List<IChecked<Firm>> firms = new ArrayList<>();
    DeserializeContext<Firm> context = new DeserializeContext<>(reader, firms::add);
    ReadFirmWithoutSchema firmReader = new ReadFirmWithoutSchema();
    firmReader.read(context);
    Assert.assertFalse(reader.hasNext());
    Assert.assertEquals(3, firms.size());
    Assert.assertEquals(Arrays.asList("Acme Inc.", "Widget Engineering", "Globex Corp"), firms.stream().map(IChecked::getValue).map(Firm::getName).collect(Collectors.toList()));
    Assert.assertEquals(Arrays.asList(2L, 1L, null), firms.stream().map(IChecked::getValue).map(Firm::getRanking).collect(Collectors.toList()));
    List<XmlDataRecord> sources = firms.stream().map(IChecked::getSource).map(XmlDataRecord.class::cast).collect(Collectors.toList());
    Assert.assertEquals(Arrays.asList("<firm name=\"Acme Inc.\" ranking=\"2\"/>", "<firm name=\"Widget Engineering\" ranking=\"1\"/>", "<firm name=\"Globex Corp\"/>"), sources.stream().map(XmlDataRecord::getRecord).collect(Collectors.toList()));
    Assert.assertEquals(Arrays.asList(1L, 2L, 3L), sources.stream().map(XmlDataRecord::getNumber).collect(Collectors.toList()));
}
Also used : IChecked(org.finos.legend.engine.plan.dependencies.domain.dataQuality.IChecked) ArrayList(java.util.ArrayList) XmlReader(org.finos.legend.engine.external.format.xml.shared.XmlReader) DeserializeContext(org.finos.legend.engine.external.format.xml.read.DeserializeContext) XmlDataRecord(org.finos.legend.engine.external.format.xml.read.XmlDataRecord) ReadFirmWithoutSchema(org.finos.legend.engine.external.format.xml.fixtures.ReadFirmWithoutSchema) Firm(org.finos.legend.engine.external.shared.runtime.fixtures.firmModel.Firm) Test(org.junit.Test)

Aggregations

IChecked (org.finos.legend.engine.plan.dependencies.domain.dataQuality.IChecked)54 FlatData (org.finos.legend.engine.external.format.flatdata.shared.model.FlatData)39 Test (org.junit.Test)31 ArrayList (java.util.ArrayList)9 ReadFirmWithoutSchema (org.finos.legend.engine.external.format.xml.fixtures.ReadFirmWithoutSchema)8 DeserializeContext (org.finos.legend.engine.external.format.xml.read.DeserializeContext)8 XmlReader (org.finos.legend.engine.external.format.xml.shared.XmlReader)8 Firm (org.finos.legend.engine.external.shared.runtime.fixtures.firmModel.Firm)8 AbstractDriverTest (org.finos.legend.engine.external.format.flatdata.shared.driver.AbstractDriverTest)7 XmlDataRecord (org.finos.legend.engine.external.format.xml.read.XmlDataRecord)5 InputStream (java.io.InputStream)4 Result (org.finos.legend.engine.plan.execution.result.Result)4 StreamingObjectResult (org.finos.legend.engine.plan.execution.result.object.StreamingObjectResult)4 Span (io.opentracing.Span)3 ByteArrayInputStream (java.io.ByteArrayInputStream)3 AtomicLong (java.util.concurrent.atomic.AtomicLong)3 Consumer (java.util.function.Consumer)3 Stream (java.util.stream.Stream)3 MutableList (org.eclipse.collections.api.list.MutableList)3 Person (org.finos.legend.engine.external.shared.runtime.fixtures.firmModel.Person)3