Skip to content

Commit d5b6d69

Browse files
committed
Add tests
1 parent 9c51dfb commit d5b6d69

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/cubejs-testing-drivers/src/tests/testQueries.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,5 +2118,25 @@ from
21182118
`);
21192119
expect(res.rows).toMatchSnapshot();
21202120
});
2121+
2122+
executePg('SQL API: Date/time comparison with SQL push down', async (connection) => {
2123+
const res = await connection.query(`
2124+
SELECT MEASURE(BigECommerce.rollingCountBy2Day)
2125+
FROM BigECommerce
2126+
WHERE BigECommerce.orderDate < CAST('2021-01-01' AS TIMESTAMP) AND
2127+
LOWER("city") = 'columbus'
2128+
`);
2129+
expect(res.rows).toMatchSnapshot();
2130+
});
2131+
2132+
executePg('SQL API: Date/time comparison with date_trunc with SQL push down', async (connection) => {
2133+
const res = await connection.query(`
2134+
SELECT MEASURE(BigECommerce.rollingCountBy2Week)
2135+
FROM BigECommerce
2136+
WHERE date_trunc('day', BigECommerce.orderDate) < CAST('2021-01-01' AS TIMESTAMP) AND
2137+
LOWER("city") = 'columbus'
2138+
`);
2139+
expect(res.rows).toMatchSnapshot();
2140+
});
21212141
});
21222142
}

0 commit comments

Comments
 (0)