Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2265,7 +2265,7 @@ public VisitDecision preorder(DBSPFieldExpression expression) {
// We are explicitly taking a reference for these cases
avoidRef = true;
}
} else if (parent.is(DBSPBorrowExpression.class)) {
} else if (parent.is(DBSPBorrowExpression.class) || parent.is(DBSPLazyExpression.class)) {
// Pattern appearing in aggregation
avoidRef = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -806,4 +806,21 @@ CREATE TABLE purchase (
SUM(value) OVER (ORDER BY ts ROWS BETWEEN 2 PRECEDING AND CURRENT ROW) AS rolling_sum
FROM purchase;""", "Not yet implemented: Window aggregates with ROWS");
}

@Test
public void jsonTests() {
this.getCCS("""
CREATE TYPE c_t AS ("value" VARCHAR);
CREATE TYPE b_t AS ("x" c_t, "y" c_t);
CREATE TYPE a_t AS ("b" b_t);
CREATE FUNCTION jsonstring_as_a_t(input VARCHAR) RETURNS a_t;

CREATE TABLE src ("data" VARCHAR);

CREATE VIEW v AS
SELECT
jsonstring_as_a_t("data")."b"."x"."value" AS "x_val",
jsonstring_as_a_t("data")."b"."y"."value" AS "y_val"
FROM src;""");
}
}