-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove shadowed columns in use cases (#355)
* Remove shadowed columns in use cases Signed-off-by: Daniel Henneberger <git@danielhenneberger.com> * Add build on develop branch Signed-off-by: Daniel Henneberger <git@danielhenneberger.com> --------- Signed-off-by: Daniel Henneberger <git@danielhenneberger.com>
- Loading branch information
1 parent
a25c232
commit e635ab5
Showing
27 changed files
with
78 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
IMPORT ecommerce-data.Orders; | ||
|
||
-- Compute useful statistics on orders | ||
Orders.entries.discount := coalesce(discount, 0.0); | ||
Orders.entries.price := quantity * unit_price - discount; | ||
Orders.entries.discount0 := coalesce(discount, 0.0); | ||
Orders.entries.price := quantity * unit_price - discount0; | ||
|
||
Orders.totals := SELECT sum(e.price) AS price, COUNT(1) as number, sum(e.discount) AS savings FROM @.entries e; | ||
Orders.totals := SELECT sum(e.price) AS price, COUNT(1) as number, sum(e.discount0) AS savings FROM @.entries e; | ||
|
||
CustomerOrderStats := SELECT o.customerid, sum(t.price) as total_price, sum(t.number) as num_orders FROM Orders o JOIN o.totals t | ||
GROUP BY o.customerid; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...sources/snapshots/com/datasqrl/plan/local/analyze/QuerySnapshotTest/orderCoalesceTest.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
...rces/snapshots/com/datasqrl/plan/local/analyze/QuerySnapshotTest/shadowExpressionTest.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.