Example #1
0
        public static ShapedDatasetSchema From(DatasetResultSchema resultSchema)
        {
            var contract = ShapedDatasetContract.For(resultSchema.Shape);
            var fields   = resultSchema.Fields.Where(f => contract.Fields.Contains <BaseSchemaField>(f)).ToArray();

            return(new ShapedDatasetSchema
            {
                Shape = resultSchema.Shape,
                Fields = fields
            });
        }
Example #2
0
        public static ShapedDatasetSchema From(DatasetResultSchema resultSchema, DatasetExecutionContext context)
        {
            var contract = ShapedDatasetContract.For(resultSchema.Shape, context.DatasetQuery);
            var fields   = resultSchema.Fields.Where(f => contract.Fields.Any(cf => cf.Name == f.Name)).ToArray();

            return(new ShapedDatasetSchema
            {
                Shape = resultSchema.Shape,
                Fields = fields,
                Contract = contract
            });
        }