Skip to content

Commit

Permalink
update dataspace template query showcase (#832)
Browse files Browse the repository at this point in the history
  • Loading branch information
YannanGao-gs authored Aug 30, 2024
1 parent 4cfcadb commit 058f20c
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,35 +264,41 @@ DataSpace showcase::northwind::dataspace::NorthwindDataSpaceWithExecutables
executables:
[
{
title: 'Northwind Data Space -Shipper Validation Defects';
description: 'Shipper Validation Defects';
title: 'this is title (service) - Northwind Data Space -Shipper Validation Defects';
description: 'this is description (service) Shipper Validation Defects';
executable: showcase::northwind::services::graph::ShipperValidationDefects;
},
{
id: my_id_1;
title: 'this is title (function pointer) - Top Categories';
description: 'this is description (function pointer) - TopCategories';
executable: showcase::northwind::model::Order_QueryFunction():TabularDataSet[1];
},
{
id: my_id;
title: 'this is title - Top Categories';
description: 'this is description - TopCategories';
title: 'this is title (inline query) - Top Categories';
description: 'this is description (inline query) - TopCategories';
query: |showcase::northwind::model::Order.all()->groupBy(
[
x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.id,
x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name
],
[
agg(
x: showcase::northwind::model::Order[1]|$x.id,
x: Integer[*]|$x->distinct()->count()
)
],
[
'Category Id',
'Category Name',
'Order Count'
]
)->sort(
[
desc('Order Count')
]
)->take(5);
[
x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.id,
x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name
],
[
agg(
x: showcase::northwind::model::Order[1]|$x.id,
x: Integer[*]|$x->distinct()->count()
)
],
[
'Category Id',
'Category Name',
'Order Count'
]
)->sort(
[
desc('Order Count')
]
)->take(5);
executionContextKey: 'externally-public-PROD';
}
];
Expand Down Expand Up @@ -974,6 +980,31 @@ Association showcase::northwind::model::associations::Employee_Manager
manager: showcase::northwind::model::crm::Employee[0..1];
}

function showcase::northwind::model::Order_QueryFunction(): meta::pure::tds::TabularDataSet[1]
{
showcase::northwind::model::Order.all()->groupBy(
[
x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.id,
x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name
],
[
agg(
x: showcase::northwind::model::Order[1]|$x.id,
x: Integer[*]|$x->distinct()->count()
)
],
[
'Category Id',
'Category Name',
'Order Count'
]
)->sort(
[
desc('Order Count')
]
)->take(5)
}


###Mapping
Mapping showcase::northwind::mapping::NorthwindMapping
Expand Down
40 changes: 20 additions & 20 deletions showcases/data/Store/Relational Store/Service/Basic/code.pure
Original file line number Diff line number Diff line change
Expand Up @@ -306,26 +306,26 @@ DataSpace showcase::northwind::dataspace::NorthwindDataSpaceWithTemplateQuery
title: 'this is title - Top Categories';
description: 'this is description - TopCategories';
query: |showcase::northwind::model::Order.all()->groupBy(
[
x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.id,
x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name
],
[
agg(
x: showcase::northwind::model::Order[1]|$x.id,
x: Integer[*]|$x->distinct()->count()
)
],
[
'Category Id',
'Category Name',
'Order Count'
]
)->sort(
[
desc('Order Count')
]
)->take(5);
[
x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.id,
x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name
],
[
agg(
x: showcase::northwind::model::Order[1]|$x.id,
x: Integer[*]|$x->distinct()->count()
)
],
[
'Category Id',
'Category Name',
'Order Count'
]
)->sort(
[
desc('Order Count')
]
)->take(5);
executionContextKey: 'externally-public-PROD';
}
];
Expand Down
2 changes: 1 addition & 1 deletion showcases/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.surefire.thread.count>3</maven.surefire.thread.count>
<showcase.projects.location>data</showcase.projects.location>
<legend.engine.version>4.45.0</legend.engine.version>
<legend.engine.version>4.54.1</legend.engine.version>

</properties>

Expand Down

0 comments on commit 058f20c

Please sign in to comment.