diff --git a/.github/workflows/build-config.yml b/.github/workflows/build-config.yml index e6c85bb8f..64c7265fc 100644 --- a/.github/workflows/build-config.yml +++ b/.github/workflows/build-config.yml @@ -1,7 +1,7 @@ name: Build and test SQRL with Maven on: pull_request: - branches: [ "main" ] + branches: [ "main", "develop" ] jobs: build: diff --git a/sqrl-examples/repository/repo.sqrl b/sqrl-examples/repository/repo.sqrl index 8f1e856a8..4b130cd6c 100644 --- a/sqrl-examples/repository/repo.sqrl +++ b/sqrl-examples/repository/repo.sqrl @@ -1,7 +1,7 @@ IMPORT datasqrl-central.Submission TIMESTAMP submissionTime; IMPORT string.concat; -Submission.variant := COALESCE(variant, 'default'); +Submission.variant0 := COALESCE(variant, 'default'); Submission.repoURL := concat('https://repository.datasqrl.com/',file); Package := SELECT DISTINCT name FROM Submission; diff --git a/sqrl-examples/retail/c360-full-graphqlv1/orders.query.graphql b/sqrl-examples/retail/c360-full-graphqlv1/orders.query.graphql index bf50ae9c3..7096c4e88 100644 --- a/sqrl-examples/retail/c360-full-graphqlv1/orders.query.graphql +++ b/sqrl-examples/retail/c360-full-graphqlv1/orders.query.graphql @@ -7,7 +7,7 @@ orders (id : 10007140) { productid quantity unit_price - discount + discount: discount0 total product { name diff --git a/sqrl-examples/retail/c360-full-graphqlv1/schema.graphqls b/sqrl-examples/retail/c360-full-graphqlv1/schema.graphqls index 0e4764c8b..5d59bf486 100644 --- a/sqrl-examples/retail/c360-full-graphqlv1/schema.graphqls +++ b/sqrl-examples/retail/c360-full-graphqlv1/schema.graphqls @@ -45,6 +45,7 @@ type entries { unit_price: Float parent: orders! discount: Float + discount0: Float total: Float product: [Product] } diff --git a/sqrl-examples/retail/c360-full.sqrl b/sqrl-examples/retail/c360-full.sqrl index ff6c5d003..076003318 100644 --- a/sqrl-examples/retail/c360-full.sqrl +++ b/sqrl-examples/retail/c360-full.sqrl @@ -11,9 +11,9 @@ Category := SELECT DISTINCT category AS name FROM Product; Product := DISTINCT Product ON productid ORDER BY updateTime DESC; -- Compute useful statistics on orders -Orders.entries.discount := coalesce(discount, 0.0); -Orders.entries.total := quantity * unit_price - discount; -Orders.total := SELECT sum(e.total) AS price, sum(e.discount) AS discount, count(1) AS num FROM @.entries e; +Orders.entries.discount0 := coalesce(discount, 0.0); +Orders.entries.total := quantity * unit_price - discount0; +Orders.total := SELECT sum(e.total) AS price, sum(e.discount0) AS discount, count(1) AS num FROM @.entries e; -- Relate Customer to Orders and categories to products Customer.orders := JOIN Orders ON Orders.customerid = @.customerid; @@ -31,7 +31,7 @@ Customer._spending_by_month_category := SELECT endOfMonth(o.time) AS month, p.category AS category, sum(e.total) AS total, - sum(e.discount) AS savings + sum(e.discount0) AS savings FROM @.orders o JOIN o.entries e JOIN e.product p GROUP BY month, category ORDER BY month DESC; diff --git a/sqrl-examples/retail/c360-orderstats.sqrl b/sqrl-examples/retail/c360-orderstats.sqrl index 5b3f2947a..dd65b1de9 100644 --- a/sqrl-examples/retail/c360-orderstats.sqrl +++ b/sqrl-examples/retail/c360-orderstats.sqrl @@ -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; \ No newline at end of file diff --git a/sqrl-examples/retail/c360-recommend.sqrl b/sqrl-examples/retail/c360-recommend.sqrl index f7b902697..bc372215e 100644 --- a/sqrl-examples/retail/c360-recommend.sqrl +++ b/sqrl-examples/retail/c360-recommend.sqrl @@ -9,9 +9,9 @@ Category := SELECT DISTINCT category AS name FROM Product; Product := DISTINCT Product ON productid ORDER BY updateTime DESC; -- Compute useful statistics on orders -Orders.entries.discount := coalesce(discount, 0.0); -Orders.entries.total := quantity * unit_price - discount; -Orders.total := SELECT sum(e.total) AS price, sum(e.discount) AS discount, count(1) AS num FROM @.entries e; +Orders.entries.discount0 := coalesce(discount, 0.0); +Orders.entries.total := quantity * unit_price - discount0; +Orders.total := SELECT sum(e.total) AS price, sum(e.discount0) AS discount, count(1) AS num FROM @.entries e; -- Relate Customer to Orders and categories to products Customer.orders := JOIN Orders ON Orders.customerid = @.customerid; diff --git a/sqrl-examples/retail/c360/c360.sqrl b/sqrl-examples/retail/c360/c360.sqrl index c674365ce..2481d96e7 100644 --- a/sqrl-examples/retail/c360/c360.sqrl +++ b/sqrl-examples/retail/c360/c360.sqrl @@ -8,9 +8,9 @@ Category := SELECT DISTINCT category AS name FROM Product; Product := DISTINCT Product ON productid ORDER BY _ingest_time DESC; -- Compute useful statistics on orders -Orders.entries.discount := coalesce(discount, 0.0); -Orders.entries.total := quantity * unit_price - discount; -Orders.total := SELECT sum(e.total) AS price, sum(e.discount) AS discount, count(1) AS num FROM @.entries e; +Orders.entries.discount0 := coalesce(discount, 0.0); +Orders.entries.total := quantity * unit_price - discount0; +Orders.total := SELECT sum(e.total) AS price, sum(e.discount0) AS discount, count(1) AS num FROM @.entries e; -- Relate Customer to Orders and compute a customer's total order spent Customer.orders := JOIN Orders ON Orders.customerid = @.customerid; @@ -37,7 +37,7 @@ Customer._spending_by_month_category := SELECT endOfMonth(o.time) AS month, e.product.category AS category, sum(e.total) AS total, - sum(e.discount) AS savings + sum(e.discount0) AS savings FROM @.orders o JOIN o.entries e GROUP BY month, category ORDER BY month DESC; diff --git a/sqrl-planner/sqrl-planner-local/src/test/java/com/datasqrl/plan/local/analyze/QuerySnapshotTest.java b/sqrl-planner/sqrl-planner-local/src/test/java/com/datasqrl/plan/local/analyze/QuerySnapshotTest.java index 9b661ea1a..0c3fee57b 100644 --- a/sqrl-planner/sqrl-planner-local/src/test/java/com/datasqrl/plan/local/analyze/QuerySnapshotTest.java +++ b/sqrl-planner/sqrl-planner-local/src/test/java/com/datasqrl/plan/local/analyze/QuerySnapshotTest.java @@ -238,7 +238,7 @@ public void customerDistinctTest() { @Test public void orderCoalesceTest() { ScriptBuilder builder = example.getImports(); - builder.add("Orders.entries.discount := SELECT coalesce(x.discount, 0.0) AS discount FROM @ AS x"); + builder.add("Orders.entries.discount0 := SELECT coalesce(x.discount, 0.0) AS discount FROM @ AS x"); validateScript(builder.getScript()); } @@ -310,8 +310,8 @@ public void ordersEntriesTest() { @Test public void ordersEntriesDiscountTest() { ScriptBuilder builder = example.getImports(); - builder.add("Orders.entries.discount := COALESCE(discount, 0.0);\n" - + "Orders.entries.total := quantity * unit_price - discount;"); + builder.add("Orders.entries.discount0 := COALESCE(discount, 0.0);\n" + + "Orders.entries.total := quantity * unit_price - discount0;"); validateScript(builder.getScript()); } @@ -529,14 +529,6 @@ public void expressionTest() { + "Product.descriptionLength := CHAR_LENGTH(description);"); } - @Test - public void shadowExpressionTest() { - validateScript("IMPORT ecommerce-data.Product;\n" - + "Product.descriptionLength := CHAR_LENGTH(description);" - + "Product.descriptionLength := CHAR_LENGTH(description);" - + "X := SELECT descriptionLength FROM Product;"); - } - @Test public void selectStarQueryTest() { validateScript("IMPORT ecommerce-data.Product;\n" diff --git a/sqrl-planner/sqrl-planner-local/src/test/resources/snapshots/com/datasqrl/plan/local/analyze/QuerySnapshotTest/orderCoalesceTest.txt b/sqrl-planner/sqrl-planner-local/src/test/resources/snapshots/com/datasqrl/plan/local/analyze/QuerySnapshotTest/orderCoalesceTest.txt index 4fd5e1b5d..092276505 100644 --- a/sqrl-planner/sqrl-planner-local/src/test/resources/snapshots/com/datasqrl/plan/local/analyze/QuerySnapshotTest/orderCoalesceTest.txt +++ b/sqrl-planner/sqrl-planner-local/src/test/resources/snapshots/com/datasqrl/plan/local/analyze/QuerySnapshotTest/orderCoalesceTest.txt @@ -1,7 +1,7 @@ >>>customer$q$2 LogicalTableScan(table=[[customer$i$1]]) ->>>discount$q$18 +>>>discount0$q$18 LogicalProject(___uuid$0$pk$1=[$0], ___idx$0$pk$2=[$6], discount=[COALESCE($10, 0.0:DOUBLE)], time$0=[$4]) LogicalCorrelate(correlation=[$cor1], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$q$6]]) diff --git a/sqrl-planner/sqrl-planner-local/src/test/resources/snapshots/com/datasqrl/plan/local/analyze/QuerySnapshotTest/shadowExpressionTest.txt b/sqrl-planner/sqrl-planner-local/src/test/resources/snapshots/com/datasqrl/plan/local/analyze/QuerySnapshotTest/shadowExpressionTest.txt deleted file mode 100644 index a8fc66266..000000000 --- a/sqrl-planner/sqrl-planner-local/src/test/resources/snapshots/com/datasqrl/plan/local/analyze/QuerySnapshotTest/shadowExpressionTest.txt +++ /dev/null @@ -1,8 +0,0 @@ ->>>product$q$2 -LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], productid$0=[$2], name$0=[$3], description$0=[$4], category$0=[$5], descriptionlength$0=[CHAR_LENGTH($4)], descriptionlength$1=[CHAR_LENGTH($4)]) - LogicalTableScan(table=[[product$i$1]]) - ->>>x$q$5 -LogicalProject(_uuid$0=[$0], descriptionLength=[$7], _ingest_time$0=[$1]) - LogicalTableScan(table=[[product$q$2]]) - diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkDebugPhysicalIT/debugC3602OutputSelectTablesTest.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkDebugPhysicalIT/debugC3602OutputSelectTablesTest.txt index bf98e5c0d..1c73dc21d 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkDebugPhysicalIT/debugC3602OutputSelectTablesTest.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkDebugPhysicalIT/debugC3602OutputSelectTablesTest.txt @@ -5,9 +5,9 @@ LogicalProject(__customerid$0=[$0], category_name$0=[$1], total$0=[$2], month$0= LogicalJoin(condition=[=($5, $0)], joinType=[inner]) hints[TemporalJoinHint options:[1, 6, 0]] LogicalProject(__customerid$0$pk$1=[$0], month=[$1], category=[$2], total=[$3], savings=[$4]) LogicalAggregate(group=[{0, 1, 2}], total=[SUM($3)], savings=[SUM($4)]) hints[TumbleAggregationHint options:[1, FUNCTION, 4, 2629746000, 0]] - LogicalProject(__customerid$0$pk$1=[$6], month=[endOfMonth($4)], category$0=[$26], total$0=[$20], discount$1=[$19], _uuid$0=[$0], _idx$0=[$14]) + LogicalProject(__customerid$0$pk$1=[$6], month=[endOfMonth($4)], category$0=[$26], total$0=[$20], discount0$0=[$19], _uuid$0=[$0], _idx$0=[$14]) LogicalJoin(condition=[=($15, $21)], joinType=[inner]) hints[TemporalJoinHint options:[4, 6, 0]] - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], customerid$00=[$6], _uuid$00=[$7], _ingest_time$00=[$8], email$0=[$9], name$0=[$10], lastupdated$0=[$11], updatetime$0=[$12], _rownum=[$13], _idx$0=[$14], productid$0=[$15], quantity$0=[$16], unit_price$0=[$17], discount$0=[$18], discount$1=[COALESCE($18, 0.0:DOUBLE)], total$0=[-(*($16, $17), COALESCE($18, 0.0:DOUBLE))]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], customerid$00=[$6], _uuid$00=[$7], _ingest_time$00=[$8], email$0=[$9], name$0=[$10], lastupdated$0=[$11], updatetime$0=[$12], _rownum=[$13], _idx$0=[$14], productid$0=[$15], quantity$0=[$16], unit_price$0=[$17], discount$0=[$18], discount0$0=[COALESCE($18, 0.0:DOUBLE)], total$0=[-(*($16, $17), COALESCE($18, 0.0:DOUBLE))]) LogicalCorrelate(correlation=[$cor7], joinType=[inner], requiredColumns=[{5}]) LogicalJoin(condition=[=($6, $3)], joinType=[inner]) hints[TemporalJoinHint options:[4, 6, 0]] LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] @@ -55,7 +55,7 @@ LogicalProject(_uuid$0=[$0], _source_time$0=[$1], customerid$0=[$2], email$0=[$3 LogicalTableScan(table=[[customer$i$1]]) LogicalProject(___uuid$0$pk$1=[$0], price=[$2], discount=[$3], num=[$4], time$0=[$1]) LogicalAggregate(group=[{0, 4}], price=[SUM($12)], discount=[SUM($11)], num=[COUNT()]) hints[TumbleAggregationHint options:[4, INSTANT, -1, 1, 0]] - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount$1=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount0$0=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) LogicalCorrelate(correlation=[$cor11], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] Uncollect @@ -86,7 +86,7 @@ LogicalProject(_uuid$0=[$0], _source_time$0=[$1], customerid=[$2], email=[$3], n LogicalTableScan(table=[[customer$i$1]]) LogicalProject(___uuid$0$pk$1=[$0], price=[$2], discount=[$3], num=[$4], time$0=[$1]) LogicalAggregate(group=[{0, 4}], price=[SUM($12)], discount=[SUM($11)], num=[COUNT()]) hints[TumbleAggregationHint options:[4, INSTANT, -1, 1, 0]] - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount$1=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount0$0=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) LogicalCorrelate(correlation=[$cor11], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] Uncollect @@ -134,7 +134,7 @@ LogicalProject(__customerid$0$pk$1=[$6], total_spend=[SUM($15) IGNORE NULLS OVER LogicalTableScan(table=[[customer$i$1]]) LogicalProject(___uuid$0$pk$1=[$0], price=[$2], discount=[$3], num=[$4], time$0=[$1]) LogicalAggregate(group=[{0, 4}], price=[SUM($12)], discount=[SUM($11)], num=[COUNT()]) hints[TumbleAggregationHint options:[4, INSTANT, -1, 1, 0]] - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount$1=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount0$0=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) LogicalCorrelate(correlation=[$cor11], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] Uncollect @@ -144,7 +144,7 @@ LogicalProject(__customerid$0$pk$1=[$6], total_spend=[SUM($15) IGNORE NULLS OVER >>>total$debug4-lp-stream LogicalProject(___uuid$0$pk$1=[$0], price=[$2], discount=[$3], num=[$4], time$0=[$1]) LogicalAggregate(group=[{0, 4}], price=[SUM($12)], discount=[SUM($11)], num=[COUNT()]) hints[TumbleAggregationHint options:[4, INSTANT, -1, 1, 0]] - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount$1=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount0$0=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) LogicalCorrelate(correlation=[$cor11], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] Uncollect diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkDebugPhysicalIT/debugC3602OutputTest.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkDebugPhysicalIT/debugC3602OutputTest.txt index 13f611327..873de5b88 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkDebugPhysicalIT/debugC3602OutputTest.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkDebugPhysicalIT/debugC3602OutputTest.txt @@ -49,7 +49,7 @@ LogicalProject(__customerid$0=[$0], total_spend$0=[$1], num_orders$0=[$2], time$ LogicalTableScan(table=[[customer$i$1]]) LogicalProject(___uuid$0$pk$1=[$0], price=[$2], discount=[$3], num=[$4], time$0=[$1]) LogicalAggregate(group=[{0, 4}], price=[SUM($12)], discount=[SUM($11)], num=[COUNT()]) hints[TumbleAggregationHint options:[4, INSTANT, -1, 1, 0]] - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount$1=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount0$0=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) LogicalCorrelate(correlation=[$cor7], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] Uncollect @@ -68,7 +68,7 @@ LogicalProject(__customerid$0$pk$1=[$6], total_spend=[SUM($15) IGNORE NULLS OVER LogicalTableScan(table=[[customer$i$1]]) LogicalProject(___uuid$0$pk$1=[$0], price=[$2], discount=[$3], num=[$4], time$0=[$1]) LogicalAggregate(group=[{0, 4}], price=[SUM($12)], discount=[SUM($11)], num=[COUNT()]) hints[TumbleAggregationHint options:[4, INSTANT, -1, 1, 0]] - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount$1=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount0$0=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) LogicalCorrelate(correlation=[$cor7], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] Uncollect @@ -81,7 +81,7 @@ LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] opt >>>total$debug6-lp-stream LogicalProject(___uuid$0$pk$1=[$0], price=[$2], discount=[$3], num=[$4], time$0=[$1]) LogicalAggregate(group=[{0, 4}], price=[SUM($12)], discount=[SUM($11)], num=[COUNT()]) hints[TumbleAggregationHint options:[4, INSTANT, -1, 1, 0]] - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount$1=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount0$0=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) LogicalCorrelate(correlation=[$cor7], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] Uncollect diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkJdbcEnginesTest/c360-full_c360-full-graphqlv1_H2.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkJdbcEnginesTest/c360-full_c360-full-graphqlv1_H2.txt index a380a1ab2..9571f72ae 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkJdbcEnginesTest/c360-full_c360-full-graphqlv1_H2.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkJdbcEnginesTest/c360-full_c360-full-graphqlv1_H2.txt @@ -10,7 +10,7 @@ CREATE INDEX IF NOT EXISTS "product$25_btree_c3c5" ON "product$25" USING btree ( CREATE INDEX IF NOT EXISTS "product$25_hash_c5" ON "product$25" USING hash ("category$0"); CREATE TABLE IF NOT EXISTS "category$22" ("name$0" CHARACTER VARYING NOT NULL,"updatetime$0" TIMESTAMP(9) WITH TIME ZONE NOT NULL , PRIMARY KEY ("name$0")); CREATE TABLE IF NOT EXISTS "customer$19" ("customerid$0" BIGINT NOT NULL,"_uuid$0" CHARACTER VARYING NOT NULL,"_ingest_time$0" TIMESTAMP(9) WITH TIME ZONE NOT NULL,"email$0" CHARACTER VARYING NOT NULL,"name$0" CHARACTER VARYING NOT NULL,"lastupdated$0" BIGINT NOT NULL,"updatetime$0" TIMESTAMP(9) WITH TIME ZONE NOT NULL , PRIMARY KEY ("customerid$0")); -CREATE TABLE IF NOT EXISTS "entries$13" ("_uuid$0" CHARACTER VARYING NOT NULL,"_idx$0" INTEGER NOT NULL,"productid$0" BIGINT NOT NULL,"quantity$0" BIGINT NOT NULL,"unit_price$0" DOUBLE PRECISION NOT NULL,"discount$0" DOUBLE PRECISION ,"discount$1" DOUBLE PRECISION NOT NULL,"total$0" DOUBLE PRECISION NOT NULL,"time$0" TIMESTAMP(9) WITH TIME ZONE NOT NULL , PRIMARY KEY ("_uuid$0","_idx$0")); +CREATE TABLE IF NOT EXISTS "entries$13" ("_uuid$0" CHARACTER VARYING NOT NULL,"_idx$0" INTEGER NOT NULL,"productid$0" BIGINT NOT NULL,"quantity$0" BIGINT NOT NULL,"unit_price$0" DOUBLE PRECISION NOT NULL,"discount$0" DOUBLE PRECISION ,"discount0$0" DOUBLE PRECISION NOT NULL,"total$0" DOUBLE PRECISION NOT NULL,"time$0" TIMESTAMP(9) WITH TIME ZONE NOT NULL , PRIMARY KEY ("_uuid$0","_idx$0")); CREATE TABLE IF NOT EXISTS "favorite_categories$46" ("__customerid$0" BIGINT NOT NULL,"category_name$0" CHARACTER VARYING NOT NULL,"total$0" DOUBLE PRECISION NOT NULL,"month$0" TIMESTAMP(9) WITH TIME ZONE NOT NULL , PRIMARY KEY ("__customerid$0","category_name$0")); CREATE TABLE IF NOT EXISTS "newcustomerpromotion$57" ("_uuid$0" CHARACTER VARYING NOT NULL,"_source_time$0" TIMESTAMP(9) WITH TIME ZONE NOT NULL,"customerid$0" BIGINT NOT NULL,"email$0" CHARACTER VARYING NOT NULL,"name$0" CHARACTER VARYING NOT NULL,"total_spend$0" DOUBLE PRECISION NOT NULL,"num_orders$0" BIGINT NOT NULL , PRIMARY KEY ("_uuid$0")); CREATE TABLE IF NOT EXISTS "order_again$36" ("__customerid$0" BIGINT NOT NULL,"productid$0" BIGINT NOT NULL,"quantity$0" BIGINT NOT NULL,"num_orders$0" BIGINT NOT NULL,"most_recent$0" TIMESTAMP(9) WITH TIME ZONE NOT NULL , PRIMARY KEY ("__customerid$0","productid$0")); diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkJdbcEnginesTest/c360-full_c360-full-graphqlv1_POSTGRES.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkJdbcEnginesTest/c360-full_c360-full-graphqlv1_POSTGRES.txt index 89684eb71..4de5b1555 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkJdbcEnginesTest/c360-full_c360-full-graphqlv1_POSTGRES.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkJdbcEnginesTest/c360-full_c360-full-graphqlv1_POSTGRES.txt @@ -10,7 +10,7 @@ CREATE INDEX IF NOT EXISTS product$25_btree_c3c5 ON product$25 USING btree (name CREATE INDEX IF NOT EXISTS product$25_hash_c5 ON product$25 USING hash (category$0); CREATE TABLE IF NOT EXISTS category$22 (name$0 TEXT NOT NULL,updatetime$0 TIMESTAMP WITH TIME ZONE NOT NULL , PRIMARY KEY (name$0)); CREATE TABLE IF NOT EXISTS customer$19 (customerid$0 BIGINT NOT NULL,_uuid$0 TEXT NOT NULL,_ingest_time$0 TIMESTAMP WITH TIME ZONE NOT NULL,email$0 TEXT NOT NULL,name$0 TEXT NOT NULL,lastupdated$0 BIGINT NOT NULL,updatetime$0 TIMESTAMP WITH TIME ZONE NOT NULL , PRIMARY KEY (customerid$0)); -CREATE TABLE IF NOT EXISTS entries$13 (_uuid$0 TEXT NOT NULL,_idx$0 INTEGER NOT NULL,productid$0 BIGINT NOT NULL,quantity$0 BIGINT NOT NULL,unit_price$0 DOUBLE PRECISION NOT NULL,discount$0 DOUBLE PRECISION ,discount$1 DOUBLE PRECISION NOT NULL,total$0 DOUBLE PRECISION NOT NULL,time$0 TIMESTAMP WITH TIME ZONE NOT NULL , PRIMARY KEY (_uuid$0,_idx$0)); +CREATE TABLE IF NOT EXISTS entries$13 (_uuid$0 TEXT NOT NULL,_idx$0 INTEGER NOT NULL,productid$0 BIGINT NOT NULL,quantity$0 BIGINT NOT NULL,unit_price$0 DOUBLE PRECISION NOT NULL,discount$0 DOUBLE PRECISION ,discount0$0 DOUBLE PRECISION NOT NULL,total$0 DOUBLE PRECISION NOT NULL,time$0 TIMESTAMP WITH TIME ZONE NOT NULL , PRIMARY KEY (_uuid$0,_idx$0)); CREATE TABLE IF NOT EXISTS favorite_categories$46 (__customerid$0 BIGINT NOT NULL,category_name$0 TEXT NOT NULL,total$0 DOUBLE PRECISION NOT NULL,month$0 TIMESTAMP WITH TIME ZONE NOT NULL , PRIMARY KEY (__customerid$0,category_name$0)); CREATE TABLE IF NOT EXISTS newcustomerpromotion$57 (_uuid$0 TEXT NOT NULL,_source_time$0 TIMESTAMP WITH TIME ZONE NOT NULL,customerid$0 BIGINT NOT NULL,email$0 TEXT NOT NULL,name$0 TEXT NOT NULL,total_spend$0 DOUBLE PRECISION NOT NULL,num_orders$0 BIGINT NOT NULL , PRIMARY KEY (_uuid$0)); CREATE TABLE IF NOT EXISTS order_again$36 (__customerid$0 BIGINT NOT NULL,productid$0 BIGINT NOT NULL,quantity$0 BIGINT NOT NULL,num_orders$0 BIGINT NOT NULL,most_recent$0 TIMESTAMP WITH TIME ZONE NOT NULL , PRIMARY KEY (__customerid$0,productid$0)); diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkJdbcEnginesTest/c360-full_c360-full-graphqlv1_SQLITE.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkJdbcEnginesTest/c360-full_c360-full-graphqlv1_SQLITE.txt index f399daf33..3f7d56f2f 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkJdbcEnginesTest/c360-full_c360-full-graphqlv1_SQLITE.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkJdbcEnginesTest/c360-full_c360-full-graphqlv1_SQLITE.txt @@ -10,7 +10,7 @@ CREATE INDEX IF NOT EXISTS product$25_btree_c3c5 ON product$25 ("name$0","catego CREATE INDEX IF NOT EXISTS product$25_hash_c5 ON product$25 ("category$0") CREATE TABLE IF NOT EXISTS "category$22" ("name$0" VARCHAR NOT NULL,"updatetime$0" INTEGER NOT NULL , PRIMARY KEY ("name$0")); CREATE TABLE IF NOT EXISTS "customer$19" ("customerid$0" BIGINT NOT NULL,"_uuid$0" VARCHAR NOT NULL,"_ingest_time$0" INTEGER NOT NULL,"email$0" VARCHAR NOT NULL,"name$0" VARCHAR NOT NULL,"lastupdated$0" BIGINT NOT NULL,"updatetime$0" INTEGER NOT NULL , PRIMARY KEY ("customerid$0")); -CREATE TABLE IF NOT EXISTS "entries$13" ("_uuid$0" VARCHAR NOT NULL,"_idx$0" BIGINT NOT NULL,"productid$0" BIGINT NOT NULL,"quantity$0" BIGINT NOT NULL,"unit_price$0" DOUBLE NOT NULL,"discount$0" DOUBLE ,"discount$1" DOUBLE NOT NULL,"total$0" DOUBLE NOT NULL,"time$0" INTEGER NOT NULL , PRIMARY KEY ("_uuid$0","_idx$0")); +CREATE TABLE IF NOT EXISTS "entries$13" ("_uuid$0" VARCHAR NOT NULL,"_idx$0" BIGINT NOT NULL,"productid$0" BIGINT NOT NULL,"quantity$0" BIGINT NOT NULL,"unit_price$0" DOUBLE NOT NULL,"discount$0" DOUBLE ,"discount0$0" DOUBLE NOT NULL,"total$0" DOUBLE NOT NULL,"time$0" INTEGER NOT NULL , PRIMARY KEY ("_uuid$0","_idx$0")); CREATE TABLE IF NOT EXISTS "favorite_categories$46" ("__customerid$0" BIGINT NOT NULL,"category_name$0" VARCHAR NOT NULL,"total$0" DOUBLE NOT NULL,"month$0" INTEGER NOT NULL , PRIMARY KEY ("__customerid$0","category_name$0")); CREATE TABLE IF NOT EXISTS "newcustomerpromotion$57" ("_uuid$0" VARCHAR NOT NULL,"_source_time$0" INTEGER NOT NULL,"customerid$0" BIGINT NOT NULL,"email$0" VARCHAR NOT NULL,"name$0" VARCHAR NOT NULL,"total_spend$0" DOUBLE NOT NULL,"num_orders$0" BIGINT NOT NULL , PRIMARY KEY ("_uuid$0")); CREATE TABLE IF NOT EXISTS "order_again$36" ("__customerid$0" BIGINT NOT NULL,"productid$0" BIGINT NOT NULL,"quantity$0" BIGINT NOT NULL,"num_orders$0" BIGINT NOT NULL,"most_recent$0" INTEGER NOT NULL , PRIMARY KEY ("__customerid$0","productid$0")); diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkPhysicalUseCaseTest/c360-full.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkPhysicalUseCaseTest/c360-full.txt index bd3e89c93..490bd6f4e 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkPhysicalUseCaseTest/c360-full.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkPhysicalUseCaseTest/c360-full.txt @@ -2,9 +2,9 @@ LogicalProject(__customerid$0=[$0], month$0=[$1], category$0=[$2], total$0=[$3], savings$0=[$4]) LogicalProject(__customerid$0$pk$1=[$0], month=[$1], category=[$2], total=[$3], savings=[$4]) LogicalAggregate(group=[{0, 1, 2}], total=[SUM($3)], savings=[SUM($4)]) hints[TumbleAggregationHint options:[1, FUNCTION, 4, 2629746000, 0]] - LogicalProject(__customerid$0$pk$1=[$6], month=[endOfMonth($4)], category$0=[$26], total$0=[$20], discount$1=[$19], _uuid$0=[$0], _idx$0=[$14]) + LogicalProject(__customerid$0$pk$1=[$6], month=[endOfMonth($4)], category$0=[$26], total$0=[$20], discount0$0=[$19], _uuid$0=[$0], _idx$0=[$14]) LogicalJoin(condition=[=($15, $21)], joinType=[inner]) hints[TemporalJoinHint options:[4, 6, 0]] - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], customerid$00=[$6], _uuid$00=[$7], _ingest_time$00=[$8], email$0=[$9], name$0=[$10], lastupdated$0=[$11], updatetime$0=[$12], _rownum=[$13], _idx$0=[$14], productid$0=[$15], quantity$0=[$16], unit_price$0=[$17], discount$0=[$18], discount$1=[COALESCE($18, 0.0:DOUBLE)], total$0=[-(*($16, $17), COALESCE($18, 0.0:DOUBLE))]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], customerid$00=[$6], _uuid$00=[$7], _ingest_time$00=[$8], email$0=[$9], name$0=[$10], lastupdated$0=[$11], updatetime$0=[$12], _rownum=[$13], _idx$0=[$14], productid$0=[$15], quantity$0=[$16], unit_price$0=[$17], discount$0=[$18], discount0$0=[COALESCE($18, 0.0:DOUBLE)], total$0=[-(*($16, $17), COALESCE($18, 0.0:DOUBLE))]) LogicalCorrelate(correlation=[$cor7], joinType=[inner], requiredColumns=[{5}]) LogicalJoin(condition=[=($6, $3)], joinType=[inner]) hints[TemporalJoinHint options:[4, 6, 0]] LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] @@ -35,7 +35,7 @@ LogicalProject(customerid$0=[$0], _uuid$0=[$1], _ingest_time$0=[$2], email$0=[$3 LogicalTableScan(table=[[customer$i$1]]) >>>entries$13-lp-stream -LogicalProject(_uuid$0=[$0], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount$1=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))], time$0=[$4]) +LogicalProject(_uuid$0=[$0], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount0$0=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))], time$0=[$4]) LogicalCorrelate(correlation=[$cor12], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] Uncollect @@ -49,9 +49,9 @@ LogicalProject(__customerid$0=[$0], category_name$0=[$1], total$0=[$2], month$0= LogicalJoin(condition=[=($5, $0)], joinType=[inner]) hints[TemporalJoinHint options:[1, 6, 0]] LogicalProject(__customerid$0$pk$1=[$0], month=[$1], category=[$2], total=[$3], savings=[$4]) LogicalAggregate(group=[{0, 1, 2}], total=[SUM($3)], savings=[SUM($4)]) hints[TumbleAggregationHint options:[1, FUNCTION, 4, 2629746000, 0]] - LogicalProject(__customerid$0$pk$1=[$6], month=[endOfMonth($4)], category$0=[$26], total$0=[$20], discount$1=[$19], _uuid$0=[$0], _idx$0=[$14]) + LogicalProject(__customerid$0$pk$1=[$6], month=[endOfMonth($4)], category$0=[$26], total$0=[$20], discount0$0=[$19], _uuid$0=[$0], _idx$0=[$14]) LogicalJoin(condition=[=($15, $21)], joinType=[inner]) hints[TemporalJoinHint options:[4, 6, 0]] - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], customerid$00=[$6], _uuid$00=[$7], _ingest_time$00=[$8], email$0=[$9], name$0=[$10], lastupdated$0=[$11], updatetime$0=[$12], _rownum=[$13], _idx$0=[$14], productid$0=[$15], quantity$0=[$16], unit_price$0=[$17], discount$0=[$18], discount$1=[COALESCE($18, 0.0:DOUBLE)], total$0=[-(*($16, $17), COALESCE($18, 0.0:DOUBLE))]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], customerid$00=[$6], _uuid$00=[$7], _ingest_time$00=[$8], email$0=[$9], name$0=[$10], lastupdated$0=[$11], updatetime$0=[$12], _rownum=[$13], _idx$0=[$14], productid$0=[$15], quantity$0=[$16], unit_price$0=[$17], discount$0=[$18], discount0$0=[COALESCE($18, 0.0:DOUBLE)], total$0=[-(*($16, $17), COALESCE($18, 0.0:DOUBLE))]) LogicalCorrelate(correlation=[$cor7], joinType=[inner], requiredColumns=[{5}]) LogicalJoin(condition=[=($6, $3)], joinType=[inner]) hints[TemporalJoinHint options:[4, 6, 0]] LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] @@ -99,7 +99,7 @@ LogicalProject(_uuid$0=[$0], _source_time$0=[$1], customerid$0=[$2], email$0=[$3 LogicalTableScan(table=[[customer$i$1]]) LogicalProject(___uuid$0$pk$1=[$0], price=[$2], discount=[$3], num=[$4], time$0=[$1]) LogicalAggregate(group=[{0, 4}], price=[SUM($12)], discount=[SUM($11)], num=[COUNT()]) hints[TumbleAggregationHint options:[4, INSTANT, -1, 1, 0]] - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount$1=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount0$0=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) LogicalCorrelate(correlation=[$cor11], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] Uncollect @@ -134,7 +134,7 @@ LogicalProject(__customerid$0=[$0], total_spend$0=[$1], num_orders$0=[$2], time$ LogicalTableScan(table=[[customer$i$1]]) LogicalProject(___uuid$0$pk$1=[$0], price=[$2], discount=[$3], num=[$4], time$0=[$1]) LogicalAggregate(group=[{0, 4}], price=[SUM($12)], discount=[SUM($11)], num=[COUNT()]) hints[TumbleAggregationHint options:[4, INSTANT, -1, 1, 0]] - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount$1=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount0$0=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) LogicalCorrelate(correlation=[$cor11], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] Uncollect @@ -155,7 +155,7 @@ LogicalProject(productid$0=[$0], _uuid$0=[$1], _ingest_time$0=[$2], name$0=[$3], LogicalProject(___uuid$0=[$0], price$0=[$1], discount$0=[$2], num$0=[$3], time$0=[$4]) LogicalProject(___uuid$0$pk$1=[$0], price=[$2], discount=[$3], num=[$4], time$0=[$1]) LogicalAggregate(group=[{0, 4}], price=[SUM($12)], discount=[SUM($11)], num=[COUNT()]) hints[TumbleAggregationHint options:[4, INSTANT, -1, 1, 0]] - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount$1=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount0$0=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) LogicalCorrelate(correlation=[$cor11], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] Uncollect @@ -179,7 +179,7 @@ LogicalSort(sort0=[$0], dir0=[ASC]) >>>entries-lp-database LogicalSort(sort0=[$8], sort1=[$0], sort2=[$1], dir0=[DESC-nulls-last], dir1=[ASC], dir2=[ASC]) - LogicalProject(_uuid$0=[$0], _idx$0=[$1], productid$0=[$2], quantity$0=[$3], unit_price$0=[$4], discount$0=[$5], discount$1=[$6], total$0=[$7], time$0=[$8]) + LogicalProject(_uuid$0=[$0], _idx$0=[$1], productid$0=[$2], quantity$0=[$3], unit_price$0=[$4], discount$0=[$5], discount0$0=[$6], total$0=[$7], time$0=[$8]) LogicalTableScan(table=[[entries$13]]) >>>favorite_categories-lp-database diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkPhysicalUseCaseTest/c360-orderstats.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkPhysicalUseCaseTest/c360-orderstats.txt index 3bd0e47cf..75716780f 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkPhysicalUseCaseTest/c360-orderstats.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkPhysicalUseCaseTest/c360-orderstats.txt @@ -5,7 +5,7 @@ LogicalProject(customerid$0=[$0], total_price$0=[$1], num_orders$0=[$2], time$0= LogicalTableScan(table=[[orders$i$1]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] LogicalProject(___uuid$0$pk$1=[$0], price=[$2], number=[$3], savings=[$4], time$0=[$1]) LogicalAggregate(group=[{0, 4}], price=[SUM($12)], number=[COUNT()], savings=[SUM($11)]) hints[TumbleAggregationHint options:[4, INSTANT, -1, 1, 0]] - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount$1=[COALESCE($10, 0.0:DOUBLE)], price$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount0$0=[COALESCE($10, 0.0:DOUBLE)], price$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) LogicalCorrelate(correlation=[$cor3], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$i$1]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] Uncollect @@ -13,7 +13,7 @@ LogicalProject(customerid$0=[$0], total_price$0=[$1], num_orders$0=[$2], time$0= LogicalValues(tuples=[[{ 0 }]]) >>>entries$5-lp-stream -LogicalProject(_uuid$0=[$0], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount$1=[COALESCE($10, 0.0:DOUBLE)], price$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))], time$0=[$4]) +LogicalProject(_uuid$0=[$0], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount0$0=[COALESCE($10, 0.0:DOUBLE)], price$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))], time$0=[$4]) LogicalCorrelate(correlation=[$cor4], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$i$1]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] Uncollect @@ -28,7 +28,7 @@ LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], LogicalProject(___uuid$0=[$0], price$0=[$1], number$0=[$2], savings$0=[$3], time$0=[$4]) LogicalProject(___uuid$0$pk$1=[$0], price=[$2], number=[$3], savings=[$4], time$0=[$1]) LogicalAggregate(group=[{0, 4}], price=[SUM($12)], number=[COUNT()], savings=[SUM($11)]) hints[TumbleAggregationHint options:[4, INSTANT, -1, 1, 0]] - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount$1=[COALESCE($10, 0.0:DOUBLE)], price$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount0$0=[COALESCE($10, 0.0:DOUBLE)], price$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) LogicalCorrelate(correlation=[$cor3], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$i$1]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] Uncollect @@ -42,7 +42,7 @@ LogicalSort(sort0=[$0], dir0=[ASC]) >>>entries-lp-database LogicalSort(sort0=[$8], sort1=[$0], sort2=[$1], dir0=[DESC-nulls-last], dir1=[ASC], dir2=[ASC]) - LogicalProject(_uuid$0=[$0], _idx$0=[$1], productid$0=[$2], quantity$0=[$3], unit_price$0=[$4], discount$0=[$5], discount$1=[$6], price$0=[$7], time$0=[$8]) + LogicalProject(_uuid$0=[$0], _idx$0=[$1], productid$0=[$2], quantity$0=[$3], unit_price$0=[$4], discount$0=[$5], discount0$0=[$6], price$0=[$7], time$0=[$8]) LogicalTableScan(table=[[entries$5]]) >>>orders-lp-database diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkPhysicalUseCaseTest/c360-recommend.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkPhysicalUseCaseTest/c360-recommend.txt index f11ff7cf4..0a8d92704 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkPhysicalUseCaseTest/c360-recommend.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkPhysicalUseCaseTest/c360-recommend.txt @@ -7,7 +7,7 @@ LogicalProject(__productid$0=[$0], total$0=[$1], num$0=[$2], hour$0=[$3]) LogicalAggregate(group=[{0, 1}], quantity=[SUM($2)], num_orders=[COUNT()]) hints[TumbleAggregationHint options:[1, FUNCTION, 4, 3600000, 0]] LogicalProject(__productid$0$pk$1=[$13], hour=[endOfHour($4)], quantity$0=[$8], _uuid$0=[$0], _idx$0=[$6]) LogicalJoin(condition=[=($7, $13)], joinType=[inner]) hints[TemporalJoinHint options:[4, 6, 0]] - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount$1=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount0$0=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) LogicalCorrelate(correlation=[$cor5], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] Uncollect @@ -33,7 +33,7 @@ LogicalProject(__productid$0=[$0], total$0=[$1], num$0=[$2], hour$0=[$3]) LogicalAggregate(group=[{0, 1}], quantity=[SUM($2)], num_orders=[COUNT()]) hints[TumbleAggregationHint options:[1, FUNCTION, 4, 3600000, 0]] LogicalProject(__productid$0$pk$1=[$13], hour=[endOfHour($4)], quantity$0=[$8], _uuid$0=[$0], _idx$0=[$6]) LogicalJoin(condition=[=($7, $13)], joinType=[inner]) hints[TemporalJoinHint options:[4, 6, 0]] - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount$1=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount0$0=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) LogicalCorrelate(correlation=[$cor5], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] Uncollect @@ -56,7 +56,7 @@ LogicalProject(__productid$0=[$0], hour$0=[$1], quantity$0=[$2], num_orders$0=[$ LogicalAggregate(group=[{0, 1}], quantity=[SUM($2)], num_orders=[COUNT()]) hints[TumbleAggregationHint options:[1, FUNCTION, 4, 3600000, 0]] LogicalProject(__productid$0$pk$1=[$13], hour=[endOfHour($4)], quantity$0=[$8], _uuid$0=[$0], _idx$0=[$6]) LogicalJoin(condition=[=($7, $13)], joinType=[inner]) hints[TemporalJoinHint options:[4, 6, 0]] - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount$1=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount0$0=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) LogicalCorrelate(correlation=[$cor5], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] Uncollect @@ -81,7 +81,7 @@ LogicalProject(customerid$0=[$0], _uuid$0=[$1], _ingest_time$0=[$2], email$0=[$3 LogicalTableScan(table=[[customer$i$1]]) >>>entries$13-lp-stream -LogicalProject(_uuid$0=[$0], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount$1=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))], time$0=[$4]) +LogicalProject(_uuid$0=[$0], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount0$0=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))], time$0=[$4]) LogicalCorrelate(correlation=[$cor8], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] Uncollect @@ -102,7 +102,7 @@ LogicalProject(productid$0=[$0], _uuid$0=[$1], _ingest_time$0=[$2], name$0=[$3], LogicalProject(___uuid$0=[$0], price$0=[$1], discount$0=[$2], num$0=[$3], time$0=[$4]) LogicalProject(___uuid$0$pk$1=[$0], price=[$2], discount=[$3], num=[$4], time$0=[$1]) LogicalAggregate(group=[{0, 4}], price=[SUM($12)], discount=[SUM($11)], num=[COUNT()]) hints[TumbleAggregationHint options:[4, INSTANT, -1, 1, 0]] - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount$1=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], id$0=[$2], customerid$0=[$3], time$0=[$4], entries$0=[$5], _idx$0=[$6], productid$0=[$7], quantity$0=[$8], unit_price$0=[$9], discount$0=[$10], discount0$0=[COALESCE($10, 0.0:DOUBLE)], total$0=[-(*($8, $9), COALESCE($10, 0.0:DOUBLE))]) LogicalCorrelate(correlation=[$cor7], joinType=[inner], requiredColumns=[{5}]) LogicalTableScan(table=[[orders$i$9]], hints=[[[WatermarkHint inheritPath:[] options:[4]]]]) hints[WatermarkHint options:[4]] Uncollect @@ -149,7 +149,7 @@ LogicalSort(sort0=[$0], dir0=[ASC]) >>>entries-lp-database LogicalSort(sort0=[$8], sort1=[$0], sort2=[$1], dir0=[DESC-nulls-last], dir1=[ASC], dir2=[ASC]) - LogicalProject(_uuid$0=[$0], _idx$0=[$1], productid$0=[$2], quantity$0=[$3], unit_price$0=[$4], discount$0=[$5], discount$1=[$6], total$0=[$7], time$0=[$8]) + LogicalProject(_uuid$0=[$0], _idx$0=[$1], productid$0=[$2], quantity$0=[$3], unit_price$0=[$4], discount$0=[$5], discount0$0=[$6], total$0=[$7], time$0=[$8]) LogicalTableScan(table=[[entries$13]]) >>>orders-lp-database diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkPhysicalUseCaseTest/repo.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkPhysicalUseCaseTest/repo.txt index c23bbb4d4..dd62243e3 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkPhysicalUseCaseTest/repo.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkPhysicalUseCaseTest/repo.txt @@ -1,12 +1,12 @@ >>>package$16-lp-stream LogicalProject(name$0=[$0], submissiontime$0=[$1]) LogicalProject(name=[$2], submissiontime$0=[$17]) - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], name$0=[$2], version$0=[$3], variant$0=[$4], latest$0=[$5], type$0=[$6], license$0=[$7], repository$0=[$8], homepage$0=[$9], documentation$0=[$10], readme$0=[$11], description$0=[$12], uniqueid$0=[$13], file$0=[$14], hash$0=[$15], authorid$0=[$16], submissiontime$0=[$17], files$0=[$18], keywords$0=[$19], variant$1=[COALESCE($4, 'default')], repourl$0=[CONCAT('https://repository.datasqrl.com/', $14)]) hints[WatermarkHint options:[17]] + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], name$0=[$2], version$0=[$3], variant$0=[$4], latest$0=[$5], type$0=[$6], license$0=[$7], repository$0=[$8], homepage$0=[$9], documentation$0=[$10], readme$0=[$11], description$0=[$12], uniqueid$0=[$13], file$0=[$14], hash$0=[$15], authorid$0=[$16], submissiontime$0=[$17], files$0=[$18], keywords$0=[$19], variant0$0=[COALESCE($4, 'default')], repourl$0=[CONCAT('https://repository.datasqrl.com/', $14)]) hints[WatermarkHint options:[17]] LogicalTableScan(table=[[submission$i$1]]) >>>submission$3-lp-stream -LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], name$0=[$2], version$0=[$3], variant$0=[$4], latest$0=[$5], type$0=[$6], license$0=[$7], repository$0=[$8], homepage$0=[$9], documentation$0=[$10], readme$0=[$11], description$0=[$12], uniqueid$0=[$13], file$0=[$14], hash$0=[$15], authorid$0=[$16], submissiontime$0=[$17], variant$1=[$20], repourl$0=[$21]) - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], name$0=[$2], version$0=[$3], variant$0=[$4], latest$0=[$5], type$0=[$6], license$0=[$7], repository$0=[$8], homepage$0=[$9], documentation$0=[$10], readme$0=[$11], description$0=[$12], uniqueid$0=[$13], file$0=[$14], hash$0=[$15], authorid$0=[$16], submissiontime$0=[$17], files$0=[$18], keywords$0=[$19], variant$1=[COALESCE($4, 'default')], repourl$0=[CONCAT('https://repository.datasqrl.com/', $14)]) hints[WatermarkHint options:[17]] +LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], name$0=[$2], version$0=[$3], variant$0=[$4], latest$0=[$5], type$0=[$6], license$0=[$7], repository$0=[$8], homepage$0=[$9], documentation$0=[$10], readme$0=[$11], description$0=[$12], uniqueid$0=[$13], file$0=[$14], hash$0=[$15], authorid$0=[$16], submissiontime$0=[$17], variant0$0=[$20], repourl$0=[$21]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], name$0=[$2], version$0=[$3], variant$0=[$4], latest$0=[$5], type$0=[$6], license$0=[$7], repository$0=[$8], homepage$0=[$9], documentation$0=[$10], readme$0=[$11], description$0=[$12], uniqueid$0=[$13], file$0=[$14], hash$0=[$15], authorid$0=[$16], submissiontime$0=[$17], files$0=[$18], keywords$0=[$19], variant0$0=[COALESCE($4, 'default')], repourl$0=[CONCAT('https://repository.datasqrl.com/', $14)]) hints[WatermarkHint options:[17]] LogicalTableScan(table=[[submission$i$1]]) >>>package-lp-database @@ -16,6 +16,6 @@ LogicalSort(sort0=[$0], dir0=[ASC]) >>>submission-lp-database LogicalSort(sort0=[$17], sort1=[$0], dir0=[DESC-nulls-last], dir1=[ASC]) - LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], name$0=[$2], version$0=[$3], variant$0=[$4], latest$0=[$5], type$0=[$6], license$0=[$7], repository$0=[$8], homepage$0=[$9], documentation$0=[$10], readme$0=[$11], description$0=[$12], uniqueid$0=[$13], file$0=[$14], hash$0=[$15], authorid$0=[$16], submissiontime$0=[$17], variant$1=[$18], repourl$0=[$19]) + LogicalProject(_uuid$0=[$0], _ingest_time$0=[$1], name$0=[$2], version$0=[$3], variant$0=[$4], latest$0=[$5], type$0=[$6], license$0=[$7], repository$0=[$8], homepage$0=[$9], documentation$0=[$10], readme$0=[$11], description$0=[$12], uniqueid$0=[$13], file$0=[$14], hash$0=[$15], authorid$0=[$16], submissiontime$0=[$17], variant0$0=[$18], repourl$0=[$19]) LogicalTableScan(table=[[submission$3]]) diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkQueryUseCaseTest/c360-full_c360-full-graphqlv1.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkQueryUseCaseTest/c360-full_c360-full-graphqlv1.txt index 89684eb71..4de5b1555 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkQueryUseCaseTest/c360-full_c360-full-graphqlv1.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkQueryUseCaseTest/c360-full_c360-full-graphqlv1.txt @@ -10,7 +10,7 @@ CREATE INDEX IF NOT EXISTS product$25_btree_c3c5 ON product$25 USING btree (name CREATE INDEX IF NOT EXISTS product$25_hash_c5 ON product$25 USING hash (category$0); CREATE TABLE IF NOT EXISTS category$22 (name$0 TEXT NOT NULL,updatetime$0 TIMESTAMP WITH TIME ZONE NOT NULL , PRIMARY KEY (name$0)); CREATE TABLE IF NOT EXISTS customer$19 (customerid$0 BIGINT NOT NULL,_uuid$0 TEXT NOT NULL,_ingest_time$0 TIMESTAMP WITH TIME ZONE NOT NULL,email$0 TEXT NOT NULL,name$0 TEXT NOT NULL,lastupdated$0 BIGINT NOT NULL,updatetime$0 TIMESTAMP WITH TIME ZONE NOT NULL , PRIMARY KEY (customerid$0)); -CREATE TABLE IF NOT EXISTS entries$13 (_uuid$0 TEXT NOT NULL,_idx$0 INTEGER NOT NULL,productid$0 BIGINT NOT NULL,quantity$0 BIGINT NOT NULL,unit_price$0 DOUBLE PRECISION NOT NULL,discount$0 DOUBLE PRECISION ,discount$1 DOUBLE PRECISION NOT NULL,total$0 DOUBLE PRECISION NOT NULL,time$0 TIMESTAMP WITH TIME ZONE NOT NULL , PRIMARY KEY (_uuid$0,_idx$0)); +CREATE TABLE IF NOT EXISTS entries$13 (_uuid$0 TEXT NOT NULL,_idx$0 INTEGER NOT NULL,productid$0 BIGINT NOT NULL,quantity$0 BIGINT NOT NULL,unit_price$0 DOUBLE PRECISION NOT NULL,discount$0 DOUBLE PRECISION ,discount0$0 DOUBLE PRECISION NOT NULL,total$0 DOUBLE PRECISION NOT NULL,time$0 TIMESTAMP WITH TIME ZONE NOT NULL , PRIMARY KEY (_uuid$0,_idx$0)); CREATE TABLE IF NOT EXISTS favorite_categories$46 (__customerid$0 BIGINT NOT NULL,category_name$0 TEXT NOT NULL,total$0 DOUBLE PRECISION NOT NULL,month$0 TIMESTAMP WITH TIME ZONE NOT NULL , PRIMARY KEY (__customerid$0,category_name$0)); CREATE TABLE IF NOT EXISTS newcustomerpromotion$57 (_uuid$0 TEXT NOT NULL,_source_time$0 TIMESTAMP WITH TIME ZONE NOT NULL,customerid$0 BIGINT NOT NULL,email$0 TEXT NOT NULL,name$0 TEXT NOT NULL,total_spend$0 DOUBLE PRECISION NOT NULL,num_orders$0 BIGINT NOT NULL , PRIMARY KEY (_uuid$0)); CREATE TABLE IF NOT EXISTS order_again$36 (__customerid$0 BIGINT NOT NULL,productid$0 BIGINT NOT NULL,quantity$0 BIGINT NOT NULL,num_orders$0 BIGINT NOT NULL,most_recent$0 TIMESTAMP WITH TIME ZONE NOT NULL , PRIMARY KEY (__customerid$0,productid$0)); diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkQueryUseCaseTest/repo_repo-graphql.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkQueryUseCaseTest/repo_repo-graphql.txt index f096cc5cd..05487f064 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkQueryUseCaseTest/repo_repo-graphql.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/flink/FlinkQueryUseCaseTest/repo_repo-graphql.txt @@ -1,10 +1,10 @@ >>>database -CREATE INDEX IF NOT EXISTS submission$3_btree_c2c18 ON submission$3 USING btree (name$0,variant$1); -CREATE INDEX IF NOT EXISTS submission$3_btree_c2c3c18 ON submission$3 USING btree (name$0,version$0,variant$1); +CREATE INDEX IF NOT EXISTS submission$3_btree_c2c3c4 ON submission$3 USING btree (name$0,version$0,variant$0); +CREATE INDEX IF NOT EXISTS submission$3_btree_c2c4 ON submission$3 USING btree (name$0,variant$0); CREATE INDEX IF NOT EXISTS topicpackages$21_hash_c1 ON topicpackages$21 USING hash (topicname$0); CREATE TABLE IF NOT EXISTS keywords$8 (_uuid$0 TEXT NOT NULL,_idx$0 INTEGER NOT NULL,name$0 TEXT NOT NULL,submissiontime$0 TIMESTAMP WITH TIME ZONE NOT NULL , PRIMARY KEY (_uuid$0,_idx$0)); CREATE TABLE IF NOT EXISTS package$16 (name$0 TEXT NOT NULL,submissiontime$0 TIMESTAMP WITH TIME ZONE NOT NULL , PRIMARY KEY (name$0)); -CREATE TABLE IF NOT EXISTS submission$3 (_uuid$0 TEXT NOT NULL,_ingest_time$0 TIMESTAMP WITH TIME ZONE NOT NULL,name$0 TEXT NOT NULL,version$0 TEXT NOT NULL,variant$0 TEXT ,latest$0 BOOLEAN NOT NULL,type$0 TEXT ,license$0 TEXT ,repository$0 TEXT ,homepage$0 TEXT ,documentation$0 TEXT ,readme$0 TEXT ,description$0 TEXT ,uniqueid$0 TEXT NOT NULL,file$0 TEXT NOT NULL,hash$0 TEXT NOT NULL,authorid$0 TEXT NOT NULL,submissiontime$0 TIMESTAMP WITH TIME ZONE NOT NULL,variant$1 TEXT NOT NULL,repourl$0 TEXT NOT NULL , PRIMARY KEY (_uuid$0)); +CREATE TABLE IF NOT EXISTS submission$3 (_uuid$0 TEXT NOT NULL,_ingest_time$0 TIMESTAMP WITH TIME ZONE NOT NULL,name$0 TEXT NOT NULL,version$0 TEXT NOT NULL,variant$0 TEXT ,latest$0 BOOLEAN NOT NULL,type$0 TEXT ,license$0 TEXT ,repository$0 TEXT ,homepage$0 TEXT ,documentation$0 TEXT ,readme$0 TEXT ,description$0 TEXT ,uniqueid$0 TEXT NOT NULL,file$0 TEXT NOT NULL,hash$0 TEXT NOT NULL,authorid$0 TEXT NOT NULL,submissiontime$0 TIMESTAMP WITH TIME ZONE NOT NULL,variant0$0 TEXT NOT NULL,repourl$0 TEXT NOT NULL , PRIMARY KEY (_uuid$0)); CREATE TABLE IF NOT EXISTS topicpackages$21 (pkgname$0 TEXT NOT NULL,topicname$0 TEXT NOT NULL,numsubmissions$0 BIGINT NOT NULL,lastsubmission$0 TIMESTAMP WITH TIME ZONE NOT NULL , PRIMARY KEY (pkgname$0,topicname$0)); CREATE TABLE IF NOT EXISTS topicsearch$25 (topicname$0 TEXT NOT NULL,numpackages$0 BIGINT NOT NULL,submissiontime$0 TIMESTAMP WITH TIME ZONE NOT NULL , PRIMARY KEY (topicname$0)); >>>query-latest diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/generate/SchemaGeneratorUseCaseTest/c360-full.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/generate/SchemaGeneratorUseCaseTest/c360-full.txt index ce6b7a85c..c475bb523 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/generate/SchemaGeneratorUseCaseTest/c360-full.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/generate/SchemaGeneratorUseCaseTest/c360-full.txt @@ -27,7 +27,7 @@ type Orders { id: Int! customerid: Int! time: String! - entries(productid: Int, quantity: Int, unit_price: Float, discount: Float, total: Float): [entries!] + entries(productid: Int, quantity: Int, unit_price: Float, discount: Float, discount0: Float, total: Float): [entries!] total(price: Float, discount: Float, num: Int): [total!] } @@ -51,8 +51,9 @@ type entries { productid: Int! quantity: Int! unit_price: Float! + discount: Float parent: Orders! - discount: Float! + discount0: Float! total: Float! product(productid: Int, name: String, description: String, category: String, updatetime: String): [Product!] } diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/generate/SchemaGeneratorUseCaseTest/c360-orderstats.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/generate/SchemaGeneratorUseCaseTest/c360-orderstats.txt index 1b8fdab27..12205ed17 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/generate/SchemaGeneratorUseCaseTest/c360-orderstats.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/generate/SchemaGeneratorUseCaseTest/c360-orderstats.txt @@ -8,7 +8,7 @@ type Orders { id: Int! customerid: Int! time: String! - entries(productid: Int, quantity: Int, unit_price: Float, discount: Float, price: Float): [entries!] + entries(productid: Int, quantity: Int, unit_price: Float, discount: Float, discount0: Float, price: Float): [entries!] totals(price: Float, number: Int, savings: Float): [totals!] } @@ -21,8 +21,9 @@ type entries { productid: Int! quantity: Int! unit_price: Float! + discount: Float parent: Orders! - discount: Float! + discount0: Float! price: Float! } diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/generate/SchemaGeneratorUseCaseTest/c360-recommend.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/generate/SchemaGeneratorUseCaseTest/c360-recommend.txt index f86ca91e3..b90b30ea1 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/generate/SchemaGeneratorUseCaseTest/c360-recommend.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/generate/SchemaGeneratorUseCaseTest/c360-recommend.txt @@ -16,7 +16,7 @@ type Orders { id: Int! customerid: Int! time: String! - entries(productid: Int, quantity: Int, unit_price: Float, discount: Float, total: Float): [entries!] + entries(productid: Int, quantity: Int, unit_price: Float, discount: Float, discount0: Float, total: Float): [entries!] total(price: Float, discount: Float, num: Int): [total!] } @@ -39,8 +39,9 @@ type entries { productid: Int! quantity: Int! unit_price: Float! + discount: Float parent: Orders! - discount: Float! + discount0: Float! total: Float! product(productid: Int, name: String, description: String, category: String, updatetime: String): [Product!] } diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/generate/SchemaGeneratorUseCaseTest/repo.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/generate/SchemaGeneratorUseCaseTest/repo.txt index 3019feb4d..2e5bc4df7 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/generate/SchemaGeneratorUseCaseTest/repo.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/generate/SchemaGeneratorUseCaseTest/repo.txt @@ -1,11 +1,11 @@ type Package { name: String! - latest(name: String, version: String, latest: Boolean, type: String, license: String, repository: String, homepage: String, documentation: String): [Submission!] - versions(name: String, version: String, latest: Boolean, type: String, license: String, repository: String, homepage: String, documentation: String): [Submission!] + latest(name: String, version: String, variant: String, latest: Boolean, type: String, license: String, repository: String, homepage: String): [Submission!] + versions(name: String, version: String, variant: String, latest: Boolean, type: String, license: String, repository: String, homepage: String): [Submission!] } type Query { - Submission(name: String, version: String, latest: Boolean, type: String, license: String, repository: String, homepage: String, documentation: String): [Submission!] + Submission(name: String, version: String, variant: String, latest: Boolean, type: String, license: String, repository: String, homepage: String): [Submission!] Package(name: String): [Package!] TopicPackages(pkgname: String, topicname: String, numsubmissions: Int, lastsubmission: String): [TopicPackages!] TopicSearch(topicname: String, numpackages: Int): [TopicSearch!] @@ -14,6 +14,7 @@ type Query { type Submission { name: String! version: String! + variant: String latest: Boolean! type: String license: String @@ -29,7 +30,7 @@ type Submission { submissiontime: String! files(filename: String, filesize: Int): [files!] keywords(name: String): [keywords!] - variant: String! + variant0: String! repoURL: String! } @@ -38,7 +39,7 @@ type TopicPackages { topicname: String! numsubmissions: Int! lastsubmission: String! - latest(name: String, version: String, latest: Boolean, type: String, license: String, repository: String, homepage: String, documentation: String): [Submission!] + latest(name: String, version: String, variant: String, latest: Boolean, type: String, license: String, repository: String, homepage: String): [Submission!] } type TopicSearch { diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/inference/IndexSelectionUseCaseTest/repo_repo-graphql.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/inference/IndexSelectionUseCaseTest/repo_repo-graphql.txt index e14813439..93b01a5d4 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/inference/IndexSelectionUseCaseTest/repo_repo-graphql.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/graphql/inference/IndexSelectionUseCaseTest/repo_repo-graphql.txt @@ -1,3 +1,3 @@ -submission$3_btree_c2c18 - 47.500 -submission$3_btree_c2c3c18 - 3897.375 +submission$3_btree_c2c3c4 - 3897.375 +submission$3_btree_c2c4 - 47.500 topicpackages$21_hash_c1 - 950.000