-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
81 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { table } from "../../src"; | ||
import { configureClickhouse } from "../utils"; | ||
import { addSimpleStringSerializer } from "../utils"; | ||
addSimpleStringSerializer(); | ||
|
||
describe("clickhouse final", () => { | ||
const t1 = table(["x", "y"], "t11_clickhouse").clickhouse.final(); | ||
const { run } = configureClickhouse(); | ||
|
||
beforeAll(async () => { | ||
await run(`DROP TABLE IF EXISTS t11_clickhouse`); | ||
await run( | ||
`CREATE TABLE IF NOT EXISTS t11_clickhouse(x Int64, y Int64) ENGINE = AggregatingMergeTree() ORDER BY y` | ||
); | ||
}); | ||
|
||
it("no alias", async () => { | ||
const q = t1 | ||
.selectStar() | ||
.groupBy((f) => [f.x, f.y]) | ||
.clickhouse.withRollup() | ||
.stringify(); | ||
expect(q).toMatchInlineSnapshot( | ||
`SELECT * FROM \`t11_clickhouse\` FINAL GROUP BY \`x\`, \`y\` WITH ROLLUP` | ||
); | ||
expect(await run(q)).toMatchInlineSnapshot(`Array []`); | ||
}); | ||
}); |
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