diff --git a/docker-compose.yml b/docker-compose.yml index 84ed9b532..99b8bfbc7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,9 @@ services: clickhouse: - image: clickhouse/clickhouse-server:26.2.4 + # Override CLICKHOUSE_IMAGE to test against a custom build, e.g. one + # containing the `EXPLAIN AST json = 1` PR (see + # tests/clickhouse-reference-ast-json/README.md). + image: ${CLICKHOUSE_IMAGE:-clickhouse/clickhouse-server:26.2.4} environment: - CLICKHOUSE_USER=default - CLICKHOUSE_PASSWORD=clickhouse diff --git a/package.json b/package.json index 27854d1dc..2f816a4c7 100644 --- a/package.json +++ b/package.json @@ -39,13 +39,15 @@ "prepublishOnly": "npm run typecheck && npm run lint && npm run test && npm run build", "release": "npm publish --access public", "generate:expected-outputs": "npx tsx scripts/generate-expected-outputs.ts", + "generate:ast-json-fixtures": "tsx scripts/generate-ast-json-fixtures.ts", "parse": "tsx scripts/parse.ts", "format": "tsx scripts/format.ts", "explain": "tsx scripts/explain.ts", "explain:ch": "node scripts/clickhouse-explain.js", "diff:ast": "tsx scripts/diff-ast.ts", "diff:format": "tsx scripts/diff-format.ts", - "diff:explain": "tsx scripts/diff-explain.ts" + "diff:explain": "tsx scripts/diff-explain.ts", + "diff:ast-json": "tsx scripts/diff-ast-json.ts" }, "keywords": [ "clickhouse", diff --git a/scripts/clickhouse-explain.js b/scripts/clickhouse-explain.js index d71dea7c8..c6aac5fe9 100644 --- a/scripts/clickhouse-explain.js +++ b/scripts/clickhouse-explain.js @@ -2,15 +2,20 @@ 'use strict'; // Run EXPLAIN AST against a local ClickHouse server (default http://localhost:8125). -// Usage: npm run explain:ch "" +// Usage: npm run explain:ch -- [--json] "" +// +// With --json, runs `EXPLAIN AST json = 1` (requires a ClickHouse build that +// contains the JSON AST PR — see tests/clickhouse-reference-ast-json/README.md). const CLICKHOUSE_URL = process.env.CLICKHOUSE_URL || 'http://localhost:8125'; const USER = process.env.CLICKHOUSE_USER || 'default'; const PASSWORD = process.env.CLICKHOUSE_PASSWORD || 'clickhouse'; -const sql = process.argv.slice(2).join(' '); +const args = process.argv.slice(2); +const jsonMode = args.includes('--json'); +const sql = args.filter((a) => a !== '--json').join(' '); if (!sql) { - process.stderr.write('Usage: npm run explain:ch ""\n'); + process.stderr.write('Usage: npm run explain:ch -- [--json] ""\n'); process.exit(1); } @@ -18,7 +23,7 @@ const url = `${CLICKHOUSE_URL}/?user=${encodeURIComponent(USER)}&password=${enco fetch(url, { method: 'POST', - body: `EXPLAIN AST ${sql}`, + body: `EXPLAIN AST ${jsonMode ? 'json = 1 ' : ''}${sql}`, signal: AbortSignal.timeout(30_000), }) .then(async (res) => { diff --git a/scripts/diff-ast-json.ts b/scripts/diff-ast-json.ts new file mode 100644 index 000000000..5cc641ba5 --- /dev/null +++ b/scripts/diff-ast-json.ts @@ -0,0 +1,63 @@ +#!/usr/bin/env tsx + +/** + * Shows the `EXPLAIN AST json = 1` output produced by explainJSON() for one or + * more vendored reference cases (tests/clickhouse-reference-ast-json/cases), + * the expected JSON generated by the reference ClickHouse build, and the diff + * between them. + * + * Both sides are re-serialized with sorted object keys so key order never + * causes spurious diffs (the comparison is structural, like the test suite). + * + * Run via: npm run diff:ast-json -- [options] (see --help) + */ + +import { explainJSON, parse } from '../src/index.js'; +import { parseCli, run } from './diff-lib.js'; + +const CASES_DIR = new URL('../tests/clickhouse-reference-ast-json/cases', import.meta.url) + .pathname; + +function sortKeys(value: unknown): unknown { + if (Array.isArray(value)) return value.map(sortKeys); + if (value !== null && typeof value === 'object') { + const result: Record = {}; + for (const key of Object.keys(value as Record).sort()) { + result[key] = sortKeys((value as Record)[key]); + } + return result; + } + return value; +} + +function canonicalize(json: unknown): string { + return JSON.stringify(sortKeys(json), null, 2); +} + +const opts = parseCli( + process.argv, + 'diff:ast-json', + 'explainJSON() output vs. vendored EXPLAIN AST json = 1 output', +); + +run( + opts, + '.json', + (sql) => { + const statements = parse(sql); + if (statements.length !== 1) { + throw new Error(`expected exactly one statement, got ${statements.length}`); + } + return canonicalize(explainJSON(statements[0]).ast); + }, + { + dir: CASES_DIR, + expectedPathFor: (sqlPath) => sqlPath.replace(/\.sql$/, '.json'), + normalizeExpected: (expected) => { + const parsed = JSON.parse(expected) as Record; + // Fixtures may be the bare AST node or the {version, ast} document. + return canonicalize('ast' in parsed ? parsed.ast : parsed); + }, + }, +); + diff --git a/scripts/diff-lib.ts b/scripts/diff-lib.ts index 6abca7f8a..d0bacfa33 100644 --- a/scripts/diff-lib.ts +++ b/scripts/diff-lib.ts @@ -24,13 +24,13 @@ const EXPLAIN_ERROR = ''; // ── Output computation (shared by the plain and diff scripts) ─────────────────── -/** Recursively removes `location` and `parent` keys, matching tests/helpers.ts. */ +/** Recursively removes `location`, `parent`, and `isOperator` keys, matching tests/helpers.ts. */ export function stripMeta(value: unknown): unknown { if (value === null || value === undefined || typeof value !== 'object') return value; if (Array.isArray(value)) return value.map(stripMeta); const result: Record = {}; for (const [k, v] of Object.entries(value as Record)) { - if (k === 'location' || k === 'parent') continue; + if (k === 'location' || k === 'parent' || k === 'isOperator') continue; result[k] = stripMeta(v); } return result; @@ -85,13 +85,13 @@ export type Compute = (sql: string, expected: string | null) => string; * pattern (matched against the `.sql` filenames). The `.sql` suffix is optional * for exact-name matches. */ -export function resolveReferences(selector: string): string[] { - if (!fs.existsSync(CLICKHOUSE_DIR)) { - throw new Error(`Reference directory not found: ${CLICKHOUSE_DIR}`); +export function resolveReferences(selector: string, dir: string = CLICKHOUSE_DIR): string[] { + if (!fs.existsSync(dir)) { + throw new Error(`Reference directory not found: ${dir}`); } const allCases = fs - .readdirSync(CLICKHOUSE_DIR) + .readdirSync(dir) .filter((f) => f.endsWith('.sql') && !f.includes('.expected.')); const caseSet = new Set(allCases); @@ -291,8 +291,24 @@ function renderCase(result: CaseResult, opts: CliOptions): boolean { * Top-level runner for the diff scripts. Resolves references, computes each case via * `compute`, renders them, and prints a summary / sets exit code. */ -export function run(opts: CliOptions, expectedSuffix: string, compute: Compute): void { - const files = resolveReferences(opts.selector); +/** Optional corpus layout overrides for {@link run}. */ +export interface RunLayout { + /** Directory holding the `.sql` cases. Defaults to {@link CLICKHOUSE_DIR}. */ + dir?: string; + /** Maps a case's `.sql` path to its expected-output path. Defaults to appending the suffix. */ + expectedPathFor?: (sqlPath: string) => string; + /** Normalizes the raw expected file contents before comparison/diffing. */ + normalizeExpected?: (expected: string) => string; +} + +export function run( + opts: CliOptions, + expectedSuffix: string, + compute: Compute, + layout: RunLayout = {}, +): void { + const dir = layout.dir ?? CLICKHOUSE_DIR; + const files = resolveReferences(opts.selector, dir); if (files.length === 0) { process.stderr.write(pc.red('No reference cases matched the given selector.\n')); @@ -303,9 +319,12 @@ export function run(opts: CliOptions, expectedSuffix: string, compute: Compute): let shown = 0; for (const fileName of files) { - const sqlPath = path.join(CLICKHOUSE_DIR, fileName); - const expectedPath = `${sqlPath}${expectedSuffix}`; - const expected = fs.existsSync(expectedPath) ? fs.readFileSync(expectedPath, 'utf-8') : null; + const sqlPath = path.join(dir, fileName); + const expectedPath = layout.expectedPathFor + ? layout.expectedPathFor(sqlPath) + : `${sqlPath}${expectedSuffix}`; + let expected = fs.existsSync(expectedPath) ? fs.readFileSync(expectedPath, 'utf-8') : null; + if (expected !== null && layout.normalizeExpected) expected = layout.normalizeExpected(expected); let actual: string; try { diff --git a/scripts/generate-ast-json-fixtures.ts b/scripts/generate-ast-json-fixtures.ts new file mode 100644 index 000000000..afe9b9929 --- /dev/null +++ b/scripts/generate-ast-json-fixtures.ts @@ -0,0 +1,70 @@ +#!/usr/bin/env tsx + +/** + * Regenerates the vendored `EXPLAIN AST json = 1` fixtures in + * tests/clickhouse-reference-ast-json/cases from their `.sql` inputs. + * + * Requires a ClickHouse build that contains the JSON AST PR (see the corpus + * README for the source PR and pinned commit SHA). Point docker-compose at + * such a build and start it first: + * + * CLICKHOUSE_IMAGE= docker compose up -d + * npm run generate:ast-json-fixtures + * + * Until such an image is available the vendored copies are the source of + * truth — this script will fail against a stock ClickHouse server because it + * does not understand the `json` EXPLAIN AST option. + */ + +import { readFileSync, readdirSync, writeFileSync } from 'fs'; +import { join } from 'path'; + +const CASES_DIR = new URL('../tests/clickhouse-reference-ast-json/cases', import.meta.url) + .pathname; + +const CLICKHOUSE_URL = process.env.CLICKHOUSE_URL || 'http://localhost:8125'; +const USER = process.env.CLICKHOUSE_USER || 'default'; +const PASSWORD = process.env.CLICKHOUSE_PASSWORD || 'clickhouse'; + +async function explainASTJSON(sql: string): Promise { + const url = + `${CLICKHOUSE_URL}/?user=${encodeURIComponent(USER)}&password=${encodeURIComponent(PASSWORD)}&default_format=Raw&union_default_mode=ALL`; + const res = await fetch(url, { + method: 'POST', + body: `EXPLAIN AST json = 1 ${sql}`, + signal: AbortSignal.timeout(30_000), + }); + const text = await res.text(); + if (!res.ok) { + throw new Error(`HTTP ${res.status}: ${text}`); + } + return text; +} + +async function main(): Promise { + const cases = readdirSync(CASES_DIR) + .filter((f) => f.endsWith('.sql')) + .sort(); + let failures = 0; + for (const fileName of cases) { + const sql = readFileSync(join(CASES_DIR, fileName), 'utf-8').trim(); + const jsonPath = join(CASES_DIR, fileName.replace(/\.sql$/, '.json')); + try { + const output = await explainASTJSON(sql); + writeFileSync(jsonPath, output.trimEnd() + '\n', 'utf-8'); + process.stdout.write(`✓ ${fileName}\n`); + } catch (e) { + failures++; + process.stderr.write(`✗ ${fileName}: ${e instanceof Error ? e.message : String(e)}\n`); + } + } + if (failures > 0) { + process.stderr.write( + `\n${failures} case(s) failed. Is a ClickHouse server with the JSON AST PR running ` + + `at ${CLICKHOUSE_URL}? See tests/clickhouse-reference-ast-json/README.md.\n`, + ); + process.exit(1); + } +} + +void main(); diff --git a/scripts/generate-expected-outputs.ts b/scripts/generate-expected-outputs.ts index 9c369d090..647500c04 100644 --- a/scripts/generate-expected-outputs.ts +++ b/scripts/generate-expected-outputs.ts @@ -257,7 +257,7 @@ async function processFile(file: string): Promise { try { ast = parse(content); - astOutput = JSON.stringify(ast, (key, value) => (key === 'location' || key === 'parent' ? undefined : value), 2); + astOutput = JSON.stringify(ast, (key, value) => (key === 'location' || key === 'parent' || key === 'isOperator' ? undefined : value), 2); try { formattedOutput = format(ast); } catch (e) { diff --git a/src/ast.ts b/src/ast.ts index b8375c2a1..9947d75e0 100644 --- a/src/ast.ts +++ b/src/ast.ts @@ -339,6 +339,14 @@ export type TupleExpansion = { */ export type JoinType = 'INNER' | 'LEFT' | 'RIGHT' | 'FULL' | 'CROSS' | 'PASTE'; +/** + * Join strictness qualifier: `ANY`, `ALL`, `ASOF`, `SEMI`, or `ANTI`. + * + * @example `LEFT ANY JOIN` → `'ANY'` + * @example `ASOF JOIN` → `'ASOF'` + */ +export type JoinStrictness = 'ANY' | 'ALL' | 'ASOF' | 'SEMI' | 'ANTI'; + /** * The type of ARRAY JOIN operation. * @@ -420,8 +428,19 @@ export type FunctionCall = { args: Expression[]; /** Function-level SETTINGS, e.g. `func(x SETTINGS y=1)`. */ funcSettings?: SettingItem[]; - /** Window specification when used as a window function. */ + /** `true` when the call was written with operator syntax that the parser + * desugars into a function call (e.g. `arr[1]` → `arrayElement`, + * `a BETWEEN x AND y` → `and(greaterOrEquals(...), lessOrEquals(...))`, + * `c ? a : b` → `if`, `-x` → `negate`, `a LIKE b` → `like`). Absent for + * explicit function-call syntax. */ + isOperator?: boolean; + /** NULLS handling modifier on aggregate/window functions: + * `RESPECT NULLS` or `IGNORE NULLS`. */ + nullsAction?: 'RESPECT NULLS' | 'IGNORE NULLS'; + /** Window specification when used as a window function: `OVER (spec)`. */ window?: WindowSpec; + /** Named-window reference: `w` in `OVER w` (without parentheses). */ + windowName?: string; /** Whether the entire function call was wrapped in parentheses in the source. */ parenthesized?: boolean; } & NodeMetadata; @@ -760,7 +779,10 @@ export const FunctionCallSchema: z.ZodType = z.lazy(() => params: z.array(ExpressionSchema).optional(), args: z.array(ExpressionSchema), funcSettings: z.array(SettingItemSchema).optional(), + isOperator: z.boolean().optional(), + nullsAction: z.union([z.literal('RESPECT NULLS'), z.literal('IGNORE NULLS')]).optional(), window: WindowSpecSchema.optional(), + windowName: z.string().optional(), parenthesized: z.boolean().optional(), ...ExprMetadataFields, }), @@ -917,6 +939,10 @@ export type OrderByItem = { expr: Expression; /** Sort direction. */ direction: 'ASC' | 'DESC'; + /** `true` for `NULLS FIRST`, `false` for `NULLS LAST`; absent when not specified. */ + nullsFirst?: boolean; + /** `true` when a `WITH FILL` modifier is present (even without FROM/TO/STEP arguments). */ + withFill?: boolean; /** Collation name for string sorting. */ collate?: string; /** WITH FILL start value. */ @@ -944,6 +970,8 @@ export const OrderByItemSchema = z.object({ kind: z.literal('orderByItem'), expr: ExpressionSchema, direction: z.union([z.literal('ASC'), z.literal('DESC')]), + nullsFirst: z.boolean().optional(), + withFill: z.boolean().optional(), collate: z.string().optional(), fillFrom: ExpressionSchema.optional(), fillTo: ExpressionSchema.optional(), @@ -1174,6 +1202,12 @@ export type JoinExpr = { kind: 'joinExpr'; /** The type of join. */ joinType: JoinType; + /** Join strictness qualifier: `ANY`, `ALL`, `ASOF`, `SEMI`, or `ANTI`. */ + strictness?: JoinStrictness; + /** `true` when the GLOBAL locality keyword was used (distributed JOIN/IN). */ + global?: boolean; + /** `true` when the join was written with comma syntax (`FROM a, b`), an implicit cross join. */ + comma?: boolean; /** The left side of the join. */ left: FromExpr; /** The right side of the join. */ @@ -1286,6 +1320,8 @@ export type IntersectStatement = { kind: 'intersect'; /** The set operation: `'INTERSECT'` or `'EXCEPT'`. */ op: 'INTERSECT' | 'EXCEPT'; + /** `true` for `INTERSECT DISTINCT` / `EXCEPT DISTINCT`; absent for the default ALL semantics. */ + distinct?: boolean; /** The left query. */ left: QueryStatement; /** The right query. */ @@ -3038,6 +3074,7 @@ export const IntersectStatementSchema: z.ZodType = z.lazy(() z.object({ kind: z.literal('intersect'), op: z.union([z.literal('INTERSECT'), z.literal('EXCEPT')]), + distinct: z.boolean().optional(), left: QueryStatementSchema, right: QueryStatementSchema, parenthesized: z.boolean().optional(), @@ -3106,6 +3143,15 @@ export const JoinTypeSchema = z.union([ z.literal('PASTE'), ]); +/** Zod schema for {@link JoinStrictness}. */ +export const JoinStrictnessSchema = z.union([ + z.literal('ANY'), + z.literal('ALL'), + z.literal('ASOF'), + z.literal('SEMI'), + z.literal('ANTI'), +]); + /** Zod schema for {@link ArrayJoinType}. */ export const ArrayJoinTypeSchema = z.union([z.literal('ARRAY'), z.literal('LEFT ARRAY')]); @@ -3139,6 +3185,9 @@ export const JoinExprSchema: z.ZodType = z.lazy(() => z.object({ kind: z.literal('joinExpr'), joinType: JoinTypeSchema, + strictness: JoinStrictnessSchema.optional(), + global: z.boolean().optional(), + comma: z.boolean().optional(), left: FromExprSchema, right: z.union([TableRefSchema, SubqueryFromSchema, TableFunctionRefSchema]), constraint: JoinConstraintSchema.optional(), diff --git a/src/explain-json.ts b/src/explain-json.ts new file mode 100644 index 000000000..6b10769ca --- /dev/null +++ b/src/explain-json.ts @@ -0,0 +1,1146 @@ +import { + BinaryExpr, + CTE, + ColumnTransformer, + Expression, + FromExpr, + Identifier, + InterpolateItem, + OrderByItem, + SampleClause, + SelectStatement, + SettingItem, + Statement, + StatementsSchema, + SubqueryFrom, + TableFunctionRef, + TableRef, + WindowFrameBound, + WindowSpec, +} from './ast'; +import { + OP_TO_FUNCTION, + escapeStringValue, + flattenFromExpr, + normalizeFloat, + normalizeTypeName, + normalizeUInt, +} from './explain'; + +/** + * Version of the `EXPLAIN AST json = 1` output contract this module targets. + * Mirrors `AST_JSON_FORMAT_VERSION` in the upstream ClickHouse PR + * (https://github.com/peter-leonov-ch/ClickHouse/pull/1); bumped there on any + * backwards-incompatible shape change. + */ +export const AST_JSON_FORMAT_VERSION = 1; + +/** A node in the ClickHouse `EXPLAIN AST json = 1` output tree. */ +export type ExplainJSONNode = { type: string; [key: string]: unknown }; + +/** The versioned document wrapper around a single statement's AST. */ +export type ExplainJSONDocument = { version: number; ast: ExplainJSONNode }; + +// ── String/value helpers ───────────────────────────────────────────────────── + +// The grammar stores string literals in pre-escaped form: \b \f \n \r \t \0 \\ +// are kept as their two-char sequences while \' is stored as a plain quote. +// Convert that stored form back to the raw string value for JSON output. +function unescapeStored(value: string): string { + return value.replace(/\\([\\nrtbf0])/g, (_, c: string) => { + switch (c) { + case 'n': + return '\n'; + case 'r': + return '\r'; + case 't': + return '\t'; + case 'b': + return '\b'; + case 'f': + return '\f'; + case '0': + return '\0'; + default: + return '\\'; + } + }); +} + +// normalizeTypeName() escapes quotes/backslashes for the text explain label; +// undo that so the JSON literal carries the raw type string. +function unescapeLabel(value: string): string { + return value + .replace(/\\\\/g, '\u0000') + .replace(/\\'/g, "'") + .replace(new RegExp('\u0000', 'g'), '\\'); +} + +// Canonical string rendering for an Identifier (plain name or query-param). +function id(x: Identifier): string { + return typeof x === 'string' ? x : `{${x.name}:${x.type}}`; +} + +// ── Literal rendering ──────────────────────────────────────────────────────── + +type Scalar = string | number | boolean | null; + +// JSON value for a scalar literal, mirroring ClickHouse's fieldToJSON. +function literalScalar(expr: Expression & { kind: 'literal' }): { + value_type: string; + value: Scalar; +} { + switch (expr.type) { + case 'String': + return { value_type: 'String', value: unescapeStored(expr.value) }; + case 'NULL': + return { value_type: 'Null', value: null }; + case 'Bool': + return { value_type: 'Bool', value: expr.value === 'true' || expr.value === '1' }; + case 'Float64': { + const normalized = normalizeFloat(expr.value); + const num = Number(normalized); + // inf/nan cannot be represented in JSON; fall back to their string form. + return { value_type: 'Float64', value: Number.isFinite(num) ? num : normalized }; + } + case 'Int64': + // ClickHouse represents -0 as UInt64 0. + if (expr.value === '0') return { value_type: 'UInt64', value: 0 }; + return { value_type: 'Int64', value: Number(expr.value) }; + default: + return { value_type: 'UInt64', value: Number(normalizeUInt(expr.value)) }; + } +} + +// Inline representation of an expression used inside Array/Tuple literal values, +// rendered the way ClickHouse's FieldVisitorToString prints fields. +// Returns null when the expression cannot be inlined (the containing array/tuple +// then uses the Function form instead of the Literal form). +function inlineFieldString(expr: Expression): string | null { + if ((expr as Record).parenthesized) return null; + switch (expr.kind) { + case 'literal': + if (expr.type === 'String') return `'${escapeStringValue(expr.value)}'`; + if (expr.type === 'NULL') return 'NULL'; + if (expr.type === 'Bool') return expr.value; + if (expr.type === 'Float64') return normalizeFloat(expr.value); + if (expr.type === 'Int64') return expr.value === '0' ? '0' : expr.value; + return normalizeUInt(expr.value); + case 'arrayLiteral': { + // Empty arrays use the Function array form, not the literal form. + if (expr.elements.length === 0) return null; + const inlines = expr.elements.map(inlineFieldString); + if (inlines.some((i) => i === null)) return null; + return `[${inlines.join(', ')}]`; + } + default: + return null; + } +} + +// Inline a tuple literal recursively: only literals and nested tuples-of-literals. +function inlineTupleFieldString(expr: Expression): string | null { + if ((expr as Record).parenthesized) return null; + if (expr.kind === 'literal') return inlineFieldString(expr); + if (expr.kind === 'tupleLiteral') { + const inlines = expr.elements.map(inlineTupleFieldString); + if (inlines.some((i) => i === null)) return null; + return `(${inlines.join(', ')})`; + } + return null; +} + +// Like inlineFieldString but also handles tuple elements recursively — used for +// IN values where tuples can appear inside the outer Tuple literal. Arrays are +// not inlined in this context (ClickHouse renders them as Function tuple). +function inlineInFieldString(expr: Expression): string | null { + if (expr.kind === 'arrayLiteral') return null; + const inline = inlineFieldString(expr); + if (inline !== null) return inline; + if (expr.kind === 'tupleLiteral') { + const inlines = expr.elements.map(inlineInFieldString); + if (inlines.some((i) => i === null)) return null; + return `(${inlines.join(', ')})`; + } + return null; +} + +// ── Settings ───────────────────────────────────────────────────────────────── + +// Convert a settings value expression to the JSON value ClickHouse emits in +// the Set node's `changes` map. +function settingValueJSON(value: Expression): Scalar { + if (value.kind === 'literal') return literalScalar(value).value; + // Bare identifiers used as setting values (e.g. join_algorithm = hash) + if (value.kind === 'columnRef') return value.parts.map(id).join('.'); + if ( + value.kind === 'functionCall' && + value.name === 'negate' && + value.args.length === 1 && + value.args[0].kind === 'literal' + ) { + const inner = literalScalar(value.args[0]); + if (typeof inner.value === 'number') return -inner.value; + } + const inline = inlineFieldString(value) ?? inlineTupleFieldString(value); + return inline ?? ''; +} + +function setNodeJSON(settings: SettingItem[]): ExplainJSONNode { + const changes: Record = {}; + for (const item of settings) { + changes[item.name] = settingValueJSON(item.value); + } + const node: ExplainJSONNode = { type: 'Set' }; + if (settings.length > 0) node.changes = changes; + return node; +} + +// ── Column transformers ────────────────────────────────────────────────────── + +function columnTransformerJSON(t: ColumnTransformer): ExplainJSONNode { + if (t.kind === 'apply') { + const node: ExplainJSONNode = { type: 'ColumnsApplyTransformer' }; + if (t.func.kind === 'columnRef') { + node.func_name = t.func.parts.map(id).join('.'); + } else if (t.func.kind === 'functionCall') { + node.func_name = t.func.name; + if (t.func.params) node.parameters = t.func.params.map(exprJSON); + } else if (t.func.kind === 'lambdaExpr') { + node.lambda = exprJSON(t.func); + } + return node; + } + if (t.kind === 'except') { + const node: ExplainJSONNode = { type: 'ColumnsExceptTransformer' }; + if (t.strict) node.is_strict = true; + // String-pattern EXCEPT has no children; column-list EXCEPT has Identifier children. + if (!t.pattern) { + node.children = t.columns.map((c) => ({ type: 'Identifier', name: c })); + } + return node; + } + // replace + const node: ExplainJSONNode = { type: 'ColumnsReplaceTransformer' }; + if (t.strict) node.is_strict = true; + node.children = t.items.map((item) => ({ + type: 'ColumnsReplaceTransformer::Replacement', + name: item.alias, + children: [exprJSON(item.expr)], + })); + return node; +} + +function transformerListJSON(transformers: ColumnTransformer[]): ExplainJSONNode { + return { type: 'ColumnsTransformerList', children: transformers.map(columnTransformerJSON) }; +} + +// ── Window definitions ─────────────────────────────────────────────────────── + +function frameBoundType(bound: WindowFrameBound): string { + if (bound.kind === 'unbounded') return 'Unbounded'; + if (bound.kind === 'currentRow') return 'Current'; + return 'Offset'; +} + +function frameBoundPreceding(bound: WindowFrameBound, isEnd: boolean): boolean { + if (bound.kind === 'unbounded') return !isEnd; + if (bound.kind === 'currentRow') return false; + return bound.kind === 'preceding'; +} + +function windowDefinitionJSON(spec: WindowSpec): ExplainJSONNode { + const node: ExplainJSONNode = { type: 'WindowDefinition' }; + if (spec.baseWindow !== undefined) node.parent_window_name = spec.baseWindow; + if (spec.partitionBy && spec.partitionBy.length > 0) { + node.partition_by = spec.partitionBy.map(exprJSON); + } + if (spec.orderBy && spec.orderBy.length > 0) { + node.order_by = spec.orderBy.map(orderByJSON); + } + if (spec.frame) { + const { start, end } = spec.frame; + node.frame_type = spec.frame.frameType.toUpperCase(); + node.frame_begin_type = frameBoundType(start); + if (start.kind === 'preceding' || start.kind === 'following') { + node.frame_begin_offset = exprJSON(start.expr); + } + node.frame_begin_preceding = frameBoundPreceding(start, false); + // Without BETWEEN syntax the end bound defaults to CURRENT ROW. + node.frame_end_type = end ? frameBoundType(end) : 'Current'; + if (end && (end.kind === 'preceding' || end.kind === 'following')) { + node.frame_end_offset = exprJSON(end.expr); + } + node.frame_end_preceding = end ? frameBoundPreceding(end, true) : false; + } + return node; +} + +// ── ANY/ALL rewriting (mirrors explain.ts) ─────────────────────────────────── + +// Build a synthetic subquery node for ANY/ALL rewriting: +// SELECT aggFunc(*) FROM (subquery) +function syntheticAggSubqueryJSON(aggFunc: string, subqueryStmt: Statement): ExplainJSONNode { + const aggNode = (): ExplainJSONNode => ({ + type: 'Function', + name: aggFunc, + arguments: [{ type: 'Asterisk' }], + }); + const tables = (): ExplainJSONNode => ({ + type: 'TablesInSelectQuery', + children: [ + { + type: 'TablesInSelectQueryElement', + table_expression: { + type: 'TableExpression', + subquery: { type: 'Subquery', query: stmtJSON(subqueryStmt) }, + }, + }, + ], + }); + const selectQuery: ExplainJSONNode = { + type: 'SelectQuery', + select: [aggNode()], + tables: tables(), + }; + return { + type: 'Subquery', + query: { type: 'SelectWithUnionQuery', selects: [selectQuery] }, + }; +} + +function operatorFunctionJSON(name: string, args: ExplainJSONNode[]): ExplainJSONNode { + return { type: 'Function', name, is_operator: true, arguments: args }; +} + +// Rewrite x op ANY/ALL (subquery) to ClickHouse canonical form. +function rewriteAnyAllJSON(expr: BinaryExpr): ExplainJSONNode | null { + if (expr.right.kind !== 'functionCall') return null; + const fname = expr.right.name.toLowerCase(); + if (fname !== 'any' && fname !== 'all') return null; + if (expr.right.args.length !== 1 || expr.right.args[0].kind !== 'subqueryExpr') return null; + + const subqueryStmt = expr.right.args[0].query; + const leftNode = exprJSON(expr.left); + const op = expr.op; + const isAny = fname === 'any'; + + if ((op === '==' || op === '=') && isAny) { + return operatorFunctionJSON('in', [ + leftNode, + { type: 'Subquery', query: stmtJSON(subqueryStmt) }, + ]); + } + if ((op === '!=' || op === '<>') && !isAny) { + return operatorFunctionJSON('notIn', [ + leftNode, + { type: 'Subquery', query: stmtJSON(subqueryStmt) }, + ]); + } + if ((op === '==' || op === '=') && !isAny) { + return operatorFunctionJSON('in', [ + leftNode, + syntheticAggSubqueryJSON('singleValueOrNull', subqueryStmt), + ]); + } + if ((op === '!=' || op === '<>') && isAny) { + return operatorFunctionJSON('notIn', [ + leftNode, + syntheticAggSubqueryJSON('singleValueOrNull', subqueryStmt), + ]); + } + + const compFunc = OP_TO_FUNCTION[op]; + if (!compFunc) return null; + let aggFunc: string; + if (isAny) { + aggFunc = op === '<' || op === '<=' ? 'max' : 'min'; + } else { + aggFunc = op === '<' || op === '<=' ? 'min' : 'max'; + } + return operatorFunctionJSON(compFunc, [ + leftNode, + syntheticAggSubqueryJSON(aggFunc, subqueryStmt), + ]); +} + +// ── Expressions ────────────────────────────────────────────────────────────── + +function identifierJSON(parts: Identifier[]): ExplainJSONNode { + const formattedParts: string[] = []; + for (const rawPart of parts) { + const part = id(rawPart); + if (part.startsWith('^')) { + formattedParts.push(`^\`${part.slice(1)}\``); + } else if (part.endsWith('[]')) { + formattedParts.push(part.slice(0, -2)); + formattedParts.push(':`Array(JSON)`'); + } else { + formattedParts.push(part); + } + } + const node: ExplainJSONNode = { type: 'Identifier', name: formattedParts.join('.') }; + if (formattedParts.length > 1) node.name_parts = formattedParts; + return node; +} + +function withAlias(node: ExplainJSONNode, alias: string): ExplainJSONNode { + const { type, ...rest } = node; + return { type, alias, ...rest }; +} + +function exprJSON(expr: Expression): ExplainJSONNode { + switch (expr.kind) { + case 'literal': + return { type: 'Literal', ...literalScalar(expr) }; + case 'columnRef': + return identifierJSON(expr.parts); + case 'asterisk': { + const node: ExplainJSONNode = { type: 'Asterisk' }; + if (expr.transformers && expr.transformers.length > 0) { + node.transformers = transformerListJSON(expr.transformers); + } + return node; + } + case 'qualifiedAsterisk': { + const node: ExplainJSONNode = { + type: 'QualifiedAsterisk', + qualifier: identifierJSON(expr.parts), + }; + if (expr.transformers && expr.transformers.length > 0) { + node.transformers = transformerListJSON(expr.transformers); + } + return node; + } + case 'tupleExpansion': { + const node: ExplainJSONNode = { type: 'Asterisk' }; + if (expr.transformers && expr.transformers.length > 0) { + node.transformers = transformerListJSON(expr.transformers); + } + return node; + } + case 'queryParam': + // Upstream does not enrich ASTQueryParameter yet; only the type id is emitted. + return { type: 'QueryParameter' }; + case 'alias': { + // Outer alias overrides any inner aliases — only show the outermost alias. + let innerExpr = expr.expr; + while (innerExpr.kind === 'alias') { + innerExpr = innerExpr.expr; + } + return withAlias(exprJSON(innerExpr), expr.alias); + } + case 'arrayLiteral': { + if (expr.elements.length === 0) { + return { type: 'Function', name: 'array', arguments: [] }; + } + const inlines = expr.elements.map(inlineFieldString); + if (inlines.some((i) => i === null)) { + return { type: 'Function', name: 'array', arguments: expr.elements.map(exprJSON) }; + } + return { type: 'Literal', value_type: 'Array', value: `[${inlines.join(', ')}]` }; + } + case 'tupleLiteral': { + const inline = inlineTupleFieldString(expr); + if (inline !== null) return { type: 'Literal', value_type: 'Tuple', value: inline }; + return operatorFunctionJSON('tuple', expr.elements.map(exprJSON)); + } + case 'functionCall': + return functionCallJSON(expr); + case 'castExpr': { + function isPureLiteral(e: Expression): boolean { + if (e.kind === 'literal') return e.type !== 'NULL' && e.type !== 'Bool'; + if (e.kind === 'arrayLiteral') return e.elements.every(isPureLiteral); + if (e.kind === 'tupleLiteral') return e.elements.every(isPureLiteral); + return false; + } + function castElemStr(e: Expression): string { + if (e.kind === 'literal') { + if (e.type === 'String') return `'${escapeStringValue(e.value)}'`; + return e.value; + } + if (e.kind === 'arrayLiteral') { + if (e.source !== undefined) return e.source; + return `[${e.elements.map(castElemStr).join(', ')}]`; + } + if (e.kind === 'tupleLiteral') { + if (e.source !== undefined) return e.source; + return `(${e.elements.map(castElemStr).join(', ')})`; + } + return ''; + } + // For :: operator casts, pure literal operands collapse into a string literal. + function castOperandString(e: Expression): string | null { + if (!isPureLiteral(e)) return null; + if (e.kind === 'literal') { + if (e.type === 'String') return unescapeStored(e.value); + return e.value; + } + if (e.kind === 'arrayLiteral') { + return e.source ?? `[${e.elements.map(castElemStr).join(', ')}]`; + } + if (e.kind === 'tupleLiteral') { + return e.source ?? `(${e.elements.map(castElemStr).join(', ')})`; + } + return null; + } + let innerNode: ExplainJSONNode; + if (expr.operator) { + const str = castOperandString(expr.expr); + innerNode = + str !== null + ? { type: 'Literal', value_type: 'String', value: str } + : exprJSON(expr.expr); + } else { + innerNode = exprJSON(expr.expr); + } + const node: ExplainJSONNode = { type: 'Function', name: 'CAST' }; + if (expr.operator) node.is_operator = true; + node.arguments = [ + innerNode, + { + type: 'Literal', + value_type: 'String', + value: unescapeLabel(normalizeTypeName(expr.type)), + }, + ]; + return node; + } + case 'lambdaExpr': { + // If the lambda body has an alias, ClickHouse moves the alias to the lambda node. + let body = expr.body; + let lambdaAlias = ''; + while (body.kind === 'alias') { + lambdaAlias = body.alias; + body = body.expr; + } + const node: ExplainJSONNode = { type: 'Function' }; + if (lambdaAlias) node.alias = lambdaAlias; + node.name = 'lambda'; + node.is_operator = true; + node.is_lambda_function = true; + node.kind = 'LAMBDA_FUNCTION'; + node.arguments = [ + operatorFunctionJSON( + 'tuple', + expr.params.map((p) => ({ type: 'Identifier', name: p }) as ExplainJSONNode), + ), + exprJSON(body), + ]; + return node; + } + case 'unaryExpr': + return operatorFunctionJSON('not', [exprJSON(expr.expr)]); + case 'binaryExpr': { + const anyAllResult = rewriteAnyAllJSON(expr); + if (anyAllResult) return anyAllResult; + const funcName = OP_TO_FUNCTION[expr.op] ?? expr.op; + return operatorFunctionJSON(funcName, [exprJSON(expr.left), exprJSON(expr.right)]); + } + case 'naryExpr': { + const funcName = OP_TO_FUNCTION[expr.op] ?? expr.op; + return operatorFunctionJSON(funcName, expr.operands.map(exprJSON)); + } + case 'subqueryExpr': + return { type: 'Subquery', query: stmtJSON(expr.query) }; + case 'inExpr': { + const funcName = expr.global + ? expr.negated + ? 'globalNotIn' + : 'globalIn' + : expr.negated + ? 'notIn' + : 'in'; + let valuesNode: ExplainJSONNode; + if (Array.isArray(expr.values)) { + if (expr.values.length === 1) { + const single = expr.values[0]; + if (single.kind === 'tupleLiteral') { + const inlineResult = inlineInFieldString(single); + if (inlineResult !== null) { + valuesNode = { + type: 'Function', + name: 'tuple', + is_operator: true, + arguments: [{ type: 'Literal', value_type: 'Tuple', value: inlineResult }], + }; + } else { + valuesNode = exprJSON(single); + } + } else { + valuesNode = exprJSON(single); + } + } else { + const inlines = expr.values.map(inlineInFieldString); + if (inlines.some((i) => i === null)) { + valuesNode = operatorFunctionJSON('tuple', expr.values.map(exprJSON)); + } else { + valuesNode = { + type: 'Literal', + value_type: 'Tuple', + value: `(${inlines.join(', ')})`, + }; + } + } + } else { + valuesNode = { type: 'Subquery', query: stmtJSON(expr.values.query) }; + } + return operatorFunctionJSON(funcName, [exprJSON(expr.expr), valuesNode]); + } + case 'columnsExpr': { + const isRegex = + expr.args.length === 1 && expr.args[0].kind === 'literal' && expr.args[0].type === 'String'; + const node: ExplainJSONNode = { + type: expr.qualifier + ? isRegex + ? 'QualifiedColumnsRegexpMatcher' + : 'QualifiedColumnsListMatcher' + : isRegex + ? 'ColumnsRegexpMatcher' + : 'ColumnsListMatcher', + }; + if (isRegex && expr.args[0].kind === 'literal') { + node.pattern = unescapeStored(expr.args[0].value); + } + if (expr.qualifier) node.qualifier = { type: 'Identifier', name: expr.qualifier }; + if (!isRegex) node.columns = expr.args.map(exprJSON); + if (expr.transformers && expr.transformers.length > 0) { + node.transformers = transformerListJSON(expr.transformers); + } + return node; + } + case 'jsonSubcolumn': { + // JSON subcolumn .:Type access — rendered as an identifier with type annotation. + const typeStr = `\`${expr.type}\``; + const inner = exprJSON(expr.expr); + const pathSuffix = expr.path && expr.path.length > 0 ? '.' + expr.path.join('.') : ''; + const name = `${String(inner.name ?? '')}.:${typeStr}${pathSuffix}`; + return { ...inner, name }; + } + } +} + +function functionCallJSON(expr: Expression & { kind: 'functionCall' }): ExplainJSONNode { + // Normalize known function aliases to their canonical names as ClickHouse does. + const FUNC_ALIASES: Record = { + cast: 'CAST', + datediff: 'dateDiff', + ltrim: 'trimLeft', + rtrim: 'trimRight', + trim: 'trimBoth', + exists: 'exists', + grouping: 'grouping', + substring: 'substring', + extract: 'extract', + position: 'position', + }; + const funcName = FUNC_ALIASES[expr.name.toLowerCase()] ?? expr.name; + + // not(tuple(a,b,c)) — NOT applied directly to a tuple literal expands the tuple. + if (funcName === 'not' && expr.args.length === 1 && expr.args[0].kind === 'tupleLiteral') { + const tupleArg = expr.args[0]; + const node = operatorFunctionJSON('not', [ + operatorFunctionJSON('tuple', tupleArg.elements.map(exprJSON)), + ]); + return node; + } + // COLUMNS('regex') renders as ColumnsRegexpMatcher; COLUMNS(id, ...) as ColumnsListMatcher. + if (funcName.toUpperCase() === 'COLUMNS') { + const first = expr.args[0]; + if (expr.args.length === 1 && first.kind === 'literal' && first.type === 'String') { + return { type: 'ColumnsRegexpMatcher', pattern: unescapeStored(first.value) }; + } + return { type: 'ColumnsListMatcher', columns: expr.args.map(exprJSON) }; + } + + const node: ExplainJSONNode = { type: 'Function', name: funcName }; + if (expr.isOperator) node.is_operator = true; + if (expr.window || expr.windowName !== undefined) { + node.is_window_function = true; + node.kind = 'WINDOW_FUNCTION'; + } + if (expr.nullsAction) node.nulls_action = expr.nullsAction; + + // view(subquery) renders the subquery directly inside the arguments. + if ( + funcName.toLowerCase() === 'view' && + expr.args.length === 1 && + expr.args[0].kind === 'subqueryExpr' + ) { + node.arguments = [stmtJSON(expr.args[0].query)]; + return node; + } + + const args = expr.args.map(exprJSON); + if (expr.funcSettings) args.push(setNodeJSON(expr.funcSettings)); + node.arguments = args; + if (expr.params) node.parameters = expr.params.map(exprJSON); + if (expr.window) { + node.window_definition = windowDefinitionJSON(expr.window); + } else if (expr.windowName !== undefined) { + node.window_name = expr.windowName; + } + return node; +} + +// ── ORDER BY / INTERPOLATE ─────────────────────────────────────────────────── + +function orderByJSON(item: OrderByItem): ExplainJSONNode { + const node: ExplainJSONNode = { + type: 'OrderByElement', + expression: exprJSON(item.expr), + direction: item.direction, + }; + if (item.nullsFirst !== undefined) node.nulls_first = item.nullsFirst; + if (item.collate !== undefined) { + node.collation = { type: 'Literal', value_type: 'String', value: unescapeStored(item.collate) }; + } + if ( + item.withFill || + item.fillFrom !== undefined || + item.fillTo !== undefined || + item.fillStep !== undefined || + item.fillStaleness !== undefined + ) { + node.with_fill = true; + } + if (item.fillFrom !== undefined) node.fill_from = exprJSON(item.fillFrom); + if (item.fillTo !== undefined) node.fill_to = exprJSON(item.fillTo); + if (item.fillStep !== undefined) node.fill_step = exprJSON(item.fillStep); + if (item.fillStaleness !== undefined) node.fill_staleness = exprJSON(item.fillStaleness); + return node; +} + +function interpolateJSON(items: InterpolateItem[]): ExplainJSONNode[] { + return items.map((it) => ({ + type: 'InterpolateElement', + column: it.col, + // When no explicit expression, ClickHouse uses the column identifier itself. + expr: it.expr ? exprJSON(it.expr) : { type: 'Identifier', name: it.col }, + })); +} + +// ── FROM / JOIN ────────────────────────────────────────────────────────────── + +// Convert a sample ratio/offset value to ClickHouse's exact-rational form. +function sampleRatioJSON( + sample: SampleClause['ratio'] | NonNullable, +): ExplainJSONNode { + let numerator: string; + let denominator: string; + if ('den' in sample && sample.den !== undefined) { + numerator = String(Math.round(parseFloat(sample.num))); + denominator = String(Math.round(parseFloat(sample.den))); + } else { + const numText = sample.num; + const lower = numText.toLowerCase(); + if (/^[0-9]+$/.test(numText)) { + numerator = numText; + denominator = '1'; + } else if (lower.includes('e-')) { + const [mantissaStr, expStr] = lower.split('e-'); + numerator = String(Math.round(parseFloat(mantissaStr))); + denominator = String(Math.round(Math.pow(10, parseInt(expStr, 10)))); + } else if (lower.includes('.')) { + const dotIdx = lower.indexOf('.'); + const afterDot = lower.substring(dotIdx + 1).replace(/e.*$/, ''); + const digits = lower.replace('.', '').replace(/e.*$/, ''); + numerator = String(parseInt(digits, 10)); + denominator = String(Math.round(Math.pow(10, afterDot.length))); + } else { + numerator = String(Math.round(parseFloat(numText))); + denominator = '1'; + } + } + return { type: 'SampleRatio', numerator, denominator }; +} + +function addSample(node: ExplainJSONNode, sample: SampleClause | undefined): void { + if (!sample) return; + node.sample_size = sampleRatioJSON(sample.ratio); + if (sample.offset) node.sample_offset = sampleRatioJSON(sample.offset); +} + +function tableExpressionJSON(ref: TableRef): ExplainJSONNode { + const tableId: ExplainJSONNode = { type: 'TableIdentifier' }; + if (ref.alias !== undefined) tableId.alias = ref.alias; + tableId.name = id(ref.table); + if (ref.database !== undefined) tableId.database = id(ref.database); + const node: ExplainJSONNode = { type: 'TableExpression', database_and_table_name: tableId }; + if (ref.final) node.final = true; + addSample(node, ref.sample); + return node; +} + +function subqueryTableExpressionJSON(from: SubqueryFrom): ExplainJSONNode { + const subquery: ExplainJSONNode = { type: 'Subquery' }; + if (from.alias !== undefined) subquery.alias = from.alias; + subquery.query = stmtJSON(from.query); + const node: ExplainJSONNode = { type: 'TableExpression', subquery }; + if (from.final) node.final = true; + addSample(node, from.sample); + if (from.columnAliases && from.columnAliases.length > 0) { + node.column_aliases = { + type: 'ExpressionList', + children: from.columnAliases.map((c) => ({ type: 'Identifier', name: c })), + }; + } + return node; +} + +function tableFunctionExpressionJSON(from: TableFunctionRef): ExplainJSONNode { + const fn: ExplainJSONNode = { type: 'Function' }; + if (from.alias !== undefined) fn.alias = from.alias; + fn.name = from.name; + // view(subquery) renders the subquery directly inside the arguments. + if ( + from.name.toLowerCase() === 'view' && + from.args.length === 1 && + from.args[0].kind === 'subqueryExpr' + ) { + fn.arguments = [stmtJSON(from.args[0].query)]; + } else { + const args = from.args.map(exprJSON); + if (from.settings && from.settings.length > 0) args.push(setNodeJSON(from.settings)); + fn.arguments = args; + } + const node: ExplainJSONNode = { type: 'TableExpression', table_function: fn }; + if (from.final) node.final = true; + addSample(node, from.sample); + return node; +} + +function fromAtomJSON(from: TableRef | SubqueryFrom | TableFunctionRef): ExplainJSONNode { + if (from.kind === 'subqueryFrom') return subqueryTableExpressionJSON(from); + if (from.kind === 'tableFunctionRef') return tableFunctionExpressionJSON(from); + return tableExpressionJSON(from); +} + +function fromJSON(from: FromExpr): ExplainJSONNode { + const elements = flattenFromExpr(from); + return { + type: 'TablesInSelectQuery', + children: elements.map((elem): ExplainJSONNode => { + if (elem.tag === 'base') { + return { type: 'TablesInSelectQueryElement', table_expression: fromAtomJSON(elem.from) }; + } + if (elem.tag === 'join') { + const tableJoin: ExplainJSONNode = { type: 'TableJoin' }; + const join = elem.join; + tableJoin.kind = join.comma ? 'COMMA' : join.joinType; + if (join.strictness !== undefined) tableJoin.strictness = join.strictness; + if (join.global) tableJoin.locality = 'GLOBAL'; + if (elem.constraint) { + if (elem.constraint.kind === 'using') { + tableJoin.using = elem.constraint.columns.map((col): ExplainJSONNode => { + if (col === '*') return { type: 'Asterisk' }; + if (typeof col === 'object' && col.name && col.alias) { + return { type: 'Identifier', alias: col.alias, name: col.name }; + } + return { type: 'Identifier', name: col as string }; + }); + } else { + tableJoin.on = exprJSON(elem.constraint.expr); + } + } + return { + type: 'TablesInSelectQueryElement', + table_join: tableJoin, + table_expression: fromAtomJSON(elem.from), + }; + } + // arrayJoin + return { + type: 'TablesInSelectQueryElement', + array_join: { + type: 'ArrayJoin', + kind: elem.joinType === 'LEFT ARRAY' ? 'LEFT' : 'INNER', + expressions: elem.expressions.map(exprJSON), + }, + }; + }), + }; +} + +// ── CTEs ───────────────────────────────────────────────────────────────────── + +function cteJSON(cte: CTE): ExplainJSONNode { + if (cte.kind === 'cteExpr') { + // Anonymous WITH expression (e.g. `WITH 1 SELECT 1`) renders as the expression. + if (cte.name === undefined) return exprJSON(cte.expr); + return exprJSON({ kind: 'alias', expr: cte.expr, alias: cte.name }); + } + if (cte.kind === 'cteTuple') { + return operatorFunctionJSON('tuple', cte.elements.map(exprJSON)); + } + const node: ExplainJSONNode = { + type: 'WithElement', + name: cte.name, + subquery: { type: 'Subquery', query: stmtJSON(cte.query) }, + }; + if (cte.columnAliases && cte.columnAliases.length > 0) { + node.aliases = { + type: 'ExpressionList', + children: cte.columnAliases.map((a) => ({ type: 'Identifier', name: a })), + }; + } + return node; +} + +// ── SELECT ─────────────────────────────────────────────────────────────────── + +function selectQueryJSON(stmt: SelectStatement): ExplainJSONNode { + const node: ExplainJSONNode = { type: 'SelectQuery' }; + + // Scalar flags first, mirroring upstream emission order. + if (stmt.distinct) node.distinct = true; + if (stmt.groupBy && stmt.groupBy.kind === 'all') node.group_by_all = true; + if (stmt.withTotals) node.group_by_with_totals = true; + if (stmt.withRollup) node.group_by_with_rollup = true; + if (stmt.withCube) node.group_by_with_cube = true; + if (stmt.groupBy && stmt.groupBy.kind === 'groupingSets') node.group_by_with_grouping_sets = true; + if (stmt.recursive) node.recursive_with = true; + + if (stmt.with && stmt.with.length > 0) node.with = stmt.with.map(cteJSON); + node.select = stmt.select.map(exprJSON); + if (stmt.from) node.tables = fromJSON(stmt.from); + if (stmt.prewhere) node.prewhere = exprJSON(stmt.prewhere); + if (stmt.where) node.where = exprJSON(stmt.where); + + if (stmt.groupBy) { + if (stmt.groupBy.kind === 'groupingSets') { + node.group_by = stmt.groupBy.sets.map( + (set): ExplainJSONNode => ({ type: 'ExpressionList', children: set.map(exprJSON) }), + ); + } else if (stmt.groupBy.kind === 'expressions') { + // Unwrap ROLLUP/CUBE function calls — their args are the group-by items. + const flatGroupBy = stmt.groupBy.items.flatMap((item) => { + if ( + item.kind === 'functionCall' && + (item.name.toUpperCase() === 'ROLLUP' || item.name.toUpperCase() === 'CUBE') + ) { + return item.args; + } + return [item]; + }); + node.group_by = flatGroupBy.map(exprJSON); + } + } + + if (stmt.having) node.having = exprJSON(stmt.having); + if (stmt.windows && stmt.windows.length > 0) { + node.window = stmt.windows.map( + (w): ExplainJSONNode => ({ + type: 'WindowListElement', + name: w.name, + definition: windowDefinitionJSON(w.spec), + }), + ); + } + if (stmt.qualify) node.qualify = exprJSON(stmt.qualify); + + let interpolate: ExplainJSONNode[] | undefined; + if (stmt.orderBy && stmt.orderBy.length > 0) { + node.order_by = stmt.orderBy.map(orderByJSON); + const interpItem = stmt.orderBy.find((item) => item.interpolate !== undefined); + if (interpItem && interpItem.interpolate !== undefined) { + interpolate = interpolateJSON(interpItem.interpolate); + } + } + + if (stmt.limitBy) { + if (stmt.limitBy.offset) node.limit_by_offset = exprJSON(stmt.limitBy.offset); + node.limit_by_length = exprJSON(stmt.limitBy.count); + node.limit_by = stmt.limitBy.by.map(exprJSON); + } else if (stmt.distinct && stmt.distinct.kind === 'distinctOn' && stmt.distinct.on.length > 0) { + // ClickHouse models DISTINCT ON (cols) as LIMIT 1 BY cols. + node.limit_by_length = { type: 'Literal', value_type: 'UInt64', value: 1 }; + node.limit_by = stmt.distinct.on.map(exprJSON); + } + if (stmt.offset) node.limit_offset = exprJSON(stmt.offset); + if (stmt.limit) node.limit_length = exprJSON(stmt.limit.count); + if (stmt.settings && stmt.settings.length > 0) node.settings = setNodeJSON(stmt.settings); + if (interpolate) node.interpolate = interpolate; + + return node; +} + +// ── UNION / INTERSECT / EXCEPT ─────────────────────────────────────────────── + +function intersectOperatorString(stmt: { op: 'INTERSECT' | 'EXCEPT'; distinct?: boolean }): string { + return `${stmt.op} ${stmt.distinct ? 'DISTINCT' : 'ALL'}`; +} + +// Render a statement as a child of SelectIntersectExceptQuery, mirroring the +// SelectWithUnionQuery wrapping rules from explain.ts: +// - EXCEPT left child: always wrapped +// - EXCEPT right child: never wrapped +// - INTERSECT child that is compound (another intersect/except): wrapped +// - INTERSECT child that is a simple select: not wrapped +// - Union children: stmtJSON already wraps them +function intersectChildJSON(s: Statement, wrapInSWU: boolean): ExplainJSONNode { + if (s.kind === 'union') return stmtJSON(s); + let node: ExplainJSONNode; + if (s.kind === 'select') { + node = selectQueryJSON(s); + if (s.parenthesized) wrapInSWU = true; + } else if (s.kind === 'intersect') { + const leftParen = (s.left as { parenthesized?: boolean }).parenthesized === true; + const rightParen = (s.right as { parenthesized?: boolean }).parenthesized === true; + const lw = + s.op === 'EXCEPT' || + (s.op === 'INTERSECT' && s.left.kind === 'intersect') || + (s.left.kind === 'intersect' && leftParen); + const rw = + (s.op === 'INTERSECT' && s.right.kind === 'intersect') || + (s.right.kind === 'intersect' && rightParen); + node = { + type: 'SelectIntersectExceptQuery', + operator: intersectOperatorString(s), + children: [intersectChildJSON(s.left, lw), intersectChildJSON(s.right, rw)], + }; + if ((s as { parenthesized?: boolean }).parenthesized) wrapInSWU = true; + } else { + node = stmtJSON(s); + } + if (wrapInSWU) return { type: 'SelectWithUnionQuery', selects: [node] }; + return node; +} + +// Distribute the WITH CTEs of the leftmost SELECT to sibling SELECTs, the way +// ClickHouse's parser does for UNION/INTERSECT/EXCEPT chains. +function distributeWith(queries: Statement[]): Statement[] { + if (queries.length <= 1) return queries; + const firstWith = queries[0]?.kind === 'select' ? queries[0].with : undefined; + if (!firstWith || firstWith.length === 0) return queries; + return queries.map((q, i) => { + if (i === 0 || q.kind !== 'select' || (q.with && q.with.length > 0)) return q; + return { ...q, with: firstWith } as Statement; + }); +} + +function stmtJSON(stmt: Statement): ExplainJSONNode { + if (stmt.kind === 'select' || stmt.kind === 'union' || stmt.kind === 'intersect') { + return selectFamilyJSON(stmt); + } + throw new Error( + `formatExplainJSON: statement kind '${stmt.kind}' is not supported yet; ` + + 'only the SELECT family (select/union/intersect) is currently exported', + ); +} + +function selectFamilyJSON(stmt: Statement): ExplainJSONNode { + // INTERSECT/EXCEPT produces SelectIntersectExceptQuery as the single select. + if (stmt.kind === 'intersect') { + function findLeftmostWith(s: Statement): CTE[] | undefined { + if (s.kind === 'select') return s.with; + if (s.kind === 'intersect') return findLeftmostWith(s.left); + return undefined; + } + function distributeWithIntersect(s: Statement, withItems: CTE[]): Statement { + if (s.kind === 'select' && !s.with) return { ...s, with: withItems } as Statement; + if (s.kind === 'select') return s; + if (s.kind === 'intersect') { + return { + ...s, + left: distributeWithIntersect(s.left, withItems), + right: distributeWithIntersect(s.right, withItems), + } as Statement; + } + return s; + } + let distributed = stmt; + const leftWith = findLeftmostWith(stmt); + if (leftWith && leftWith.length > 0) { + distributed = { + ...stmt, + right: distributeWithIntersect(stmt.right, leftWith), + } as typeof stmt; + } + const leftWrap = + distributed.op === 'EXCEPT' || + (distributed.op === 'INTERSECT' && distributed.left.kind === 'intersect'); + const rightWrap = distributed.op === 'INTERSECT' && distributed.right.kind === 'intersect'; + return { + type: 'SelectWithUnionQuery', + selects: [ + { + type: 'SelectIntersectExceptQuery', + operator: intersectOperatorString(distributed), + children: [ + intersectChildJSON(distributed.left, leftWrap), + intersectChildJSON(distributed.right, rightWrap), + ], + }, + ], + }; + } + + // Flatten nested UNION ALL so all SELECT queries appear at the same level; + // UNION DISTINCT creates a nesting boundary unless the whole chain is DISTINCT. + function flattenUnion(s: Statement): Statement[] { + if (s.kind === 'union' && !s.unionMode) return distributeWith(s.queries).flatMap(flattenUnion); + return [s]; + } + function flattenUnionDeep(s: Statement): Statement[] { + if (s.kind === 'union') return s.queries.flatMap(flattenUnionDeep); + return [s]; + } + + let queries: Statement[]; + if (stmt.kind === 'union') { + const flattener = stmt.unionMode ? flattenUnionDeep : flattenUnion; + queries = stmt.queries.flatMap(flattener); + } else { + queries = [stmt]; + } + queries = distributeWith(queries); + + const node: ExplainJSONNode = { type: 'SelectWithUnionQuery' }; + if (stmt.kind === 'union' && stmt.unionMode === 'DISTINCT') node.union_mode = 'UNION_DISTINCT'; + node.selects = queries.map((q): ExplainJSONNode => { + if (q.kind === 'select') return selectQueryJSON(q); + // Intersect/except inside a union renders as SelectIntersectExceptQuery directly. + if (q.kind === 'intersect') { + return { + type: 'SelectIntersectExceptQuery', + operator: intersectOperatorString(q), + children: [ + intersectChildJSON(q.left, q.op === 'EXCEPT'), + intersectChildJSON(q.right, false), + ], + }; + } + return stmtJSON(q); + }); + return node; +} + +// ── Public API ─────────────────────────────────────────────────────────────── + +/** + * Converts a single parsed statement into the ClickHouse + * `EXPLAIN AST json = 1` versioned document: `{ version: 1, ast: ... }`. + * + * Only the SELECT statement family (SELECT / UNION / INTERSECT / EXCEPT) is + * currently supported; other statement kinds throw. + */ +export function explainJSON(statement: Statement): ExplainJSONDocument { + return { version: AST_JSON_FORMAT_VERSION, ast: stmtJSON(statement) }; +} + +/** + * Formats statements the way ClickHouse's `EXPLAIN AST json = 1` does: one + * pretty-printed JSON document per statement, separated by blank lines. + * + * The output mirrors the v1 JSON contract of the upstream ClickHouse PR + * (https://github.com/peter-leonov-ch/ClickHouse/pull/1, see its `AST.md`): + * `type` carries the ClickHouse AST class id, sub-nodes appear under + * snake_case named slots, operators are ordinary functions marked with + * `is_operator`, expression lists are inlined, and absent optional slots are + * omitted. + */ +export function formatExplainJSON(statements: Statement[]): string { + StatementsSchema.parse(statements); + return statements.map((s) => JSON.stringify(explainJSON(s), null, 2)).join('\n\n'); +} diff --git a/src/explain.ts b/src/explain.ts index afbb8a9d1..63ca05128 100644 --- a/src/explain.ts +++ b/src/explain.ts @@ -2,6 +2,7 @@ import { AlterStatement, AlterCommand, AlterPartitionExpr, + ArrayJoinType, AuthenticationData, BinaryExpr, CodecItem, @@ -25,6 +26,7 @@ import { ExplainStatement, Expression, FromExpr, + JoinExpr, InsertStatement, ParallelWithStatement, JoinConstraint, @@ -41,7 +43,7 @@ import { } from './ast'; import { isCreateTableStatement } from './guards'; -const OP_TO_FUNCTION: Record = { +export const OP_TO_FUNCTION: Record = { AND: 'and', OR: 'or', '>': 'greater', @@ -85,7 +87,7 @@ function render(node: ExplainNode, depth = 0): string { return lines.join('\n'); } -function normalizeTypeName(type: string): string { +export function normalizeTypeName(type: string): string { // Normalize type name for ClickHouse EXPLAIN output: // - Collapse whitespace to single space // - Strip spaces adjacent to ( and ) outside quoted strings @@ -196,7 +198,7 @@ function quoteJsonInner(inner: string): string { return processed.join(', '); } -function normalizeFloat(value: string): string { +export function normalizeFloat(value: string): string { // Handle special ClickHouse float literals that parseFloat doesn't understand if (value === 'inf' || value === '-inf') return value; if (value === 'nan' || value === '-nan') return 'nan'; @@ -207,7 +209,7 @@ function normalizeFloat(value: string): string { return f.toString().replace('e+', 'e'); } -function normalizeUInt(value: string): string { +export function normalizeUInt(value: string): string { if (value.startsWith('0x') || value.startsWith('0X')) { // Use BigInt to avoid precision loss for large 64-bit hex values return BigInt(value).toString(); @@ -239,7 +241,7 @@ function transformerListNode(transformers: ColumnTransformer[]): ExplainNode { return n('ColumnsTransformerList', transformers.map(columnTransformerNode)); } -function escapeStringValue(value: string): string { +export function escapeStringValue(value: string): string { // The grammar stores strings in pre-escaped form: // - \b, \f, \n, \r, \t, \0, \\ are stored as their two-char sequences (backslash + letter) // and should be output as-is (no additional escaping). @@ -837,12 +839,17 @@ function joinConstraintNode(constraint: JoinConstraint): ExplainNode { ]); } -type JoinElement = +export type JoinElement = | { tag: 'base'; from: TableRef | SubqueryFrom | TableFunctionRef } - | { tag: 'join'; from: TableRef | SubqueryFrom | TableFunctionRef; constraint?: JoinConstraint } - | { tag: 'arrayJoin'; expressions: Expression[] }; + | { + tag: 'join'; + from: TableRef | SubqueryFrom | TableFunctionRef; + constraint?: JoinConstraint; + join: JoinExpr; + } + | { tag: 'arrayJoin'; joinType: ArrayJoinType; expressions: Expression[] }; -function flattenFromExpr(from: FromExpr): JoinElement[] { +export function flattenFromExpr(from: FromExpr): JoinElement[] { if ( from.kind === 'tableRef' || from.kind === 'subqueryFrom' || @@ -853,11 +860,14 @@ function flattenFromExpr(from: FromExpr): JoinElement[] { if (from.kind === 'joinExpr') { return [ ...flattenFromExpr(from.left), - { tag: 'join', from: from.right, constraint: from.constraint }, + { tag: 'join', from: from.right, constraint: from.constraint, join: from }, ]; } // arrayJoin - return [...flattenFromExpr(from.left), { tag: 'arrayJoin', expressions: from.expressions }]; + return [ + ...flattenFromExpr(from.left), + { tag: 'arrayJoin', joinType: from.joinType, expressions: from.expressions }, + ]; } // ClickHouse renders CTEs distributed to sibling UNION branches with their diff --git a/src/format.ts b/src/format.ts index 0dccdc302..30268cbcb 100644 --- a/src/format.ts +++ b/src/format.ts @@ -2242,7 +2242,7 @@ function formatIntersectStatement(stmt: IntersectStatement, indent: string): str } return str; }; - let result = `${wrapLeft(stmt.left, leftStr)}\n${stmt.op}\n${wrapRight(stmt.right, rightStr)}`; + let result = `${wrapLeft(stmt.left, leftStr)}\n${stmt.op}${stmt.distinct ? ' DISTINCT' : ''}\n${wrapRight(stmt.right, rightStr)}`; result += formatTrailingClauses(stmt, indent); return result; } @@ -2751,8 +2751,13 @@ function formatFunctionCall(expr: FunctionCall, indent: string): string { } else { call = `${funcName}(${formatArgList(expr.args, indent)}${settingsStr})`; } + if (expr.nullsAction) { + call += ` ${expr.nullsAction}`; + } if (expr.window) { call += ` OVER (${formatWindowSpec(expr.window, indent)})`; + } else if (expr.windowName !== undefined) { + call += ` OVER ${quoteIdent(expr.windowName)}`; } return call; } @@ -2980,7 +2985,11 @@ function formatFromExpr(from: FromExpr, outerIndent: string): string[] { if (from.kind === 'joinExpr') { const leftLines = formatFromExpr(from.left, outerIndent); const rightStr = formatFromAtom(from.right, innerIndent); - const lines = [...leftLines, `${outerIndent}${from.joinType} JOIN ${rightStr}`]; + if (from.comma) { + return [...leftLines, `${outerIndent}, ${rightStr}`]; + } + const qualifiers = `${from.global ? 'GLOBAL ' : ''}${from.strictness ? `${from.strictness} ` : ''}`; + const lines = [...leftLines, `${outerIndent}${qualifiers}${from.joinType} JOIN ${rightStr}`]; if (from.constraint) lines.push(formatJoinConstraint(from.constraint, innerIndent)); return lines; } @@ -2992,8 +3001,10 @@ function formatFromExpr(from: FromExpr, outerIndent: string): string[] { function formatOrderByItemInline(item: OrderByItem, indent: string): string { let result = `${formatExpr(item.expr, indent)} ${item.direction}`; + if (item.nullsFirst !== undefined) result += item.nullsFirst ? ' NULLS FIRST' : ' NULLS LAST'; if (item.collate !== undefined) result += ` COLLATE '${escapeString(item.collate)}'`; if ( + item.withFill || item.fillFrom !== undefined || item.fillTo !== undefined || item.fillStep !== undefined || @@ -3015,8 +3026,10 @@ function formatOrderByItemInline(item: OrderByItem, indent: string): string { function formatOrderByItem(item: OrderByItem, indent: string): string { let result = `${indent}${formatExpr(item.expr, indent)} ${item.direction}`; + if (item.nullsFirst !== undefined) result += item.nullsFirst ? ' NULLS FIRST' : ' NULLS LAST'; if (item.collate !== undefined) result += ` COLLATE '${escapeString(item.collate)}'`; if ( + item.withFill || item.fillFrom !== undefined || item.fillTo !== undefined || item.fillStep !== undefined || diff --git a/src/grammar.pegjs b/src/grammar.pegjs index 236ef9a98..e0f5c02c0 100644 --- a/src/grammar.pegjs +++ b/src/grammar.pegjs @@ -3096,7 +3096,8 @@ UnionQuery // UNION DISTINCT: always create a new union node with mode result = loc({ kind: 'union', queries: [result, right], unionMode: 'DISTINCT' }); } else { - result = loc({ kind: 'intersect', op, left: result, right }); + result = loc({ kind: 'intersect', op: op === 'EXCEPT DISTINCT' ? 'EXCEPT' : op, left: result, right }); + if (op === 'EXCEPT DISTINCT') result.distinct = true; } } return result; @@ -3109,6 +3110,7 @@ IntersectQuery let result = head; for (const t of tail) { result = loc({ kind: 'intersect', op: 'INTERSECT', left: result, right: addLeading(t[3], [...flattenWs(t[0]), ...flattenWs(t[2])]) }); + if (t[1] === 'INTERSECT DISTINCT') result.distinct = true; } return result; } @@ -3116,11 +3118,11 @@ IntersectQuery // UnionExceptOp: UNION [ALL|DISTINCT] or EXCEPT [ALL|DISTINCT] UnionExceptOp = KW_UNION _ mode:UnionAllOrDistinct? { return mode === 'DISTINCT' ? 'UNION DISTINCT' : 'UNION'; } - / "EXCEPT"i ![a-zA-Z0-9_] ( _ UnionAllOrDistinct )? { return 'EXCEPT'; } + / "EXCEPT"i ![a-zA-Z0-9_] mode:( _ UnionAllOrDistinct )? { return mode !== null && mode[1] === 'DISTINCT' ? 'EXCEPT DISTINCT' : 'EXCEPT'; } // IntersectOp: INTERSECT [ALL|DISTINCT] IntersectOp - = "INTERSECT"i ![a-zA-Z0-9_] ( _ UnionAllOrDistinct )? { return 'INTERSECT'; } + = "INTERSECT"i ![a-zA-Z0-9_] mode:( _ UnionAllOrDistinct )? { return mode !== null && mode[1] === 'DISTINCT' ? 'INTERSECT DISTINCT' : 'INTERSECT'; } // UnionAllOrDistinct: supports UNION ALL and UNION DISTINCT UnionAllOrDistinct @@ -3521,25 +3523,32 @@ JoinPart = join_type:ArrayJoinKeyword exprs:( _ ExpressionList )? { return loc({ kind: 'arrayJoinExpr', joinType: join_type, expressions: exprs ? exprs[1] : [] }); } - / join_type:JoinKeyword _ right:FromAtom _ constraint:JoinConstraint { - return loc({ kind: 'joinExpr', joinType: join_type, right, constraint }); + / jk:JoinKeyword _ right:FromAtom _ constraint:JoinConstraint { + const result = loc({ kind: 'joinExpr', joinType: jk.type, right, constraint }); + if (jk.strictness !== undefined) result.strictness = jk.strictness; + if (jk.global) result.global = true; + return result; } - / join_type:JoinKeyword _ right:FromAtom { - return loc({ kind: 'joinExpr', joinType: join_type, right }); + / jk:JoinKeyword _ right:FromAtom { + const result = loc({ kind: 'joinExpr', joinType: jk.type, right }); + if (jk.strictness !== undefined) result.strictness = jk.strictness; + if (jk.global) result.global = true; + return result; } // Comma-separated tables: implicit CROSS JOIN without constraint / "," _ right:FromAtom { - return loc({ kind: 'joinExpr', joinType: 'CROSS', right }); + return loc({ kind: 'joinExpr', joinType: 'CROSS', comma: true, right }); } -// JoinKeyword: [GLOBAL] [strictness] [direction] [OUTER] JOIN — returns direction string. +// JoinKeyword: [GLOBAL] [strictness] [direction] [OUTER] JOIN — returns the join +// direction plus the optional strictness (ANY/ALL/ASOF/SEMI/ANTI) and GLOBAL locality. // Structured as optional qualifiers to avoid ~80 brute-force alternatives. JoinKeyword // PASTE JOIN (special case): [ANY|ALL] PASTE JOIN - = (KW_ANY / KW_ALL)? _ "PASTE"i ![a-zA-Z0-9_] _ KW_JOIN { return "PASTE"; } + = (KW_ANY / KW_ALL)? _ "PASTE"i ![a-zA-Z0-9_] _ KW_JOIN { return { type: "PASTE" }; } // Standard joins: [GLOBAL] [strictness-before] [direction] [strictness-after] [OUTER] JOIN - / (KW_GLOBAL _)? - (JoinStrictness _)? + / global:(KW_GLOBAL _)? + s1:(JoinStrictness _)? dir:( KW_CROSS { return "CROSS"; } / KW_FULL { return "FULL"; } @@ -3548,12 +3557,23 @@ JoinKeyword / KW_INNER { return "INNER"; } )? // Handle strictness/qualifier after direction: LEFT ANY JOIN, LEFT ASOF JOIN, etc. - (_ JoinStrictness)? + s2:(_ JoinStrictness)? (_ KW_OUTER)? - _ KW_JOIN { return dir !== null ? dir : "INNER"; } + _ KW_JOIN { + const strictness = s1 !== null ? s1[0] : (s2 !== null ? s2[1] : undefined); + const result = { type: dir !== null ? dir : "INNER" }; + if (strictness !== undefined) result.strictness = strictness; + if (global !== null) result.global = true; + return result; + } -// JoinStrictness: any/all/semi/anti/asof qualifier (consumed but not used in AST) -JoinStrictness = KW_ANY / KW_ALL / KW_SEMI / KW_ANTI / KW_ASOF +// JoinStrictness: any/all/semi/anti/asof qualifier +JoinStrictness + = KW_ANY { return 'ANY'; } + / KW_ALL { return 'ALL'; } + / KW_SEMI { return 'SEMI'; } + / KW_ANTI { return 'ANTI'; } + / KW_ASOF { return 'ASOF'; } ArrayJoinKeyword = KW_LEFT _ KW_ARRAY _ KW_JOIN { return "LEFT ARRAY"; } @@ -3754,8 +3774,10 @@ OrderByItem { const resolvedExpr = alias !== null ? loc({ kind: 'alias', expr, alias: alias[3] }) : expr; const result = loc({ kind: 'orderByItem', expr: resolvedExpr, direction: dir !== null ? dir[1].toUpperCase() : 'ASC' }); + if (nulls !== null) result.nullsFirst = /^first$/i.test(nulls[4]); if (collate !== null) result.collate = collate[4].value; if (fill !== null) { + result.withFill = true; const fillArgs = fill[6]; if (fillArgs !== null) { if (fillArgs.fillFrom !== undefined) result.fillFrom = fillArgs.fillFrom; @@ -3824,7 +3846,7 @@ ExpressionWithImplicitAlias // TernaryExpr: ternary ? : operator, maps to Function if(cond, then, else) TernaryExpr = cond:OrExpr ws1:_ "?" ws2:_ then:TernaryExpr ws3:_ ":" ws4:_ else_:TernaryExpr { - return loc({ kind: 'functionCall', name: 'if', args: [ + return loc({ kind: 'functionCall', name: 'if', isOperator: true, args: [ cond, addLeading(then, [...flattenWs(ws1), ...flattenWs(ws2)]), addLeading(else_, [...flattenWs(ws3), ...flattenWs(ws4)]) @@ -3898,30 +3920,30 @@ CompareBaseSuffix // LIKE / ILIKE / _ negated:(KW_NOT _)? KW_ILIKE _ right:AddExpr { const name = negated !== null ? 'notILike' : 'ilike'; - return (left) => (loc({ kind: 'functionCall', name, args: [left, right] })); + return (left) => (loc({ kind: 'functionCall', name, isOperator: true, args: [left, right] })); } / _ negated:(KW_NOT _)? KW_LIKE _ right:AddExpr { const name = negated !== null ? 'notLike' : 'like'; - return (left) => (loc({ kind: 'functionCall', name, args: [left, right] })); + return (left) => (loc({ kind: 'functionCall', name, isOperator: true, args: [left, right] })); } // REGEXP / _ "REGEXP"i ![a-zA-Z0-9_] _ right:AddExpr { - return (left) => (loc({ kind: 'functionCall', name: 'match', args: [left, right] })); + return (left) => (loc({ kind: 'functionCall', name: 'match', isOperator: true, args: [left, right] })); } // BETWEEN / _ KW_NOT _ KW_BETWEEN _ low:AddExpr _ KW_AND _ high:AddExpr { return (left) => (loc({ - kind: 'functionCall', name: 'or', args: [ - loc({ kind: 'functionCall', name: 'less', args: [left, low] }), - loc({ kind: 'functionCall', name: 'greater', args: [left, high] }) + kind: 'functionCall', name: 'or', isOperator: true, args: [ + loc({ kind: 'functionCall', name: 'less', isOperator: true, args: [left, low] }), + loc({ kind: 'functionCall', name: 'greater', isOperator: true, args: [left, high] }) ] })); } / _ KW_BETWEEN _ low:AddExpr _ KW_AND _ high:AddExpr { return (left) => (loc({ - kind: 'functionCall', name: 'and', args: [ - loc({ kind: 'functionCall', name: 'greaterOrEquals', args: [left, low] }), - loc({ kind: 'functionCall', name: 'lessOrEquals', args: [left, high] }) + kind: 'functionCall', name: 'and', isOperator: true, args: [ + loc({ kind: 'functionCall', name: 'greaterOrEquals', isOperator: true, args: [left, low] }), + loc({ kind: 'functionCall', name: 'lessOrEquals', isOperator: true, args: [left, high] }) ] })); } @@ -3934,13 +3956,13 @@ CompareBaseSuffix // The arith tail allows arithmetic ops to bind tighter than comparison, matching ClickHouse precedence. / _ "IS"i ![a-zA-Z0-9_] _ "NOT"i ![a-zA-Z0-9_] _ "NULL"i ![a-zA-Z0-9_] arith:( _ op:AddOp _ right:NotPrefixExpr )* { return (left) => { - const base = loc({ kind: 'functionCall', name: 'isNotNull', args: [left] }); + const base = loc({ kind: 'functionCall', name: 'isNotNull', isOperator: true, args: [left] }); return arith.reduce((acc, t) => (loc({ kind: 'binaryExpr', op: t[1], left: acc, right: t[3] })), base); }; } / _ "IS"i ![a-zA-Z0-9_] _ "NULL"i ![a-zA-Z0-9_] arith:( _ op:AddOp _ right:NotPrefixExpr )* { return (left) => { - const base = loc({ kind: 'functionCall', name: 'isNull', args: [left] }); + const base = loc({ kind: 'functionCall', name: 'isNull', isOperator: true, args: [left] }); return arith.reduce((acc, t) => (loc({ kind: 'binaryExpr', op: t[1], left: acc, right: t[3] })), base); }; } @@ -4019,7 +4041,7 @@ ConcatExpr = head:MulExpr tail:(_ "||" _ MulExpr)* { if (tail.length === 0) return head; const parts = [head, ...tail.map((t) => addLeading(t[3], [...flattenWs(t[0]), ...flattenWs(t[2])]))]; - return loc({ kind: 'functionCall', name: 'concat', args: parts }); + return loc({ kind: 'functionCall', name: 'concat', isOperator: true, args: parts }); } MulExpr @@ -4049,7 +4071,7 @@ UnaryExpr // (-1) without an outer minus stays as a UInt64 literal — only `-` immediately before a // bare literal folds. A parenthesized inner expression always wraps in negate(). if (expr.parenthesized) { - return loc({ kind: 'functionCall', name: 'negate', args: [expr] }); + return loc({ kind: 'functionCall', name: 'negate', isOperator: true, args: [expr] }); } if (expr.kind === 'literal' && expr.type === 'UInt64') { // Negate a non-negative integer literal: compute decimal value using BigInt for precision @@ -4105,7 +4127,7 @@ UnaryExpr } } // For all other cases (non-literal, already-negative literal, etc.), wrap in negate() - return loc({ kind: 'functionCall', name: 'negate', args: [expr] }); + return loc({ kind: 'functionCall', name: 'negate', isOperator: true, args: [expr] }); } / PrimaryExpr @@ -4117,10 +4139,10 @@ UnaryExpr // .name (tuple element by name), .:Type (JSON subcolumn), .* (tuple expansion) // e.g. arr[1], tuple.2, expr::Int32, json.:String, row.* PrimaryExpr - = base:PrimaryBase suffixes:PrimaryExprSuffix* NullsHandlingClause? over:OverClause? { + = base:PrimaryBase suffixes:PrimaryExprSuffix* nullsAction:NullsHandlingClause? over:OverClause? { const result = suffixes.reduce((acc, s) => { if (s.kind === 'subscript') { - return loc({ kind: 'functionCall', name: 'arrayElement', args: [acc, s.index] }); + return loc({ kind: 'functionCall', name: 'arrayElement', isOperator: true, args: [acc, s.index] }); } else if (s.kind === 'tuple_element') { let idxArg; const absIndex = s.index.charAt(0) === '-' ? s.index.substring(1) : s.index; @@ -4134,14 +4156,14 @@ PrimaryExpr } if (s.index.charAt(0) === '-') { // Negative index: wrap as negate(literal) - idxArg = loc({ kind: 'functionCall', name: 'negate', args: [idxLiteral] }); + idxArg = loc({ kind: 'functionCall', name: 'negate', isOperator: true, args: [idxLiteral] }); } else { idxArg = idxLiteral; } - return loc({ kind: 'functionCall', name: 'tupleElement', args: [acc, idxArg] }); + return loc({ kind: 'functionCall', name: 'tupleElement', isOperator: true, args: [acc, idxArg] }); } else if (s.kind === 'field_access') { // Named field access: expr.name — tuple element by name - return loc({ kind: 'functionCall', name: 'tupleElement', args: [acc, loc({ kind: 'literal', type: 'String', value: s.name })] }); + return loc({ kind: 'functionCall', name: 'tupleElement', isOperator: true, args: [acc, loc({ kind: 'literal', type: 'String', value: s.name })] }); } else if (s.kind === 'json_subcolumn') { // .:Type or .:`QuotedType` — JSON subcolumn type annotation const node = loc({ kind: 'jsonSubcolumn', expr: acc, type: s.type }); @@ -4157,16 +4179,21 @@ PrimaryExpr return loc({ kind: 'castExpr', expr: acc, type: s.type, operator: true }); } }, base); - // Attach window spec to function calls with an inline OVER (spec) clause + // Attach NULLS handling (RESPECT/IGNORE NULLS) to function calls + if (nullsAction !== null && nullsAction !== undefined && result !== null && result.kind === 'functionCall') { + result.nullsAction = nullsAction; + } + // Attach window spec / named-window reference to function calls with an OVER clause if (over !== null && over !== undefined && result !== null && result.kind === 'functionCall') { - result.window = over; + if (over.spec !== undefined) result.window = over.spec; + if (over.name !== undefined) result.windowName = over.name; } return result; } -// NullsHandlingClause: RESPECT NULLS or IGNORE NULLS modifier on window functions (discarded) +// NullsHandlingClause: RESPECT NULLS or IGNORE NULLS modifier on window functions NullsHandlingClause - = _ ("RESPECT"i / "IGNORE"i) ![a-zA-Z0-9_] _ "NULLS"i ![a-zA-Z0-9_] + = _ kw:("RESPECT"i / "IGNORE"i) ![a-zA-Z0-9_] _ "NULLS"i ![a-zA-Z0-9_] { return kw.toUpperCase() + ' NULLS'; } // OverClause: window function OVER clause. // Returns a WindowSpec for inline specs, or null for bare named-window references. @@ -4179,11 +4206,15 @@ NullsHandlingClause OverClause // OVER (identifier [spec]) — always returns the spec (possibly empty {}) to trigger WindowDefinition // Named windows with OVER (w) produce an empty WindowDefinition; OVER (w spec) adds the spec content. - = _ "OVER"i ![a-zA-Z0-9_] _ "(" _ Identifier _ spec:WindowSpec _ ")" { return spec; } + // The leading identifier is the parent window name (window inheritance). + = _ "OVER"i ![a-zA-Z0-9_] _ "(" _ base:Identifier _ spec:WindowSpec _ ")" { + spec.baseWindow = base; + return { spec }; + } // OVER (spec) — inline window spec - / _ "OVER"i ![a-zA-Z0-9_] _ "(" _ spec:WindowSpec _ ")" { return spec; } + / _ "OVER"i ![a-zA-Z0-9_] _ "(" _ spec:WindowSpec _ ")" { return { spec }; } // OVER name — bare window name reference; NO WindowDefinition (ClickHouse doesn't show one) - / _ "OVER"i ![a-zA-Z0-9_] _ Identifier { return null; } + / _ "OVER"i ![a-zA-Z0-9_] _ name:Identifier { return { name }; } // WindowSpec: optional PARTITION BY, ORDER BY, and frame clause WindowSpec @@ -4384,7 +4415,7 @@ PrimaryBase // NOT(expr) and NOT (expr) — parenthesized NOT as a high-precedence unary operator. // This is distinct from NotExpr (low precedence): NOT (0) + NOT (0) → plus(not(0), not(0)). // NOT (a, b, c) — NOT applied to a multi-element tuple: not(tuple(a, b, c)) - / KW_NOT _ tuple:TupleLiteral { return loc({ kind: 'functionCall', name: 'not', args: [tuple] }); } + / KW_NOT _ tuple:TupleLiteral { return loc({ kind: 'functionCall', name: 'not', isOperator: true, args: [tuple] }); } / KW_NOT _ "(" _ expr:ExpressionWithImplicitAlias _ ")" { return loc({ kind: 'unaryExpr', op: 'NOT', expr: expr }); } / ParenGroup / ArrayLiteral diff --git a/src/index.ts b/src/index.ts index 2fc1e3b99..91db47be4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -137,6 +137,13 @@ export function parse(sql: string, options?: ParseOptions): Statement[] { export { format, formatNode } from './format'; export { formatExplain } from './explain'; +export { + formatExplainJSON, + explainJSON, + AST_JSON_FORMAT_VERSION, + type ExplainJSONNode, + type ExplainJSONDocument, +} from './explain-json'; export { findNodes } from './find-nodes'; export { transformNodes, type NodePositionMap } from './transform-nodes'; export { diff --git a/src/parser.js b/src/parser.js index 07c417f60..cb54a39b3 100644 --- a/src/parser.js +++ b/src/parser.js @@ -2826,7 +2826,8 @@ function peg$parse(input, options) { // UNION DISTINCT: always create a new union node with mode result = loc({ kind: 'union', queries: [result, right], unionMode: 'DISTINCT' }); } else { - result = loc({ kind: 'intersect', op, left: result, right }); + result = loc({ kind: 'intersect', op: op === 'EXCEPT DISTINCT' ? 'EXCEPT' : op, left: result, right }); + if (op === 'EXCEPT DISTINCT') result.distinct = true; } } return result; @@ -2836,12 +2837,13 @@ function peg$parse(input, options) { let result = head; for (const t of tail) { result = loc({ kind: 'intersect', op: 'INTERSECT', left: result, right: addLeading(t[3], [...flattenWs(t[0]), ...flattenWs(t[2])]) }); + if (t[1] === 'INTERSECT DISTINCT') result.distinct = true; } return result; } function peg$f529(mode) { return mode === 'DISTINCT' ? 'UNION DISTINCT' : 'UNION'; } - function peg$f530() { return 'EXCEPT'; } - function peg$f531() { return 'INTERSECT'; } + function peg$f530(mode) { return mode !== null && mode[1] === 'DISTINCT' ? 'EXCEPT DISTINCT' : 'EXCEPT'; } + function peg$f531(mode) { return mode !== null && mode[1] === 'DISTINCT' ? 'INTERSECT DISTINCT' : 'INTERSECT'; } function peg$f532() { return 'ALL'; } function peg$f533() { return 'DISTINCT'; } function peg$f534() { return 'EXCEPT'; } @@ -3113,49 +3115,66 @@ function peg$parse(input, options) { function peg$f575(join_type, exprs) { return loc({ kind: 'arrayJoinExpr', joinType: join_type, expressions: exprs ? exprs[1] : [] }); } - function peg$f576(join_type, right, constraint) { - return loc({ kind: 'joinExpr', joinType: join_type, right, constraint }); + function peg$f576(jk, right, constraint) { + const result = loc({ kind: 'joinExpr', joinType: jk.type, right, constraint }); + if (jk.strictness !== undefined) result.strictness = jk.strictness; + if (jk.global) result.global = true; + return result; } - function peg$f577(join_type, right) { - return loc({ kind: 'joinExpr', joinType: join_type, right }); + function peg$f577(jk, right) { + const result = loc({ kind: 'joinExpr', joinType: jk.type, right }); + if (jk.strictness !== undefined) result.strictness = jk.strictness; + if (jk.global) result.global = true; + return result; } function peg$f578(right) { - return loc({ kind: 'joinExpr', joinType: 'CROSS', right }); - } - function peg$f579() { return "PASTE"; } - function peg$f580() { return "CROSS"; } - function peg$f581() { return "FULL"; } - function peg$f582() { return "LEFT"; } - function peg$f583() { return "RIGHT"; } - function peg$f584() { return "INNER"; } - function peg$f585(dir) { return dir !== null ? dir : "INNER"; } - function peg$f586() { return "LEFT ARRAY"; } - function peg$f587() { return "ARRAY"; } - function peg$f588(comments, expr) { return { kind: 'on', expr: addWsLeading(expr, comments) }; } - function peg$f589(cols) { return { kind: 'using', columns: cols !== null ? cols : [] }; } - function peg$f590() { return { kind: 'using', columns: ['*'] }; } - function peg$f591(cols) { return { kind: 'using', columns: cols }; } - function peg$f592(head, tail) { + return loc({ kind: 'joinExpr', joinType: 'CROSS', comma: true, right }); + } + function peg$f579() { return { type: "PASTE" }; } + function peg$f580(global, s1) { return "CROSS"; } + function peg$f581(global, s1) { return "FULL"; } + function peg$f582(global, s1) { return "LEFT"; } + function peg$f583(global, s1) { return "RIGHT"; } + function peg$f584(global, s1) { return "INNER"; } + function peg$f585(global, s1, dir, s2) { + const strictness = s1 !== null ? s1[0] : (s2 !== null ? s2[1] : undefined); + const result = { type: dir !== null ? dir : "INNER" }; + if (strictness !== undefined) result.strictness = strictness; + if (global !== null) result.global = true; + return result; + } + function peg$f586() { return 'ANY'; } + function peg$f587() { return 'ALL'; } + function peg$f588() { return 'SEMI'; } + function peg$f589() { return 'ANTI'; } + function peg$f590() { return 'ASOF'; } + function peg$f591() { return "LEFT ARRAY"; } + function peg$f592() { return "ARRAY"; } + function peg$f593(comments, expr) { return { kind: 'on', expr: addWsLeading(expr, comments) }; } + function peg$f594(cols) { return { kind: 'using', columns: cols !== null ? cols : [] }; } + function peg$f595() { return { kind: 'using', columns: ['*'] }; } + function peg$f596(cols) { return { kind: 'using', columns: cols }; } + function peg$f597(head, tail) { return [head, ...tail.map((t) => t[3])]; } - function peg$f593(name, alias) { return { name, alias }; } - function peg$f594(name) { return name; } - function peg$f595(head, tail) { + function peg$f598(name, alias) { return { name, alias }; } + function peg$f599(name) { return name; } + function peg$f600(head, tail) { return [head, ...tail.map((t) => t[3])]; } - function peg$f596(comments, expr) { return addWsLeading(expr, comments); } - function peg$f597(comments, expr) { return addWsLeading(expr, comments); } - function peg$f598(modifiers) { + function peg$f601(comments, expr) { return addWsLeading(expr, comments); } + function peg$f602(comments, expr) { return addWsLeading(expr, comments); } + function peg$f603(modifiers) { const withTotals = modifiers.some((m) => m === 'TOTALS'); const withCube = modifiers.some((m) => m === 'CUBE'); const withRollup = modifiers.some((m) => m === 'ROLLUP'); return { all: true, withTotals, withCube, withRollup }; } - function peg$f599(sets, modifiers) { + function peg$f604(sets, modifiers) { const withTotals = modifiers.some((m) => m === 'TOTALS'); return { groupingSets: sets, withTotals }; } - function peg$f600(keywordComments, exprList, modifiers) { + function peg$f605(keywordComments, exprList, modifiers) { const withTotals = modifiers.some((m) => m === 'TOTALS'); const withCube = modifiers.some((m) => m === 'CUBE'); const withRollup = modifiers.some((m) => m === 'ROLLUP'); @@ -3167,79 +3186,81 @@ function peg$parse(input, options) { } return { items, withTotals, withCube, withRollup }; } - function peg$f601(head, tail) { + function peg$f606(head, tail) { return [head, ...tail.map((t) => t[3])]; } - function peg$f602(items) { return items; } - function peg$f603() { return []; } - function peg$f604(expr) { return [expr]; } - function peg$f605() { return 'TOTALS'; } - function peg$f606() { return 'ROLLUP'; } - function peg$f607() { return 'CUBE'; } - function peg$f608() { return 'TOTALS'; } - function peg$f609() { return 'ROLLUP'; } - function peg$f610() { return 'CUBE'; } - function peg$f611(comments, expr) { return addWsLeading(expr, comments); } - function peg$f612(comments, expr) { return addWsLeading(expr, comments); } - function peg$f613(items) { return items; } - function peg$f614(count) { return { count: count, by: [] }; } - function peg$f615(offset, count) { + function peg$f607(items) { return items; } + function peg$f608() { return []; } + function peg$f609(expr) { return [expr]; } + function peg$f610() { return 'TOTALS'; } + function peg$f611() { return 'ROLLUP'; } + function peg$f612() { return 'CUBE'; } + function peg$f613() { return 'TOTALS'; } + function peg$f614() { return 'ROLLUP'; } + function peg$f615() { return 'CUBE'; } + function peg$f616(comments, expr) { return addWsLeading(expr, comments); } + function peg$f617(comments, expr) { return addWsLeading(expr, comments); } + function peg$f618(items) { return items; } + function peg$f619(count) { return { count: count, by: [] }; } + function peg$f620(offset, count) { return { count: count, by: [], limitByOffset: offset }; } - function peg$f616(count, offset) { + function peg$f621(count, offset) { return { count: count, by: [], limitByOffset: offset }; } - function peg$f617(offset, count, by) { + function peg$f622(offset, count, by) { return { count: count, by: by, limitByOffset: offset }; } - function peg$f618(count, offset, by) { + function peg$f623(count, offset, by) { return { count: count, by: by, limitByOffset: offset }; } - function peg$f619(count, by) { + function peg$f624(count, by) { return { count: count, by: by }; } - function peg$f620(count, offset) { return { count: count, offset: offset, comma: true, withTies: true }; } - function peg$f621(count, offset) { return { count: count, offset: offset, comma: true }; } - function peg$f622(count) { return { count: count, comma: false, withTies: true }; } - function peg$f623(count) { return { count: count, comma: false }; } - function peg$f624(count) { return count; } - function peg$f625(count, ties) { + function peg$f625(count, offset) { return { count: count, offset: offset, comma: true, withTies: true }; } + function peg$f626(count, offset) { return { count: count, offset: offset, comma: true }; } + function peg$f627(count) { return { count: count, comma: false, withTies: true }; } + function peg$f628(count) { return { count: count, comma: false }; } + function peg$f629(count) { return count; } + function peg$f630(count, ties) { return { count: count, withTies: typeof ties === 'string' ? false : true }; } - function peg$f626(items) { return items; } - function peg$f627(items) { return items; } - function peg$f628(head, tail) { + function peg$f631(items) { return items; } + function peg$f632(items) { return items; } + function peg$f633(head, tail) { return [head, ...tail.map((t) => t[3])]; } - function peg$f629(name, baseWindow, spec) { + function peg$f634(name, baseWindow, spec) { spec.baseWindow = baseWindow; return { name, spec }; } - function peg$f630(name, spec) { + function peg$f635(name, spec) { return { name, spec }; } - function peg$f631(head, tail) { + function peg$f636(head, tail) { return [head, ...tail.map((t) => t[3])]; } - function peg$f632(head, tail) { return head + tail.join(''); } - function peg$f633(chars) { return chars.join(''); } - function peg$f634(chars) { return chars.join(''); } - function peg$f635(name, value, forResource) { + function peg$f637(head, tail) { return head + tail.join(''); } + function peg$f638(chars) { return chars.join(''); } + function peg$f639(chars) { return chars.join(''); } + function peg$f640(name, value, forResource) { const result = { name, value }; if (forResource !== null) result.forResource = forResource[3]; return result; } - function peg$f636(name) { + function peg$f641(name) { return { name, value: loc({ kind: 'literal', type: 'UInt64', value: '1' }) }; } - function peg$f637(head, tail) { + function peg$f642(head, tail) { return [head, ...tail.map((t) => t[3])]; } - function peg$f638(expr, alias, dir, nulls, collate, fill) { + function peg$f643(expr, alias, dir, nulls, collate, fill) { const resolvedExpr = alias !== null ? loc({ kind: 'alias', expr, alias: alias[3] }) : expr; const result = loc({ kind: 'orderByItem', expr: resolvedExpr, direction: dir !== null ? dir[1].toUpperCase() : 'ASC' }); + if (nulls !== null) result.nullsFirst = /^first$/i.test(nulls[4]); if (collate !== null) result.collate = collate[4].value; if (fill !== null) { + result.withFill = true; const fillArgs = fill[6]; if (fillArgs !== null) { if (fillArgs.fillFrom !== undefined) result.fillFrom = fillArgs.fillFrom; @@ -3251,7 +3272,7 @@ function peg$parse(input, options) { } return result; } - function peg$f639(from, to, step, staleness, interp) { + function peg$f644(from, to, step, staleness, interp) { const result = {}; if (from !== null && from[4] !== null) result.fillFrom = from[4]; if (to !== null && to[4] !== null) result.fillTo = to[4]; @@ -3260,104 +3281,104 @@ function peg$parse(input, options) { if (interp !== null) result.interpolate = interp[6]; return result; } - function peg$f640(head, tail) { return [head, ...tail.map((t) => t[3])]; } - function peg$f641() { return []; } - function peg$f642(col, expr) { return { col: col, expr: expr }; } - function peg$f643(col) { return { col: col }; } - function peg$f644(head, tail) { return buildCommaList(head, tail); } - function peg$f645(expr, asWs, alias) { + function peg$f645(head, tail) { return [head, ...tail.map((t) => t[3])]; } + function peg$f646() { return []; } + function peg$f647(col, expr) { return { col: col, expr: expr }; } + function peg$f648(col) { return { col: col }; } + function peg$f649(head, tail) { return buildCommaList(head, tail); } + function peg$f650(expr, asWs, alias) { // Unwrap auto-alias (e.g. @@varname) if an explicit AS alias is provided const inner = (expr.kind === 'alias' && typeof expr.alias === 'string' && expr.alias.charAt(0) === '@') ? expr.expr : expr; return loc({ kind: 'alias', expr: addTrailing(inner, flattenWs(asWs)), alias }); } - function peg$f646(expr, asWs, alias) { + function peg$f651(expr, asWs, alias) { const inner = (expr.kind === 'alias' && typeof expr.alias === 'string' && expr.alias.charAt(0) === '@') ? expr.expr : expr; return loc({ kind: 'alias', expr: addTrailing(inner, flattenWs(asWs)), alias }); } - function peg$f647(expr, aliasWs, alias) { + function peg$f652(expr, aliasWs, alias) { return loc({ kind: 'alias', expr: addTrailing(expr, flattenWs(aliasWs)), alias }); } - function peg$f648(cond, ws1, ws2, then, ws3, ws4, else_) { - return loc({ kind: 'functionCall', name: 'if', args: [ + function peg$f653(cond, ws1, ws2, then, ws3, ws4, else_) { + return loc({ kind: 'functionCall', name: 'if', isOperator: true, args: [ cond, addLeading(then, [...flattenWs(ws1), ...flattenWs(ws2)]), addLeading(else_, [...flattenWs(ws3), ...flattenWs(ws4)]) ] }); } - function peg$f649(head, tail) { + function peg$f654(head, tail) { const operands = [head, ...tail.map((t) => addLeading(t[3], [...flattenWs(t[0]), ...flattenWs(t[2])]))]; return loc({ kind: 'naryExpr', op: 'OR', operands }); } - function peg$f650(head, tail) { + function peg$f655(head, tail) { const operands = [head, ...tail.map((t) => addLeading(t[3], [...flattenWs(t[0]), ...flattenWs(t[2])]))]; return loc({ kind: 'naryExpr', op: 'AND', operands }); } - function peg$f651(comments, expr) { + function peg$f656(comments, expr) { return loc({ kind: 'unaryExpr', op: 'NOT', expr: addWsLeading(expr, comments) }); } - function peg$f652(base, rest) { + function peg$f657(base, rest) { return rest.reduce((acc, t) => (loc({ kind: 'binaryExpr', op: t[1], left: acc, right: addLeading(t[3], [...flattenWs(t[0]), ...flattenWs(t[2])]) })), base); } - function peg$f653(left, suffixes) { + function peg$f658(left, suffixes) { return suffixes.reduce((acc, s) => s(acc), left); } - function peg$f654(global, negated, target) { + function peg$f659(global, negated, target) { return (left) => { const result = loc({ kind: 'inExpr', negated: negated !== null, expr: left, ...target }); if (global !== null) result.global = true; return result; }; } - function peg$f655(negated, right) { + function peg$f660(negated, right) { const name = negated !== null ? 'notILike' : 'ilike'; - return (left) => (loc({ kind: 'functionCall', name, args: [left, right] })); + return (left) => (loc({ kind: 'functionCall', name, isOperator: true, args: [left, right] })); } - function peg$f656(negated, right) { + function peg$f661(negated, right) { const name = negated !== null ? 'notLike' : 'like'; - return (left) => (loc({ kind: 'functionCall', name, args: [left, right] })); + return (left) => (loc({ kind: 'functionCall', name, isOperator: true, args: [left, right] })); } - function peg$f657(right) { - return (left) => (loc({ kind: 'functionCall', name: 'match', args: [left, right] })); + function peg$f662(right) { + return (left) => (loc({ kind: 'functionCall', name: 'match', isOperator: true, args: [left, right] })); } - function peg$f658(low, high) { + function peg$f663(low, high) { return (left) => (loc({ - kind: 'functionCall', name: 'or', args: [ - loc({ kind: 'functionCall', name: 'less', args: [left, low] }), - loc({ kind: 'functionCall', name: 'greater', args: [left, high] }) + kind: 'functionCall', name: 'or', isOperator: true, args: [ + loc({ kind: 'functionCall', name: 'less', isOperator: true, args: [left, low] }), + loc({ kind: 'functionCall', name: 'greater', isOperator: true, args: [left, high] }) ] })); } - function peg$f659(low, high) { + function peg$f664(low, high) { return (left) => (loc({ - kind: 'functionCall', name: 'and', args: [ - loc({ kind: 'functionCall', name: 'greaterOrEquals', args: [left, low] }), - loc({ kind: 'functionCall', name: 'lessOrEquals', args: [left, high] }) + kind: 'functionCall', name: 'and', isOperator: true, args: [ + loc({ kind: 'functionCall', name: 'greaterOrEquals', isOperator: true, args: [left, low] }), + loc({ kind: 'functionCall', name: 'lessOrEquals', isOperator: true, args: [left, high] }) ] })); } - function peg$f660(type) { + function peg$f665(type) { return (left) => (loc({ kind: 'castExpr', expr: left, type: type, operator: true })); } - function peg$f661(arith) { + function peg$f666(arith) { return (left) => { - const base = loc({ kind: 'functionCall', name: 'isNotNull', args: [left] }); + const base = loc({ kind: 'functionCall', name: 'isNotNull', isOperator: true, args: [left] }); return arith.reduce((acc, t) => (loc({ kind: 'binaryExpr', op: t[1], left: acc, right: t[3] })), base); }; } - function peg$f662(arith) { + function peg$f667(arith) { return (left) => { - const base = loc({ kind: 'functionCall', name: 'isNull', args: [left] }); + const base = loc({ kind: 'functionCall', name: 'isNull', isOperator: true, args: [left] }); return arith.reduce((acc, t) => (loc({ kind: 'binaryExpr', op: t[1], left: acc, right: t[3] })), base); }; } - function peg$f663() { return '<=>'; } - function peg$f664() { return 'IS DISTINCT FROM'; } - function peg$f665(op) { return op; } - function peg$f666(arr) { return { values: [arr] }; } - function peg$f667(beforeValues, values, afterValues) { + function peg$f668() { return '<=>'; } + function peg$f669() { return 'IS DISTINCT FROM'; } + function peg$f670(op) { return op; } + function peg$f671(arr) { return { values: [arr] }; } + function peg$f672(beforeValues, values, afterValues) { // Attach comments to first/last value if they are expression nodes if (Array.isArray(values)) { const bv = flattenWs(beforeValues); @@ -3372,41 +3393,41 @@ function peg$parse(input, options) { } return { values }; } - function peg$f668(single) { return { values: [single] }; } - function peg$f669(expr) { return loc({ kind: 'unaryExpr', op: 'NOT', expr: expr }); } - function peg$f670(left, suffixes) { + function peg$f673(single) { return { values: [single] }; } + function peg$f674(expr) { return loc({ kind: 'unaryExpr', op: 'NOT', expr: expr }); } + function peg$f675(left, suffixes) { return suffixes.reduce((acc, s) => s(acc), left); } - function peg$f671(query) { return loc({ kind: 'subqueryExpr', query: query }); } - function peg$f672(head, tail) { + function peg$f676(query) { return loc({ kind: 'subqueryExpr', query: query }); } + function peg$f677(head, tail) { return tail.reduce((acc, t) => (loc({ kind: 'binaryExpr', op: t[1], left: acc, right: addLeading(t[3], [...flattenWs(t[0]), ...flattenWs(t[2])]) })), head); } - function peg$f673(expr) { return loc({ kind: 'unaryExpr', op: 'NOT', expr: expr }); } - function peg$f674() { return "-"; } - function peg$f675() { return "-"; } - function peg$f676(head, tail) { + function peg$f678(expr) { return loc({ kind: 'unaryExpr', op: 'NOT', expr: expr }); } + function peg$f679() { return "-"; } + function peg$f680() { return "-"; } + function peg$f681(head, tail) { if (tail.length === 0) return head; const parts = [head, ...tail.map((t) => addLeading(t[3], [...flattenWs(t[0]), ...flattenWs(t[2])]))]; - return loc({ kind: 'functionCall', name: 'concat', args: parts }); + return loc({ kind: 'functionCall', name: 'concat', isOperator: true, args: parts }); } - function peg$f677(head, tail) { + function peg$f682(head, tail) { return tail.reduce((acc, t) => (loc({ kind: 'binaryExpr', op: t[1], left: acc, right: addLeading(t[3], [...flattenWs(t[0]), ...flattenWs(t[2])]) })), head); } - function peg$f678() { return 'DIV'; } - function peg$f679() { return 'MOD'; } - function peg$f680(expr) { return expr; } - function peg$f681(expr) { + function peg$f683() { return 'DIV'; } + function peg$f684() { return 'MOD'; } + function peg$f685(expr) { return expr; } + function peg$f686(expr) { // Don't fold across explicit parentheses: -(1) must produce negate(1), not Int64_-1. // (-1) without an outer minus stays as a UInt64 literal — only `-` immediately before a // bare literal folds. A parenthesized inner expression always wraps in negate(). if (expr.parenthesized) { - return loc({ kind: 'functionCall', name: 'negate', args: [expr] }); + return loc({ kind: 'functionCall', name: 'negate', isOperator: true, args: [expr] }); } if (expr.kind === 'literal' && expr.type === 'UInt64') { // Negate a non-negative integer literal: compute decimal value using BigInt for precision @@ -3462,12 +3483,12 @@ function peg$parse(input, options) { } } // For all other cases (non-literal, already-negative literal, etc.), wrap in negate() - return loc({ kind: 'functionCall', name: 'negate', args: [expr] }); + return loc({ kind: 'functionCall', name: 'negate', isOperator: true, args: [expr] }); } - function peg$f682(base, suffixes, over) { + function peg$f687(base, suffixes, nullsAction, over) { const result = suffixes.reduce((acc, s) => { if (s.kind === 'subscript') { - return loc({ kind: 'functionCall', name: 'arrayElement', args: [acc, s.index] }); + return loc({ kind: 'functionCall', name: 'arrayElement', isOperator: true, args: [acc, s.index] }); } else if (s.kind === 'tuple_element') { let idxArg; const absIndex = s.index.charAt(0) === '-' ? s.index.substring(1) : s.index; @@ -3481,14 +3502,14 @@ function peg$parse(input, options) { } if (s.index.charAt(0) === '-') { // Negative index: wrap as negate(literal) - idxArg = loc({ kind: 'functionCall', name: 'negate', args: [idxLiteral] }); + idxArg = loc({ kind: 'functionCall', name: 'negate', isOperator: true, args: [idxLiteral] }); } else { idxArg = idxLiteral; } - return loc({ kind: 'functionCall', name: 'tupleElement', args: [acc, idxArg] }); + return loc({ kind: 'functionCall', name: 'tupleElement', isOperator: true, args: [acc, idxArg] }); } else if (s.kind === 'field_access') { // Named field access: expr.name — tuple element by name - return loc({ kind: 'functionCall', name: 'tupleElement', args: [acc, loc({ kind: 'literal', type: 'String', value: s.name })] }); + return loc({ kind: 'functionCall', name: 'tupleElement', isOperator: true, args: [acc, loc({ kind: 'literal', type: 'String', value: s.name })] }); } else if (s.kind === 'json_subcolumn') { // .:Type or .:`QuotedType` — JSON subcolumn type annotation const node = loc({ kind: 'jsonSubcolumn', expr: acc, type: s.type }); @@ -3504,118 +3525,127 @@ function peg$parse(input, options) { return loc({ kind: 'castExpr', expr: acc, type: s.type, operator: true }); } }, base); - // Attach window spec to function calls with an inline OVER (spec) clause + // Attach NULLS handling (RESPECT/IGNORE NULLS) to function calls + if (nullsAction !== null && nullsAction !== undefined && result !== null && result.kind === 'functionCall') { + result.nullsAction = nullsAction; + } + // Attach window spec / named-window reference to function calls with an OVER clause if (over !== null && over !== undefined && result !== null && result.kind === 'functionCall') { - result.window = over; + if (over.spec !== undefined) result.window = over.spec; + if (over.name !== undefined) result.windowName = over.name; } return result; } - function peg$f683(spec) { return spec; } - function peg$f684(spec) { return spec; } - function peg$f685() { return null; } - function peg$f686(items) { return items; } - function peg$f687(partitionBy, items) { return items; } - function peg$f688(partitionBy, orderBy, frame) { + function peg$f688(kw) { return kw.toUpperCase() + ' NULLS'; } + function peg$f689(base, spec) { + spec.baseWindow = base; + return { spec }; + } + function peg$f690(spec) { return { spec }; } + function peg$f691(name) { return { name }; } + function peg$f692(items) { return items; } + function peg$f693(partitionBy, items) { return items; } + function peg$f694(partitionBy, orderBy, frame) { const spec = {}; if (partitionBy !== null) spec.partitionBy = partitionBy; if (orderBy !== null) spec.orderBy = orderBy; if (frame !== null) spec.frame = frame; return spec; } - function peg$f689(type, start, end) { + function peg$f695(type, start, end) { return { frameType: type, start: start, end: end }; } - function peg$f690(type, bound) { + function peg$f696(type, bound) { return { frameType: type, start: bound }; } - function peg$f691() { return text().toLowerCase(); } - function peg$f692() { return { kind: 'unbounded' }; } - function peg$f693() { return { kind: 'unbounded' }; } - function peg$f694() { return { kind: 'currentRow' }; } - function peg$f695(expr) { return { kind: 'preceding', expr: expr }; } - function peg$f696(expr) { return { kind: 'following', expr: expr }; } - function peg$f697(type) { return { kind: 'cast', type: type }; } - function peg$f698(type, name) { return name; } - function peg$f699(type, path) { + function peg$f697() { return text().toLowerCase(); } + function peg$f698() { return { kind: 'unbounded' }; } + function peg$f699() { return { kind: 'unbounded' }; } + function peg$f700() { return { kind: 'currentRow' }; } + function peg$f701(expr) { return { kind: 'preceding', expr: expr }; } + function peg$f702(expr) { return { kind: 'following', expr: expr }; } + function peg$f703(type) { return { kind: 'cast', type: type }; } + function peg$f704(type, name) { return name; } + function peg$f705(type, path) { return { kind: 'json_subcolumn', type: type, path: path }; } - function peg$f700(index) { return { kind: 'subscript', index: index }; } - function peg$f701(index) { return { kind: 'tuple_element', index: index }; } - function peg$f702(index) { return { kind: 'tuple_element', index: '-' + index }; } - function peg$f703(name) { return { kind: 'field_access', name: name }; } - function peg$f704(transformers) { + function peg$f706(index) { return { kind: 'subscript', index: index }; } + function peg$f707(index) { return { kind: 'tuple_element', index: index }; } + function peg$f708(index) { return { kind: 'tuple_element', index: '-' + index }; } + function peg$f709(name) { return { kind: 'field_access', name: name }; } + function peg$f710(transformers) { return { kind: 'asterisk_access', transformers: transformers.map((t) => t[1]) }; } - function peg$f705(chars) { return chars.join(''); } - function peg$f706() { return text().toUpperCase().replace(/\s+/g, ' ').trim(); } - function peg$f707(mw, args) { + function peg$f711(chars) { return chars.join(''); } + function peg$f712() { return text().toUpperCase().replace(/\s+/g, ' ').trim(); } + function peg$f713(mw, args) { const result = { name: mw }; if (args !== null) result.args = args[3] !== null ? args[3] : []; return result; } - function peg$f708(name) { return { name }; } - function peg$f709(name) { return { name }; } - function peg$f710(name, values) { + function peg$f714(name) { return { name }; } + function peg$f715(name) { return { name }; } + function peg$f716(name, values) { return { name: name.trim(), args: [{ kind: 'enumValues', values }] }; } - function peg$f711(name) { + function peg$f717(name) { return { name: name.trim() }; } - function peg$f712(name, args, suffix) { + function peg$f718(name, args, suffix) { let typeName = name; if (suffix !== null) typeName = (name + ' ' + suffix[1]).toUpperCase(); const result = { name: typeName }; if (args !== null) result.args = args[3] || []; return result; } - function peg$f713(head, tail) { + function peg$f719(head, tail) { return [head, ...tail.map(t => t[3])]; } - function peg$f714(name, value) { return { name: name.value, value: value.replace(/\s/g, '') }; } - function peg$f715() { return { name: null, value: null }; } - function peg$f716(name) { return { name: name.value }; } - function peg$f717(head, tail, trailing_comma) { + function peg$f720(name, value) { return { name: name.value, value: value.replace(/\s/g, '') }; } + function peg$f721() { return { name: null, value: null }; } + function peg$f722(name) { return { name: name.value }; } + function peg$f723(head, tail, trailing_comma) { return [head, ...tail.map(t => t[3])]; } - function peg$f718(str) { + function peg$f724(str) { return { kind: 'literal', value: 'SKIP REGEXP ' + str }; } - function peg$f719(path) { + function peg$f725(path) { return { kind: 'literal', value: 'SKIP ' + path }; } - function peg$f720(name, type) { + function peg$f726(name, type) { return { kind: 'namedField', name: name.replace(/[`"]/g, ''), type }; } - function peg$f721(str) { return { kind: 'literal', value: str }; } - function peg$f722(val) { return { kind: 'literal', value: val }; } - function peg$f723(name, val) { + function peg$f727(str) { return { kind: 'literal', value: str }; } + function peg$f728(val) { return { kind: 'literal', value: val }; } + function peg$f729(name, val) { return { kind: 'setting', name: name, value: val }; } - function peg$f724(type) { return { kind: 'type', type }; } - function peg$f725(raw) { return { kind: 'literal', value: raw }; } - function peg$f726(parts) { return text(); } - function peg$f727(mw) { return mw; } - function peg$f728(name) { return name; } - function peg$f729(name) { return name; } - function peg$f730(name, args) { + function peg$f730(type) { return { kind: 'type', type }; } + function peg$f731(raw) { return { kind: 'literal', value: raw }; } + function peg$f732(parts) { return text(); } + function peg$f733(mw) { return mw; } + function peg$f734(name) { return name; } + function peg$f735(name) { return name; } + function peg$f736(name, args) { return name + (args !== null ? args : ''); } - function peg$f731(parts) { + function peg$f737(parts) { return "(" + parts.join("") + ")"; } - function peg$f732(nested) { return nested; } - function peg$f733(str) { return str; } - function peg$f734(chars) { return chars; } - function peg$f735(tuple) { return loc({ kind: 'functionCall', name: 'not', args: [tuple] }); } - function peg$f736(expr) { return loc({ kind: 'unaryExpr', op: 'NOT', expr: expr }); } - function peg$f737(first, part) { return part; } - function peg$f738(first, rest) { + function peg$f738(nested) { return nested; } + function peg$f739(str) { return str; } + function peg$f740(chars) { return chars; } + function peg$f741(tuple) { return loc({ kind: 'functionCall', name: 'not', isOperator: true, args: [tuple] }); } + function peg$f742(expr) { return loc({ kind: 'unaryExpr', op: 'NOT', expr: expr }); } + function peg$f743(first, part) { return part; } + function peg$f744(first, rest) { return loc({ kind: 'columnRef', parts: [first, ...rest] }); } - function peg$f739(name) { return loc({ kind: 'columnRef', parts: [name] }); } - function peg$f740(name) { return loc({ kind: 'columnRef', parts: [name] }); } - function peg$f741() { return loc({ kind: 'functionCall', name: 'map', args: [] }); } - function peg$f742(first, rest) { + function peg$f745(name) { return loc({ kind: 'columnRef', parts: [name] }); } + function peg$f746(name) { return loc({ kind: 'columnRef', parts: [name] }); } + function peg$f747() { return loc({ kind: 'functionCall', name: 'map', args: [] }); } + function peg$f748(first, rest) { const args = [first[0], first[1]]; for (const r of rest) { args.push(r[3][0]); @@ -3623,21 +3653,21 @@ function peg$parse(input, options) { } return loc({ kind: 'functionCall', name: 'map', args }); } - function peg$f743(key, value) { return [key, value]; } - function peg$f744(name) { + function peg$f749(key, value) { return [key, value]; } + function peg$f750(name) { return loc({ kind: 'alias', alias: '@@' + name, expr: loc({ kind: 'functionCall', name: 'globalVariable', args: [loc({ kind: 'literal', type: 'String', value: name })] }) }); } - function peg$f745(body) { + function peg$f751(body) { return loc({ kind: 'lambdaExpr', params: [], body }); } - function peg$f746() { return loc({ kind: 'functionCall', name: 'tuple', args: [] }); } - function peg$f747(beforeQuery, query, afterQuery) { + function peg$f752() { return loc({ kind: 'functionCall', name: 'tuple', args: [] }); } + function peg$f753(beforeQuery, query, afterQuery) { return loc({ kind: 'subqueryExpr', query: addSurroundingWs(query, beforeQuery, afterQuery) }); } - function peg$f748(head, tail, body) { + function peg$f754(head, tail, body) { return loc({ kind: 'lambdaExpr', params: [head, ...tail.map((t) => t[3])], body }); } - function peg$f749(beforeFirst, first, rest, trailing, afterLast) { + function peg$f755(beforeFirst, first, rest, trailing, afterLast) { first = addLeading(first, flattenWs(beforeFirst)); if (rest.length === 0 && trailing === null) { // (expr) — parenthesized expression @@ -3652,16 +3682,16 @@ function peg$parse(input, options) { return loc({ kind: 'tupleLiteral', elements: elems, source: text() }); } } - function peg$f750(elem) { + function peg$f756(elem) { return loc({ kind: 'functionCall', name: 'tuple', args: [elem] }); } - function peg$f751(first, rest) { + function peg$f757(first, rest) { return loc({ kind: 'tupleLiteral', elements: [first, ...rest], source: text() }); } - function peg$f752() { + function peg$f758() { return loc({ kind: 'arrayLiteral', elements: [], source: text() }); } - function peg$f753(beforeItems, items, afterItems) { + function peg$f759(beforeItems, items, afterItems) { const bi = flattenWs(beforeItems); const ai = flattenWs(afterItems); if ((bi.length > 0 || ai.length > 0) && items.length > 0) { @@ -3671,10 +3701,10 @@ function peg$parse(input, options) { } return loc({ kind: 'arrayLiteral', elements: items, source: text() }); } - function peg$f754(name, type) { + function peg$f760(name, type) { return loc({ kind: 'queryParam', name: name, type: type.trim() }); } - function peg$f755(tag) { + function peg$f761(tag) { const endMarker = `$${tag}$`; const pos = input.indexOf(endMarker, peg$currPos); if (pos < 0) { error(`Unterminated heredoc $${tag}$`); } @@ -3683,12 +3713,12 @@ function peg$parse(input, options) { // Double backslashes so escapeStringValue in explain.ts outputs them correctly (consistent with StringChar handling of \\) return loc({ kind: 'literal', type: 'String', value: content.replace(/\\/g, '\\\\') }); } - function peg$f756() { return loc({ kind: 'literal', type: 'Bool', value: '1' }); } - function peg$f757() { return loc({ kind: 'literal', type: 'Bool', value: '0' }); } - function peg$f758() { + function peg$f762() { return loc({ kind: 'literal', type: 'Bool', value: '1' }); } + function peg$f763() { return loc({ kind: 'literal', type: 'Bool', value: '0' }); } + function peg$f764() { return loc({ kind: 'literal', type: 'NULL', value: 'NULL' }); } - function peg$f759(digits) { + function peg$f765(digits) { if (digits.length === 0) return loc({ kind: 'literal', type: 'String', value: '' }); // Pad to multiple of 8 bits, MSB-first, then interpret as UTF-8 bytes const padded = digits.padStart(Math.ceil(digits.length / 8) * 8, '0'); @@ -3698,12 +3728,12 @@ function peg$parse(input, options) { } return loc({ kind: 'literal', type: 'String', value: Buffer.from(bytes).toString('utf-8') }); } - function peg$f760(digits) { + function peg$f766(digits) { if (digits.length === 0) return loc({ kind: 'literal', type: 'String', value: '' }); const padded = digits.length % 2 === 1 ? '0' + digits : digits; return loc({ kind: 'literal', type: 'String', value: Buffer.from(padded, 'hex').toString('utf-8') }); } - function peg$f761(int, frac, exp) { + function peg$f767(int, frac, exp) { const cleanInt = int.replace(/_/g, ''); const cleanFrac = (frac || '').replace(/_/g, ''); const intVal = parseInt(cleanInt, 16); @@ -3711,7 +3741,7 @@ function peg$parse(input, options) { const value = exp !== null ? (intVal + fracVal) * Math.pow(2, exp) : (intVal + fracVal); return loc({ kind: 'literal', type: 'Float64', value: value.toString(), source: text() }); } - function peg$f762(digits, exp) { + function peg$f768(digits, exp) { // Remove underscore digit separators const clean = digits.replace(/_/g, ''); // Parse hex with optional exponent (e.g. 0x123p4) as float @@ -3725,28 +3755,28 @@ function peg$parse(input, options) { } return loc({ kind: 'literal', type: 'UInt64', value: '0x' + clean }); } - function peg$f763(sign, digits) { return (sign === '-' ? -1 : 1) * parseInt(digits.replace(/_/g, ''), 10); } - function peg$f764(digits) { + function peg$f769(sign, digits) { return (sign === '-' ? -1 : 1) * parseInt(digits.replace(/_/g, ''), 10); } + function peg$f770(digits) { // Remove underscore digit separators const clean = digits.replace(/_/g, ''); return loc({ kind: 'literal', type: 'UInt64', value: '0b' + clean }); } - function peg$f765() { return loc({ kind: 'literal', type: 'Float64', value: 'inf' }); } - function peg$f766() { return loc({ kind: 'literal', type: 'Float64', value: 'nan' }); } - function peg$f767(digits, frac, exp) { + function peg$f771() { return loc({ kind: 'literal', type: 'Float64', value: 'inf' }); } + function peg$f772() { return loc({ kind: 'literal', type: 'Float64', value: 'nan' }); } + function peg$f773(digits, frac, exp) { return loc({ kind: 'literal', type: 'Float64', value: digits.replace(/_/g, '') + '.' + (frac || '').replace(/_/g, '') + (exp || '') }); } - function peg$f768(digits, exp) { + function peg$f774(digits, exp) { return loc({ kind: 'literal', type: 'Float64', value: '.' + digits.replace(/_/g, '') + (exp || '') }); } - function peg$f769(digits, exp) { + function peg$f775(digits, exp) { return loc({ kind: 'literal', type: 'Float64', value: digits.replace(/_/g, '') + exp }); } - function peg$f770(e, sign, digits) { return e + sign + digits.replace(/_/g, ''); } - function peg$f771(param, body) { + function peg$f776(e, sign, digits) { return e + sign + digits.replace(/_/g, ''); } + function peg$f777(param, body) { return loc({ kind: 'lambdaExpr', params: [param], body: body }); } - function peg$f772(branches, elseClause) { + function peg$f778(branches, elseClause) { const args = []; for (const branch of branches) { args.push(branch[0]); @@ -3755,7 +3785,7 @@ function peg$parse(input, options) { args.push(elseClause !== null ? elseClause[4] : loc({ kind: 'literal', type: 'NULL', value: 'NULL' })); return loc({ kind: 'functionCall', name: 'multiIf', args }); } - function peg$f773(subject, branches, elseClause) { + function peg$f779(subject, branches, elseClause) { const args = [subject]; for (const branch of branches) { args.push(branch[0]); @@ -3764,13 +3794,13 @@ function peg$parse(input, options) { args.push(elseClause !== null ? elseClause[4] : loc({ kind: 'literal', type: 'NULL', value: 'NULL' })); return loc({ kind: 'functionCall', name: 'caseWithExpression', args }); } - function peg$f774(cond, val) { + function peg$f780(cond, val) { return [cond, val]; } - function peg$f775(expr, unit) { + function peg$f781(expr, unit) { return loc({ kind: 'functionCall', name: 'toInterval' + unit, args: [expr] }); } - function peg$f776(str) { + function peg$f782(str) { const parts = str.value.trim().split(/\s+/); const unitMap = { NANOSECOND: 'Nanosecond', MICROSECOND: 'Microsecond', MILLISECOND: 'Millisecond', @@ -3789,27 +3819,27 @@ function peg$parse(input, options) { // Multi-part interval: wrap in tuple (ClickHouse expands into addTupleOfIntervals) return loc({ kind: 'functionCall', name: 'tuple', args: intervals }); } - function peg$f777(word) { return INTERVAL_UNITS[word.toLowerCase()] !== undefined; } - function peg$f778(word) { + function peg$f783(word) { return INTERVAL_UNITS[word.toLowerCase()] !== undefined; } + function peg$f784(word) { return INTERVAL_UNITS[word.toLowerCase()]; } - function peg$f779() { return 'plus'; } - function peg$f780() { return 'minus'; } - function peg$f781(unit, amount, date) { + function peg$f785() { return 'plus'; } + function peg$f786() { return 'minus'; } + function peg$f787(unit, amount, date) { return [date, loc({ kind: 'functionCall', name: 'toInterval' + unit, args: [amount] })]; } - function peg$f782(date, interval) { return [date, interval]; } - function peg$f783(interval, date) { return [interval, date]; } - function peg$f784(fn, args) { + function peg$f788(date, interval) { return [date, interval]; } + function peg$f789(interval, date) { return [interval, date]; } + function peg$f790(fn, args) { return loc({ kind: 'functionCall', name: fn, args: args }); } - function peg$f785(fn, args) { + function peg$f791(fn, args) { return loc({ kind: 'functionCall', name: fn, args: args }); } - function peg$f786(unit, amount, date) { + function peg$f792(unit, amount, date) { return loc({ kind: 'functionCall', name: 'minus', args: [date, loc({ kind: 'functionCall', name: 'toInterval' + unit, args: [amount] })] }); } - function peg$f787(unit, rest) { + function peg$f793(unit, rest) { const unitAliases = { 'ns': 'nanosecond', 'nanoseconds': 'nanosecond', 'us': 'microsecond', 'microseconds': 'microsecond', @@ -3829,15 +3859,15 @@ function peg$parse(input, options) { const unitLiteral = loc({ kind: 'literal', type: 'String', value: canonical }); return loc({ kind: 'functionCall', name: 'dateDiff', args: [unitLiteral, ...rest] }); } - function peg$f788(args) { + function peg$f794(args) { return loc({ kind: 'functionCall', name: 'dateDiff', args: args }); } - function peg$f789(str, pos, len) { + function peg$f795(str, pos, len) { const args = [str, pos]; if (len !== null) args.push(len[4]); return loc({ kind: 'functionCall', name: 'substring', args }); } - function peg$f790(unit, expr) { + function peg$f796(unit, expr) { const funcMap = { YEAR: 'toYear', MONTH: 'toMonth', DAY: 'toDayOfMonth', HOUR: 'toHour', MINUTE: 'toMinute', SECOND: 'toSecond', @@ -3851,7 +3881,7 @@ function peg$parse(input, options) { const funcName = funcMap[unit.toUpperCase()] || ('to' + unit.charAt(0).toUpperCase() + unit.slice(1).toLowerCase()); return loc({ kind: 'functionCall', name: funcName, args: [expr] }); } - function peg$f791(direction, chars, str) { + function peg$f797(direction, chars, str) { // ClickHouse simplifies TRIM with empty string to just the expression if (chars.kind === 'literal' && chars.type === 'String' && chars.value === '') { return str; @@ -3859,24 +3889,24 @@ function peg$parse(input, options) { const fname = direction === 'LEADING' ? 'trimLeft' : (direction === 'TRAILING' ? 'trimRight' : 'trimBoth'); return loc({ kind: 'functionCall', name: fname, args: [str, chars] }); } - function peg$f792(needle, haystack) { + function peg$f798(needle, haystack) { return loc({ kind: 'functionCall', name: 'position', args: [haystack, needle] }); } - function peg$f793(str) { + function peg$f799(str) { return loc({ kind: 'functionCall', name: 'toDate', args: [str] }); } - function peg$f794(str) { + function peg$f800(str) { return loc({ kind: 'functionCall', name: 'toDateTime', args: [str] }); } - function peg$f795(str) { + function peg$f801(str) { return loc({ kind: 'functionCall', name: 'toTime', args: [str] }); } - function peg$f796(expr, name) { return name; } - function peg$f797(expr, alias, type) { + function peg$f802(expr, name) { return name; } + function peg$f803(expr, alias, type) { const innerExpr = alias !== null ? loc({ kind: 'alias', expr, alias }) : expr; return loc({ kind: 'castExpr', expr: innerExpr, type: type }); } - function peg$f798(name, openComments, modifier, first, funcSettings, second, filter) { + function peg$f804(name, openComments, modifier, first, funcSettings, second, filter) { const modVal = modifier !== null ? modifier[0] : null; const modStr = Array.isArray(modVal) ? modVal[0] : modVal; const isDistinct = modStr !== null && modStr !== undefined && modStr.toString().toUpperCase() === 'DISTINCT'; @@ -3909,122 +3939,122 @@ function peg$parse(input, options) { } return call; } - function peg$f799(unit) { return unit; } - function peg$f800() { return 'LEADING'; } - function peg$f801() { return 'TRAILING'; } - function peg$f802() { return 'BOTH'; } - function peg$f803(expr) { return expr; } - function peg$f804(head, tail) { return head + tail.join(""); } - function peg$f805(head, tail) { return head + tail.join(""); } - function peg$f806(chars) { return chars.join(""); } - function peg$f807(chars) { return chars.join(""); } - function peg$f808(arg) { return arg; } - function peg$f809(head, tail) { + function peg$f805(unit) { return unit; } + function peg$f806() { return 'LEADING'; } + function peg$f807() { return 'TRAILING'; } + function peg$f808() { return 'BOTH'; } + function peg$f809(expr) { return expr; } + function peg$f810(head, tail) { return head + tail.join(""); } + function peg$f811(head, tail) { return head + tail.join(""); } + function peg$f812(chars) { return chars.join(""); } + function peg$f813(chars) { return chars.join(""); } + function peg$f814(arg) { return arg; } + function peg$f815(head, tail) { return buildCommaList(head, tail); } - function peg$f810(params, body) { + function peg$f816(params, body) { return loc({ kind: 'lambdaExpr', params: params, body: body }); } - function peg$f811(query) { + function peg$f817(query) { return loc({ kind: 'subqueryExpr', query: query }); } - function peg$f812(name) { return loc({ kind: 'columnRef', parts: [name] }); } - function peg$f813(head, tail) { + function peg$f818(name) { return loc({ kind: 'columnRef', parts: [name] }); } + function peg$f819(head, tail) { return [head, ...tail]; } - function peg$f814(name, rest) { + function peg$f820(name, rest) { return [name, ...rest]; } - function peg$f815(name) { + function peg$f821(name) { return [name]; } - function peg$f816(first, part) { return part; } - function peg$f817(first, rest, args) { + function peg$f822(first, part) { return part; } + function peg$f823(first, rest, args) { const name = [first, ...rest].join('.'); return loc({ kind: 'functionCall', name, args: args !== null ? args : [] }); } - function peg$f818(first, part) { return part; } - function peg$f819(first, rest) { + function peg$f824(first, part) { return part; } + function peg$f825(first, rest) { return loc({ kind: 'columnRef', parts: [first, ...rest] }); } - function peg$f820(name) { return loc({ kind: 'columnRef', parts: [name] }); } - function peg$f821(name) { return loc({ kind: 'columnRef', parts: [name] }); } - function peg$f822(name, brackets) { return "^" + name + (brackets !== null ? "[]" : ""); } - function peg$f823(name, brackets) { return name + (brackets !== null ? "[]" : ""); } - function peg$f824(first, part) { return part; } - function peg$f825(first, rest, transformers) { + function peg$f826(name) { return loc({ kind: 'columnRef', parts: [name] }); } + function peg$f827(name) { return loc({ kind: 'columnRef', parts: [name] }); } + function peg$f828(name, brackets) { return "^" + name + (brackets !== null ? "[]" : ""); } + function peg$f829(name, brackets) { return name + (brackets !== null ? "[]" : ""); } + function peg$f830(first, part) { return part; } + function peg$f831(first, rest, transformers) { const result = loc({ kind: 'qualifiedAsterisk', parts: [first, ...rest] }); if (transformers.length > 0) result.transformers = transformers.map((t) => t[1]); return result; } - function peg$f826(transformers) { + function peg$f832(transformers) { const result = loc({ kind: 'asterisk' }); if (transformers.length > 0) result.transformers = transformers.map((t) => t[1]); return result; } - function peg$f827(cols) { + function peg$f833(cols) { return { kind: 'except', columns: cols, strict: true }; } - function peg$f828(col) { + function peg$f834(col) { return { kind: 'except', columns: [col], strict: true }; } - function peg$f829(cols) { + function peg$f835(cols) { return { kind: 'except', columns: cols }; } - function peg$f830(str) { + function peg$f836(str) { return { kind: 'except', columns: [str.value], pattern: true }; } - function peg$f831(str) { + function peg$f837(str) { return { kind: 'except', columns: [str.value], pattern: true }; } - function peg$f832(col) { + function peg$f838(col) { return { kind: 'except', columns: [col] }; } - function peg$f833(head, tail) { + function peg$f839(head, tail) { return [head, ...tail.map((t) => t[3])]; } - function peg$f834(func) { + function peg$f840(func) { return { kind: 'apply', func: func }; } - function peg$f835(func) { + function peg$f841(func) { return { kind: 'apply', func: func }; } - function peg$f836(func) { + function peg$f842(func) { return { kind: 'apply', func: func }; } - function peg$f837(name) { + function peg$f843(name) { return { kind: 'apply', func: loc({ kind: 'columnRef', parts: [name] }) }; } - function peg$f838(items) { + function peg$f844(items) { return { kind: 'replace', items: items, strict: true }; } - function peg$f839(item) { + function peg$f845(item) { return { kind: 'replace', items: [item], strict: true }; } - function peg$f840(items) { + function peg$f846(items) { return { kind: 'replace', items: items }; } - function peg$f841(item) { + function peg$f847(item) { return { kind: 'replace', items: [item] }; } - function peg$f842(head, tail) { + function peg$f848(head, tail) { return [head, ...tail.map((t) => t[3])]; } - function peg$f843(expr, alias) { + function peg$f849(expr, alias) { return { expr, alias }; } - function peg$f844(first, part) { return part; } - function peg$f845(first, rest, args, transformers) { + function peg$f850(first, part) { return part; } + function peg$f851(first, rest, args, transformers) { const qualPath = [first, ...rest]; const result = loc({ kind: 'columnsExpr', args, qualifier: qualPath.join('.') }); if (transformers.length > 0) result.transformers = transformers.map((t) => t[1]); return result; } - function peg$f846(args, head, rest) { + function peg$f852(args, head, rest) { const transformers = [head, ...rest.map((t) => t[1])]; return loc({ kind: 'columnsExpr', args, transformers }); } - function peg$f847(digits) { + function peg$f853(digits) { const normalized = digits.replace(/_/g, '').replace(/^0+/, '') || '0'; const UINT64_MAX = BigInt('18446744073709551615'); if (normalized.length > 20 || (normalized.length >= 20 && BigInt(normalized) > UINT64_MAX)) { @@ -4033,10 +4063,10 @@ function peg$parse(input, options) { } return loc({ kind: 'literal', type: 'UInt64', value: normalized }); } - function peg$f848(chars) { + function peg$f854(chars) { return loc({ kind: 'literal', type: 'String', value: chars.join('') }); } - function peg$f849(chars) { + function peg$f855(chars) { // Collect consecutive hex byte objects and decode as UTF-8 const parts = []; let hexBuf = []; @@ -4056,64 +4086,64 @@ function peg$parse(input, options) { } return loc({ kind: 'literal', type: 'String', value: parts.join('') }); } - function peg$f850() { return "'"; } - function peg$f851() { return '\x07'; } - function peg$f852() { return '\x1b'; } - function peg$f853() { return '\x0b'; } - function peg$f854() { return '\\\\'; } - function peg$f855() { return '\\b'; } - function peg$f856() { return '\\f'; } - function peg$f857() { return '\\n'; } - function peg$f858() { return '\\r'; } - function peg$f859() { return '\\t'; } - function peg$f860() { return '\\0'; } - function peg$f861() { return "'"; } - function peg$f862() { return '"'; } - function peg$f863(hi, lo) { + function peg$f856() { return "'"; } + function peg$f857() { return '\x07'; } + function peg$f858() { return '\x1b'; } + function peg$f859() { return '\x0b'; } + function peg$f860() { return '\\\\'; } + function peg$f861() { return '\\b'; } + function peg$f862() { return '\\f'; } + function peg$f863() { return '\\n'; } + function peg$f864() { return '\\r'; } + function peg$f865() { return '\\t'; } + function peg$f866() { return '\\0'; } + function peg$f867() { return "'"; } + function peg$f868() { return '"'; } + function peg$f869(hi, lo) { return { hexByte: parseInt(hi + lo, 16) }; } - function peg$f864(c) { return '\\\\' + c; } - function peg$f865(c) { return '\\\\' + c; } - function peg$f866() { return text(); } - function peg$f867() { return '\\\\'; } - function peg$f868() { return '\\\\'; } - function peg$f869(c) { return c; } - function peg$f870(name) { + function peg$f870(c) { return '\\\\' + c; } + function peg$f871(c) { return '\\\\' + c; } + function peg$f872() { return text(); } + function peg$f873() { return '\\\\'; } + function peg$f874() { return '\\\\'; } + function peg$f875(c) { return c; } + function peg$f876(name) { return loc({ kind: 'queryParam', name: name, type: 'Identifier' }); } - function peg$f871(db, table) { + function peg$f877(db, table) { return loc({ kind: 'tableRef', database: db, table: table }); } - function peg$f872(table) { + function peg$f878(table) { return loc({ kind: 'tableRef', table: table }); } - function peg$f873(word) { return !KEYWORDS.has(word.toUpperCase()); } - function peg$f874(word) { return word; } - function peg$f875(chars) { return chars.join(""); } - function peg$f876(chars) { return chars.join(""); } - function peg$f877(chars) { return chars; } - function peg$f878(word) { return word; } - function peg$f879(chars) { return chars.join(""); } - function peg$f880(chars) { return chars.join(""); } - function peg$f881(chars) { return chars; } - function peg$f882(head, tail) { return head + tail.join(""); } - function peg$f883(head, tail) { return head + tail.join(""); } - function peg$f884(chars) { return chars.join(""); } + function peg$f879(word) { return !KEYWORDS.has(word.toUpperCase()); } + function peg$f880(word) { return word; } + function peg$f881(chars) { return chars.join(""); } + function peg$f882(chars) { return chars.join(""); } + function peg$f883(chars) { return chars; } + function peg$f884(word) { return word; } function peg$f885(chars) { return chars.join(""); } - function peg$f886(chars) { return chars; } - function peg$f887() { return '"'; } - function peg$f888() { return '"'; } - function peg$f889() { return '\\'; } - function peg$f890(c) { return '\\' + c; } - function peg$f891() { return text(); } - function peg$f892() { return '`'; } - function peg$f893(hex) { return Buffer.from([parseInt(hex, 16)]).toString('utf8'); } - function peg$f894() { return '\0'; } - function peg$f895(char) { return char; } - function peg$f896() { return text(); } - function peg$f897(s) { return s; } - function peg$f898(s) { return s; } - function peg$f899(trailing, newlineContent) { + function peg$f886(chars) { return chars.join(""); } + function peg$f887(chars) { return chars; } + function peg$f888(head, tail) { return head + tail.join(""); } + function peg$f889(head, tail) { return head + tail.join(""); } + function peg$f890(chars) { return chars.join(""); } + function peg$f891(chars) { return chars.join(""); } + function peg$f892(chars) { return chars; } + function peg$f893() { return '"'; } + function peg$f894() { return '"'; } + function peg$f895() { return '\\'; } + function peg$f896(c) { return '\\' + c; } + function peg$f897() { return text(); } + function peg$f898() { return '`'; } + function peg$f899(hex) { return Buffer.from([parseInt(hex, 16)]).toString('utf8'); } + function peg$f900() { return '\0'; } + function peg$f901(char) { return char; } + function peg$f902() { return text(); } + function peg$f903(s) { return s; } + function peg$f904(s) { return s; } + function peg$f905(trailing, newlineContent) { const leading = []; for (const nc of newlineContent) { for (const item of nc) { @@ -4122,17 +4152,17 @@ function peg$parse(input, options) { } return { trailing, leading }; } - function peg$f900() { return null; } - function peg$f901(items) { + function peg$f906() { return null; } + function peg$f907(items) { return items.filter((item) => item !== null); } - function peg$f902() { return null; } - function peg$f903(items) { + function peg$f908() { return null; } + function peg$f909(items) { return items; } - function peg$f904() { return text(); } - function peg$f905() { return text(); } - function peg$f906() { return text(); } + function peg$f910() { return text(); } + function peg$f911() { return text(); } + function peg$f912() { return text(); } let peg$currPos = options.peg$currPos | 0; let peg$savedPos = peg$currPos; const peg$posDetailsCache = [{ line: 1, column: 1 }]; @@ -62496,7 +62526,7 @@ function peg$parse(input, options) { s3 = null; } peg$savedPos = s0; - s0 = peg$f530(); + s0 = peg$f530(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -62564,7 +62594,7 @@ function peg$parse(input, options) { s3 = null; } peg$savedPos = s0; - s0 = peg$f531(); + s0 = peg$f531(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -66304,7 +66334,7 @@ function peg$parse(input, options) { s4 = peg$parseKW_CROSS(); if (s4 !== peg$FAILED) { peg$savedPos = s3; - s4 = peg$f580(); + s4 = peg$f580(s1, s2); } s3 = s4; if (s3 === peg$FAILED) { @@ -66312,7 +66342,7 @@ function peg$parse(input, options) { s4 = peg$parseKW_FULL(); if (s4 !== peg$FAILED) { peg$savedPos = s3; - s4 = peg$f581(); + s4 = peg$f581(s1, s2); } s3 = s4; if (s3 === peg$FAILED) { @@ -66320,7 +66350,7 @@ function peg$parse(input, options) { s4 = peg$parseKW_LEFT(); if (s4 !== peg$FAILED) { peg$savedPos = s3; - s4 = peg$f582(); + s4 = peg$f582(s1, s2); } s3 = s4; if (s3 === peg$FAILED) { @@ -66328,7 +66358,7 @@ function peg$parse(input, options) { s4 = peg$parseKW_RIGHT(); if (s4 !== peg$FAILED) { peg$savedPos = s3; - s4 = peg$f583(); + s4 = peg$f583(s1, s2); } s3 = s4; if (s3 === peg$FAILED) { @@ -66336,7 +66366,7 @@ function peg$parse(input, options) { s4 = peg$parseKW_INNER(); if (s4 !== peg$FAILED) { peg$savedPos = s3; - s4 = peg$f584(); + s4 = peg$f584(s1, s2); } s3 = s4; } @@ -66376,7 +66406,7 @@ function peg$parse(input, options) { s7 = peg$parseKW_JOIN(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f585(s3); + s0 = peg$f585(s1, s2, s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -66389,7 +66419,7 @@ function peg$parse(input, options) { } function peg$parseJoinStrictness() { - let s0; + let s0, s1; const key = peg$currPos * 508 + 323; const cached = peg$resultsCache[key]; @@ -66400,15 +66430,45 @@ function peg$parse(input, options) { return cached.result; } - s0 = peg$parseKW_ANY(); + s0 = peg$currPos; + s1 = peg$parseKW_ANY(); + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f586(); + } + s0 = s1; if (s0 === peg$FAILED) { - s0 = peg$parseKW_ALL(); + s0 = peg$currPos; + s1 = peg$parseKW_ALL(); + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f587(); + } + s0 = s1; if (s0 === peg$FAILED) { - s0 = peg$parseKW_SEMI(); + s0 = peg$currPos; + s1 = peg$parseKW_SEMI(); + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f588(); + } + s0 = s1; if (s0 === peg$FAILED) { - s0 = peg$parseKW_ANTI(); + s0 = peg$currPos; + s1 = peg$parseKW_ANTI(); + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f589(); + } + s0 = s1; if (s0 === peg$FAILED) { - s0 = peg$parseKW_ASOF(); + s0 = peg$currPos; + s1 = peg$parseKW_ASOF(); + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f590(); + } + s0 = s1; } } } @@ -66441,7 +66501,7 @@ function peg$parse(input, options) { s5 = peg$parseKW_JOIN(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f586(); + s0 = peg$f591(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -66462,7 +66522,7 @@ function peg$parse(input, options) { s3 = peg$parseKW_JOIN(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f587(); + s0 = peg$f592(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -66497,7 +66557,7 @@ function peg$parse(input, options) { s3 = peg$parseExpression(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f588(s2, s3); + s0 = peg$f593(s2, s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -66534,7 +66594,7 @@ function peg$parse(input, options) { } if (s7 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f589(s5); + s0 = peg$f594(s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -66561,7 +66621,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f590(); + s0 = peg$f595(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -66578,7 +66638,7 @@ function peg$parse(input, options) { s3 = peg$parseIdentifierList(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f591(s3); + s0 = peg$f596(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -66662,7 +66722,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f592(s1, s2); + s0 = peg$f597(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -66695,7 +66755,7 @@ function peg$parse(input, options) { s5 = peg$parseAliasName(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f593(s1, s5); + s0 = peg$f598(s1, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -66713,7 +66773,7 @@ function peg$parse(input, options) { s1 = peg$parseIdentifier(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f594(s1); + s1 = peg$f599(s1); } s0 = s1; } @@ -66789,7 +66849,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f595(s1, s2); + s0 = peg$f600(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -66819,7 +66879,7 @@ function peg$parse(input, options) { s3 = peg$parseExpression(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f596(s2, s3); + s0 = peg$f601(s2, s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -66853,7 +66913,7 @@ function peg$parse(input, options) { s3 = peg$parseExpression(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f597(s2, s3); + s0 = peg$f602(s2, s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -66896,7 +66956,7 @@ function peg$parse(input, options) { s7 = peg$parseGroupByModifier(); } peg$savedPos = s0; - s0 = peg$f598(s6); + s0 = peg$f603(s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -66996,7 +67056,7 @@ function peg$parse(input, options) { s17 = peg$parseGroupByModifier(); } peg$savedPos = s0; - s0 = peg$f599(s13, s16); + s0 = peg$f604(s13, s16); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67050,7 +67110,7 @@ function peg$parse(input, options) { s7 = peg$parseGroupByModifier(); } peg$savedPos = s0; - s0 = peg$f600(s4, s5, s6); + s0 = peg$f605(s4, s5, s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67137,7 +67197,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f601(s1, s2); + s0 = peg$f606(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67182,7 +67242,7 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f602(s3); + s0 = peg$f607(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67215,7 +67275,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f603(); + s0 = peg$f608(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67229,7 +67289,7 @@ function peg$parse(input, options) { s1 = peg$parseTernaryExpr(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f604(s1); + s1 = peg$f609(s1); } s0 = s1; } @@ -67260,7 +67320,7 @@ function peg$parse(input, options) { s4 = peg$parseKW_TOTALS(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f605(); + s0 = peg$f610(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67301,7 +67361,7 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f606(); + s0 = peg$f611(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67346,7 +67406,7 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f607(); + s0 = peg$f612(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67386,7 +67446,7 @@ function peg$parse(input, options) { s3 = peg$parseKW_TOTALS(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f608(); + s0 = peg$f613(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67426,7 +67486,7 @@ function peg$parse(input, options) { } if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f609(); + s0 = peg$f614(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67470,7 +67530,7 @@ function peg$parse(input, options) { } if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f610(); + s0 = peg$f615(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67510,7 +67570,7 @@ function peg$parse(input, options) { s3 = peg$parseExpression(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f611(s2, s3); + s0 = peg$f616(s2, s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67567,7 +67627,7 @@ function peg$parse(input, options) { s4 = peg$parseExpression(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f612(s3, s4); + s0 = peg$f617(s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67608,7 +67668,7 @@ function peg$parse(input, options) { s5 = peg$parseOrderByItemList(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f613(s5); + s0 = peg$f618(s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67652,7 +67712,7 @@ function peg$parse(input, options) { s7 = peg$parseKW_ALL(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f614(s3); + s0 = peg$f619(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67695,7 +67755,7 @@ function peg$parse(input, options) { s11 = peg$parseKW_ALL(); if (s11 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f615(s3, s7); + s0 = peg$f620(s3, s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67740,7 +67800,7 @@ function peg$parse(input, options) { s11 = peg$parseKW_ALL(); if (s11 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f616(s3, s7); + s0 = peg$f621(s3, s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67791,7 +67851,7 @@ function peg$parse(input, options) { s11 = peg$parseExpressionList(); if (s11 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f617(s3, s7, s11); + s0 = peg$f622(s3, s7, s11); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67836,7 +67896,7 @@ function peg$parse(input, options) { s11 = peg$parseExpressionList(); if (s11 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f618(s3, s7, s11); + s0 = peg$f623(s3, s7, s11); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67875,7 +67935,7 @@ function peg$parse(input, options) { s7 = peg$parseExpressionList(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f619(s3, s7); + s0 = peg$f624(s3, s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -67963,7 +68023,7 @@ function peg$parse(input, options) { } if (s12 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f620(s3, s7); + s0 = peg$f625(s3, s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -68012,7 +68072,7 @@ function peg$parse(input, options) { s7 = peg$parseTernaryExpr(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f621(s3, s7); + s0 = peg$f626(s3, s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -68066,7 +68126,7 @@ function peg$parse(input, options) { } if (s8 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f622(s3); + s0 = peg$f627(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -68095,7 +68155,7 @@ function peg$parse(input, options) { s3 = peg$parseTernaryExpr(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f623(s3); + s0 = peg$f628(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -68181,7 +68241,7 @@ function peg$parse(input, options) { s4 = null; } peg$savedPos = s0; - s0 = peg$f624(s3); + s0 = peg$f629(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -68358,7 +68418,7 @@ function peg$parse(input, options) { } if (s13 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f625(s7, s12); + s0 = peg$f630(s7, s12); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -68420,7 +68480,7 @@ function peg$parse(input, options) { s3 = peg$parseSettingsList(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f626(s3); + s0 = peg$f631(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -68454,7 +68514,7 @@ function peg$parse(input, options) { s3 = peg$parseWindowItemList(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f627(s3); + s0 = peg$f632(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -68535,7 +68595,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f628(s1, s2); + s0 = peg$f633(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -68588,7 +68648,7 @@ function peg$parse(input, options) { } if (s11 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f629(s1, s7, s9); + s0 = peg$f634(s1, s7, s9); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -68637,7 +68697,7 @@ function peg$parse(input, options) { } if (s9 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f630(s1, s7); + s0 = peg$f635(s1, s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -68727,7 +68787,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f631(s1, s2); + s0 = peg$f636(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -68778,7 +68838,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f632(s1, s2); + s0 = peg$f637(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -68808,7 +68868,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f633(s2); + s0 = peg$f638(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -68842,7 +68902,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f634(s2); + s0 = peg$f639(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -68934,7 +68994,7 @@ function peg$parse(input, options) { s6 = null; } peg$savedPos = s0; - s0 = peg$f635(s1, s5, s6); + s0 = peg$f640(s1, s5, s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -68952,7 +69012,7 @@ function peg$parse(input, options) { s1 = peg$parseSettingName(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f636(s1); + s1 = peg$f641(s1); } s0 = s1; } @@ -69028,7 +69088,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f637(s1, s2); + s0 = peg$f642(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -69296,7 +69356,7 @@ function peg$parse(input, options) { s6 = null; } peg$savedPos = s0; - s0 = peg$f638(s1, s2, s3, s4, s5, s6); + s0 = peg$f643(s1, s2, s3, s4, s5, s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -69582,7 +69642,7 @@ function peg$parse(input, options) { s5 = null; } peg$savedPos = s0; - s0 = peg$f639(s1, s2, s3, s4, s5); + s0 = peg$f644(s1, s2, s3, s4, s5); peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; @@ -69655,7 +69715,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f640(s1, s2); + s0 = peg$f645(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -69664,7 +69724,7 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parse_(); peg$savedPos = s0; - s1 = peg$f641(); + s1 = peg$f646(); s0 = s1; } @@ -69695,7 +69755,7 @@ function peg$parse(input, options) { s5 = peg$parseExpression(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f642(s1, s5); + s0 = peg$f647(s1, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -69713,7 +69773,7 @@ function peg$parse(input, options) { s1 = peg$parseIdentifier(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f643(s1); + s1 = peg$f648(s1); } s0 = s1; } @@ -69789,7 +69849,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f644(s1, s2); + s0 = peg$f649(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -69822,7 +69882,7 @@ function peg$parse(input, options) { s5 = peg$parseAliasName(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f645(s1, s2, s5); + s0 = peg$f650(s1, s2, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -69866,7 +69926,7 @@ function peg$parse(input, options) { s5 = peg$parseAliasName(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f646(s1, s2, s5); + s0 = peg$f651(s1, s2, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -69989,7 +70049,7 @@ function peg$parse(input, options) { } if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f647(s1, s2, s3); + s0 = peg$f652(s1, s2, s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -70052,7 +70112,7 @@ function peg$parse(input, options) { s9 = peg$parseTernaryExpr(); if (s9 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f648(s1, s2, s4, s5, s6, s8, s9); + s0 = peg$f653(s1, s2, s4, s5, s6, s8, s9); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -70141,7 +70201,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f649(s1, s2); + s0 = peg$f654(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -70218,7 +70278,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f650(s1, s2); + s0 = peg$f655(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -70281,7 +70341,7 @@ function peg$parse(input, options) { s4 = peg$parseNotExpr(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f651(s3, s4); + s0 = peg$f656(s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -70357,7 +70417,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f652(s1, s2); + s0 = peg$f657(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -70390,7 +70450,7 @@ function peg$parse(input, options) { s3 = peg$parseCompareBaseSuffix(); } peg$savedPos = s0; - s0 = peg$f653(s1, s2); + s0 = peg$f658(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -70447,7 +70507,7 @@ function peg$parse(input, options) { s6 = peg$parseInTarget(); if (s6 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f654(s2, s3, s6); + s0 = peg$f659(s2, s3, s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -70478,7 +70538,7 @@ function peg$parse(input, options) { s5 = peg$parseAddExpr(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f655(s2, s5); + s0 = peg$f660(s2, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -70509,7 +70569,7 @@ function peg$parse(input, options) { s5 = peg$parseAddExpr(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f656(s2, s5); + s0 = peg$f661(s2, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -70550,7 +70610,7 @@ function peg$parse(input, options) { s5 = peg$parseAddExpr(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f657(s5); + s0 = peg$f662(s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -70581,7 +70641,7 @@ function peg$parse(input, options) { s10 = peg$parseAddExpr(); if (s10 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f658(s6, s10); + s0 = peg$f663(s6, s10); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -70617,7 +70677,7 @@ function peg$parse(input, options) { s8 = peg$parseAddExpr(); if (s8 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f659(s4, s8); + s0 = peg$f664(s4, s8); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -70649,7 +70709,7 @@ function peg$parse(input, options) { s4 = peg$parseClickHouseType(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f660(s4); + s0 = peg$f665(s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -70777,7 +70837,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f661(s10); + s0 = peg$f666(s10); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -70895,7 +70955,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f662(s7); + s0 = peg$f667(s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -71043,7 +71103,7 @@ function peg$parse(input, options) { } if (s11 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f663(); + s0 = peg$f668(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -71156,7 +71216,7 @@ function peg$parse(input, options) { } if (s8 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f664(); + s0 = peg$f669(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -71186,7 +71246,7 @@ function peg$parse(input, options) { s1 = peg$parseCompareOp(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f665(s1); + s1 = peg$f670(s1); } s0 = s1; } @@ -71213,7 +71273,7 @@ function peg$parse(input, options) { s1 = peg$parseArrayLiteral(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f666(s1); + s1 = peg$f671(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -71239,7 +71299,7 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f667(s2, s3, s4); + s0 = peg$f672(s2, s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -71257,7 +71317,7 @@ function peg$parse(input, options) { s1 = peg$parsePrimaryExpr(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f668(s1); + s1 = peg$f673(s1); } s0 = s1; } @@ -71366,7 +71426,7 @@ function peg$parse(input, options) { s3 = peg$parseCompareRightExpr(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f669(s3); + s0 = peg$f674(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -71386,7 +71446,7 @@ function peg$parse(input, options) { s3 = peg$parseCompareBaseSuffix(); } peg$savedPos = s0; - s0 = peg$f670(s1, s2); + s0 = peg$f675(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -71414,7 +71474,7 @@ function peg$parse(input, options) { s1 = peg$parseUnionQuery(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f671(s1); + s1 = peg$f676(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -71480,7 +71540,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f672(s1, s2); + s0 = peg$f677(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -71510,7 +71570,7 @@ function peg$parse(input, options) { s3 = peg$parseNotPrefixExpr(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f673(s3); + s0 = peg$f678(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -71575,7 +71635,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f674(); + s0 = peg$f679(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -71595,7 +71655,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f675(); + s1 = peg$f680(); } s0 = s1; } @@ -71672,7 +71732,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f676(s1, s2); + s0 = peg$f681(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -71737,7 +71797,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f677(s1, s2); + s0 = peg$f682(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -71795,7 +71855,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f678(); + s0 = peg$f683(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -71832,7 +71892,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f679(); + s0 = peg$f684(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -71874,7 +71934,7 @@ function peg$parse(input, options) { s3 = peg$parseUnaryExpr(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f680(s3); + s0 = peg$f685(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -71897,7 +71957,7 @@ function peg$parse(input, options) { s3 = peg$parseUnaryExpr(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f681(s3); + s0 = peg$f686(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -71946,7 +72006,7 @@ function peg$parse(input, options) { s4 = null; } peg$savedPos = s0; - s0 = peg$f682(s1, s2, s4); + s0 = peg$f687(s1, s2, s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -72031,8 +72091,8 @@ function peg$parse(input, options) { s6 = peg$FAILED; } if (s6 !== peg$FAILED) { - s1 = [s1, s2, s3, s4, s5, s6]; - s0 = s1; + peg$savedPos = s0; + s0 = peg$f688(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -72118,7 +72178,7 @@ function peg$parse(input, options) { } if (s11 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f683(s9); + s0 = peg$f689(s7, s9); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -72188,7 +72248,7 @@ function peg$parse(input, options) { } if (s9 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f684(s7); + s0 = peg$f690(s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -72237,7 +72297,7 @@ function peg$parse(input, options) { s5 = peg$parseIdentifier(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f685(); + s0 = peg$f691(s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -72327,7 +72387,7 @@ function peg$parse(input, options) { s8 = peg$parseExpressionList(); if (s8 !== peg$FAILED) { peg$savedPos = s1; - s1 = peg$f686(s8); + s1 = peg$f692(s8); } else { peg$currPos = s1; s1 = peg$FAILED; @@ -72408,7 +72468,7 @@ function peg$parse(input, options) { s10 = peg$parseOrderByItemList(); if (s10 !== peg$FAILED) { peg$savedPos = s3; - s3 = peg$f687(s1, s10); + s3 = peg$f693(s1, s10); } else { peg$currPos = s3; s3 = peg$FAILED; @@ -72438,7 +72498,7 @@ function peg$parse(input, options) { s5 = null; } peg$savedPos = s0; - s0 = peg$f688(s1, s3, s5); + s0 = peg$f694(s1, s3, s5); peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; @@ -72519,7 +72579,7 @@ function peg$parse(input, options) { s11 = peg$parseWindowFrameBound(); if (s11 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f689(s1, s6, s11); + s0 = peg$f695(s1, s6, s11); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -72556,7 +72616,7 @@ function peg$parse(input, options) { s3 = peg$parseWindowFrameBound(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f690(s1, s3); + s0 = peg$f696(s1, s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -72629,7 +72689,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f691(); + s0 = peg$f697(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -72709,7 +72769,7 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f692(); + s0 = peg$f698(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -72780,7 +72840,7 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f693(); + s0 = peg$f699(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -72851,7 +72911,7 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f694(); + s0 = peg$f700(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -72899,7 +72959,7 @@ function peg$parse(input, options) { } if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f695(s1); + s0 = peg$f701(s1); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -72943,7 +73003,7 @@ function peg$parse(input, options) { } if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f696(s1); + s0 = peg$f702(s1); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -72992,7 +73052,7 @@ function peg$parse(input, options) { s4 = peg$parseClickHouseType(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f697(s4); + s0 = peg$f703(s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -73034,7 +73094,7 @@ function peg$parse(input, options) { s7 = peg$parseIdentifier(); if (s7 !== peg$FAILED) { peg$savedPos = s5; - s5 = peg$f698(s3, s7); + s5 = peg$f704(s3, s7); } else { peg$currPos = s5; s5 = peg$FAILED; @@ -73057,7 +73117,7 @@ function peg$parse(input, options) { s7 = peg$parseIdentifier(); if (s7 !== peg$FAILED) { peg$savedPos = s5; - s5 = peg$f698(s3, s7); + s5 = peg$f704(s3, s7); } else { peg$currPos = s5; s5 = peg$FAILED; @@ -73068,7 +73128,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f699(s3, s4); + s0 = peg$f705(s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -73105,7 +73165,7 @@ function peg$parse(input, options) { } if (s6 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f700(s4); + s0 = peg$f706(s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -73160,7 +73220,7 @@ function peg$parse(input, options) { } if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f701(s4); + s0 = peg$f707(s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -73219,7 +73279,7 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f702(s5); + s0 = peg$f708(s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -73264,7 +73324,7 @@ function peg$parse(input, options) { s5 = peg$parseAliasName(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f703(s5); + s0 = peg$f709(s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -73322,7 +73382,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f704(s5); + s0 = peg$f710(s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -73379,7 +73439,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f705(s2); + s0 = peg$f711(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -73413,7 +73473,7 @@ function peg$parse(input, options) { s1 = peg$parseMultiWordTypeInner(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f706(); + s1 = peg$f712(); } s0 = s1; @@ -74243,7 +74303,7 @@ function peg$parse(input, options) { s2 = null; } peg$savedPos = s0; - s0 = peg$f707(s1, s2); + s0 = peg$f713(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -74296,7 +74356,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f708(s2); + s0 = peg$f714(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -74357,7 +74417,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f709(s2); + s0 = peg$f715(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -74455,7 +74515,7 @@ function peg$parse(input, options) { } if (s7 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f710(s1, s5); + s0 = peg$f716(s1, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -74536,7 +74596,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f711(s1); + s1 = peg$f717(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -74668,7 +74728,7 @@ function peg$parse(input, options) { s3 = null; } peg$savedPos = s0; - s0 = peg$f712(s1, s2, s3); + s0 = peg$f718(s1, s2, s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -74750,7 +74810,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f713(s1, s2); + s0 = peg$f719(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -74835,7 +74895,7 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f714(s1, s5); + s0 = peg$f720(s1, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -74876,7 +74936,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f715(); + s0 = peg$f721(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -74890,7 +74950,7 @@ function peg$parse(input, options) { s1 = peg$parseStringLiteral(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f716(s1); + s1 = peg$f722(s1); } s0 = s1; } @@ -74986,7 +75046,7 @@ function peg$parse(input, options) { s3 = null; } peg$savedPos = s0; - s0 = peg$f717(s1, s2, s3); + s0 = peg$f723(s1, s2, s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -75115,7 +75175,7 @@ function peg$parse(input, options) { } if (s7 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f718(s7); + s0 = peg$f724(s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -75167,7 +75227,7 @@ function peg$parse(input, options) { s4 = peg$parseTypeArgFieldName(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f719(s4); + s0 = peg$f725(s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -75205,7 +75265,7 @@ function peg$parse(input, options) { s4 = peg$parseColumnDataType(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f720(s1, s4); + s0 = peg$f726(s1, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -75273,7 +75333,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f721(s1); + s1 = peg$f727(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -75362,7 +75422,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f722(s1); + s1 = peg$f728(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -75420,7 +75480,7 @@ function peg$parse(input, options) { s5 = peg$parseTernaryExpr(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f723(s1, s5); + s0 = peg$f729(s1, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -75438,7 +75498,7 @@ function peg$parse(input, options) { s1 = peg$parseColumnDataType(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f724(s1); + s1 = peg$f730(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -75473,7 +75533,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f725(s1); + s1 = peg$f731(s1); } s0 = s1; } @@ -75559,7 +75619,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f726(s1); + s1 = peg$f732(s1); } s0 = s1; @@ -75747,7 +75807,7 @@ function peg$parse(input, options) { s1 = peg$parseMultiWordType(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f727(s1); + s1 = peg$f733(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -75798,7 +75858,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f728(s2); + s0 = peg$f734(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -75859,7 +75919,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f729(s2); + s0 = peg$f735(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -75920,7 +75980,7 @@ function peg$parse(input, options) { s3 = null; } peg$savedPos = s0; - s0 = peg$f730(s1, s3); + s0 = peg$f736(s1, s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -75970,7 +76030,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f731(s2); + s0 = peg$f737(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -76001,7 +76061,7 @@ function peg$parse(input, options) { s1 = peg$parseClickHouseTypeArgs(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f732(s1); + s1 = peg$f738(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -76059,7 +76119,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f733(s1); + s1 = peg$f739(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -76094,7 +76154,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f734(s1); + s1 = peg$f740(s1); } s0 = s1; } @@ -76126,7 +76186,7 @@ function peg$parse(input, options) { s3 = peg$parseTupleLiteral(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f735(s3); + s0 = peg$f741(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -76161,7 +76221,7 @@ function peg$parse(input, options) { } if (s7 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f736(s5); + s0 = peg$f742(s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -76203,7 +76263,7 @@ function peg$parse(input, options) { s7 = peg$parseColumnRefCont(); if (s7 !== peg$FAILED) { peg$savedPos = s3; - s3 = peg$f737(s1, s7); + s3 = peg$f743(s1, s7); } else { peg$currPos = s3; s3 = peg$FAILED; @@ -76229,7 +76289,7 @@ function peg$parse(input, options) { s7 = peg$parseColumnRefCont(); if (s7 !== peg$FAILED) { peg$savedPos = s3; - s3 = peg$f737(s1, s7); + s3 = peg$f743(s1, s7); } else { peg$currPos = s3; s3 = peg$FAILED; @@ -76244,7 +76304,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f738(s1, s2); + s0 = peg$f744(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -76318,7 +76378,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f739(s1); + s0 = peg$f745(s1); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -76334,7 +76394,7 @@ function peg$parse(input, options) { s1 = peg$parseAliasName(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f740(s1); + s1 = peg$f746(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -76403,7 +76463,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f741(); + s0 = peg$f747(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -76485,7 +76545,7 @@ function peg$parse(input, options) { } if (s6 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f742(s3, s4); + s0 = peg$f748(s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -76533,7 +76593,7 @@ function peg$parse(input, options) { s5 = peg$parseTernaryExpr(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f743(s1, s5); + s0 = peg$f749(s1, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -76631,7 +76691,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f744(s3); + s0 = peg$f750(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -76689,7 +76749,7 @@ function peg$parse(input, options) { s7 = peg$parseExpression(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f745(s7); + s0 = peg$f751(s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -76726,7 +76786,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f746(); + s0 = peg$f752(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -76810,7 +76870,7 @@ function peg$parse(input, options) { } if (s6 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f747(s2, s4, s5); + s0 = peg$f753(s2, s4, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -76912,7 +76972,7 @@ function peg$parse(input, options) { s10 = peg$parseExpression(); if (s10 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f748(s3, s4, s10); + s0 = peg$f754(s3, s4, s10); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -77025,7 +77085,7 @@ function peg$parse(input, options) { } if (s7 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f749(s2, s3, s4, s5, s6); + s0 = peg$f755(s2, s3, s4, s5, s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -77091,7 +77151,7 @@ function peg$parse(input, options) { } if (s7 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f750(s3); + s0 = peg$f756(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -77154,7 +77214,7 @@ function peg$parse(input, options) { } if (s11 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f751(s3, s7); + s0 = peg$f757(s3, s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -77213,7 +77273,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f752(); + s0 = peg$f758(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -77245,7 +77305,7 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f753(s2, s3, s4); + s0 = peg$f759(s2, s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -77419,7 +77479,7 @@ function peg$parse(input, options) { } if (s8 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f754(s3, s7); + s0 = peg$f760(s3, s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -77496,7 +77556,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f755(s2); + s0 = peg$f761(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -77550,7 +77610,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f756(); + s0 = peg$f762(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -77587,7 +77647,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f757(); + s0 = peg$f763(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -77642,7 +77702,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f758(); + s0 = peg$f764(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -77715,7 +77775,7 @@ function peg$parse(input, options) { } if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f759(s3); + s0 = peg$f765(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -77792,7 +77852,7 @@ function peg$parse(input, options) { } if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f760(s3); + s0 = peg$f766(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -78110,7 +78170,7 @@ function peg$parse(input, options) { } if (s6 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f761(s2, s4, s5); + s0 = peg$f767(s2, s4, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -78284,7 +78344,7 @@ function peg$parse(input, options) { } if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f762(s2, s3); + s0 = peg$f768(s2, s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -78463,7 +78523,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f763(s2, s3); + s0 = peg$f769(s2, s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -78642,7 +78702,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f764(s2); + s0 = peg$f770(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -78700,7 +78760,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f765(); + s0 = peg$f771(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -78737,7 +78797,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f766(); + s0 = peg$f772(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -79026,7 +79086,7 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f767(s1, s3, s4); + s0 = peg$f773(s1, s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -79196,7 +79256,7 @@ function peg$parse(input, options) { } if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f768(s2, s3); + s0 = peg$f774(s2, s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -79356,7 +79416,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f769(s1, s2); + s0 = peg$f775(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -79538,7 +79598,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f770(s1, s2, s3); + s0 = peg$f776(s1, s2, s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -79581,7 +79641,7 @@ function peg$parse(input, options) { s5 = peg$parseExpression(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f771(s1, s5); + s0 = peg$f777(s1, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -79724,7 +79784,7 @@ function peg$parse(input, options) { } if (s8 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f772(s4, s5); + s0 = peg$f778(s4, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -79861,7 +79921,7 @@ function peg$parse(input, options) { } if (s10 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f773(s4, s6, s7); + s0 = peg$f779(s4, s6, s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -79965,7 +80025,7 @@ function peg$parse(input, options) { s10 = peg$parseExpression(); if (s10 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f774(s5, s10); + s0 = peg$f780(s5, s10); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -80041,7 +80101,7 @@ function peg$parse(input, options) { s6 = peg$parseIntervalUnit(); if (s6 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f775(s4, s6); + s0 = peg$f781(s4, s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -80089,7 +80149,7 @@ function peg$parse(input, options) { s4 = peg$parseStringLiteral(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f776(s4); + s0 = peg$f782(s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -80163,7 +80223,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = peg$currPos; - s2 = peg$f777(s1); + s2 = peg$f783(s1); if (s2) { s2 = undefined; } else { @@ -80171,7 +80231,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f778(s1); + s0 = peg$f784(s1); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -80235,7 +80295,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f779(); + s1 = peg$f785(); } s0 = s1; @@ -80293,7 +80353,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f780(); + s1 = peg$f786(); } s0 = s1; @@ -80342,7 +80402,7 @@ function peg$parse(input, options) { s9 = peg$parseExpressionWithImplicitAlias(); if (s9 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f781(s1, s5, s9); + s0 = peg$f787(s1, s5, s9); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -80380,7 +80440,7 @@ function peg$parse(input, options) { s5 = peg$parseIntervalExpr(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f782(s1, s5); + s0 = peg$f788(s1, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -80410,7 +80470,7 @@ function peg$parse(input, options) { s5 = peg$parseExpressionWithImplicitAlias(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f783(s1, s5); + s0 = peg$f789(s1, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -80468,7 +80528,7 @@ function peg$parse(input, options) { } if (s7 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f784(s1, s5); + s0 = peg$f790(s1, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -80511,7 +80571,7 @@ function peg$parse(input, options) { } if (s7 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f785(s1, s5); + s0 = peg$f791(s1, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -80578,7 +80638,7 @@ function peg$parse(input, options) { } if (s15 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f786(s5, s9, s13); + s0 = peg$f792(s5, s9, s13); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -80711,7 +80771,7 @@ function peg$parse(input, options) { } if (s11 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f787(s5, s9); + s0 = peg$f793(s5, s9); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -80786,7 +80846,7 @@ function peg$parse(input, options) { } if (s7 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f788(s5); + s0 = peg$f794(s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -80929,7 +80989,7 @@ function peg$parse(input, options) { } if (s13 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f789(s5, s10, s11); + s0 = peg$f795(s5, s10, s11); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -81019,7 +81079,7 @@ function peg$parse(input, options) { } if (s12 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f790(s5, s10); + s0 = peg$f796(s5, s10); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -81112,7 +81172,7 @@ function peg$parse(input, options) { } if (s14 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f791(s5, s7, s12); + s0 = peg$f797(s5, s7, s12); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -81206,7 +81266,7 @@ function peg$parse(input, options) { } if (s12 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f792(s5, s10); + s0 = peg$f798(s5, s10); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -81266,7 +81326,7 @@ function peg$parse(input, options) { s4 = peg$parseStringLiteral(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f793(s4); + s0 = peg$f799(s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -81310,7 +81370,7 @@ function peg$parse(input, options) { s4 = peg$parseStringLiteral(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f794(s4); + s0 = peg$f800(s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -81354,7 +81414,7 @@ function peg$parse(input, options) { s4 = peg$parseStringLiteral(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f795(s4); + s0 = peg$f801(s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -81427,7 +81487,7 @@ function peg$parse(input, options) { } if (s10 !== peg$FAILED) { peg$savedPos = s6; - s6 = peg$f796(s5, s9); + s6 = peg$f802(s5, s9); } else { peg$currPos = s6; s6 = peg$FAILED; @@ -81455,7 +81515,7 @@ function peg$parse(input, options) { } if (s12 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f797(s5, s6, s10); + s0 = peg$f803(s5, s6, s10); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -81661,7 +81721,7 @@ function peg$parse(input, options) { s11 = null; } peg$savedPos = s0; - s0 = peg$f798(s1, s4, s5, s6, s7, s10, s11); + s0 = peg$f804(s1, s4, s5, s6, s7, s10, s11); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -81747,7 +81807,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f799(s1); + s1 = peg$f805(s1); } s0 = s1; @@ -81795,7 +81855,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f800(); + s0 = peg$f806(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -81832,7 +81892,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f801(); + s0 = peg$f807(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -81869,7 +81929,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f802(); + s0 = peg$f808(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -81956,7 +82016,7 @@ function peg$parse(input, options) { } if (s11 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f803(s9); + s0 = peg$f809(s9); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -82027,7 +82087,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f804(s1, s2); + s0 = peg$f810(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -82061,7 +82121,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f805(s1, s2); + s0 = peg$f811(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -82091,7 +82151,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f806(s2); + s0 = peg$f812(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -82125,7 +82185,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f807(s2); + s0 = peg$f813(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -82222,7 +82282,7 @@ function peg$parse(input, options) { s2 = peg$parseFunctionCallArg(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f808(s2); + s0 = peg$f814(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -82322,7 +82382,7 @@ function peg$parse(input, options) { s3 = null; } peg$savedPos = s0; - s0 = peg$f809(s1, s2); + s0 = peg$f815(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -82361,7 +82421,7 @@ function peg$parse(input, options) { s5 = peg$parseExpression(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f810(s1, s5); + s0 = peg$f816(s1, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -82393,7 +82453,7 @@ function peg$parse(input, options) { s2 = peg$parseUnionQuery(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f811(s2); + s0 = peg$f817(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -82435,7 +82495,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f812(s1); + s0 = peg$f818(s1); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -82481,7 +82541,7 @@ function peg$parse(input, options) { s5 = peg$parseMultiLambdaParamsTail(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f813(s1, s5); + s0 = peg$f819(s1, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -82528,7 +82588,7 @@ function peg$parse(input, options) { s5 = peg$parseMultiLambdaParamsTail(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f814(s1, s5); + s0 = peg$f820(s1, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -82572,7 +82632,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f815(s1); + s0 = peg$f821(s1); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -82618,7 +82678,7 @@ function peg$parse(input, options) { s7 = peg$parseColumnRefCont(); if (s7 !== peg$FAILED) { peg$savedPos = s3; - s3 = peg$f816(s1, s7); + s3 = peg$f822(s1, s7); } else { peg$currPos = s3; s3 = peg$FAILED; @@ -82644,7 +82704,7 @@ function peg$parse(input, options) { s7 = peg$parseColumnRefCont(); if (s7 !== peg$FAILED) { peg$savedPos = s3; - s3 = peg$f816(s1, s7); + s3 = peg$f822(s1, s7); } else { peg$currPos = s3; s3 = peg$FAILED; @@ -82682,7 +82742,7 @@ function peg$parse(input, options) { } if (s8 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f817(s1, s2, s6); + s0 = peg$f823(s1, s2, s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -82718,7 +82778,7 @@ function peg$parse(input, options) { s7 = peg$parseColumnRefCont(); if (s7 !== peg$FAILED) { peg$savedPos = s3; - s3 = peg$f818(s1, s7); + s3 = peg$f824(s1, s7); } else { peg$currPos = s3; s3 = peg$FAILED; @@ -82744,7 +82804,7 @@ function peg$parse(input, options) { s7 = peg$parseColumnRefCont(); if (s7 !== peg$FAILED) { peg$savedPos = s3; - s3 = peg$f818(s1, s7); + s3 = peg$f824(s1, s7); } else { peg$currPos = s3; s3 = peg$FAILED; @@ -82759,7 +82819,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f819(s1, s2); + s0 = peg$f825(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -82773,7 +82833,7 @@ function peg$parse(input, options) { s1 = peg$parseIdentifier(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f820(s1); + s1 = peg$f826(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -82828,7 +82888,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f821(s1); + s1 = peg$f827(s1); } s0 = s1; } @@ -82966,7 +83026,7 @@ function peg$parse(input, options) { s4 = null; } peg$savedPos = s0; - s0 = peg$f822(s3, s4); + s0 = peg$f828(s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -83011,7 +83071,7 @@ function peg$parse(input, options) { s3 = null; } peg$savedPos = s0; - s0 = peg$f823(s2, s3); + s0 = peg$f829(s2, s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -83074,7 +83134,7 @@ function peg$parse(input, options) { s8 = peg$parseIdentifier(); if (s8 !== peg$FAILED) { peg$savedPos = s3; - s3 = peg$f824(s1, s8); + s3 = peg$f830(s1, s8); } else { peg$currPos = s3; s3 = peg$FAILED; @@ -83120,7 +83180,7 @@ function peg$parse(input, options) { s8 = peg$parseIdentifier(); if (s8 !== peg$FAILED) { peg$savedPos = s3; - s3 = peg$f824(s1, s8); + s3 = peg$f830(s1, s8); } else { peg$currPos = s3; s3 = peg$FAILED; @@ -83177,7 +83237,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f825(s1, s2, s7); + s0 = peg$f831(s1, s2, s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -83242,7 +83302,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f826(s2); + s0 = peg$f832(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -83364,7 +83424,7 @@ function peg$parse(input, options) { } if (s11 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f827(s9); + s0 = peg$f833(s9); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -83450,7 +83510,7 @@ function peg$parse(input, options) { s7 = peg$parseIdentifier(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f828(s7); + s0 = peg$f834(s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -83520,7 +83580,7 @@ function peg$parse(input, options) { } if (s8 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f829(s6); + s0 = peg$f835(s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -83590,7 +83650,7 @@ function peg$parse(input, options) { } if (s8 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f830(s6); + s0 = peg$f836(s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -83642,7 +83702,7 @@ function peg$parse(input, options) { s4 = peg$parseStringLiteral(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f831(s4); + s0 = peg$f837(s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -83686,7 +83746,7 @@ function peg$parse(input, options) { s4 = peg$parseIdentifier(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f832(s4); + s0 = peg$f838(s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -83776,7 +83836,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f833(s1, s2); + s0 = peg$f839(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -83847,7 +83907,7 @@ function peg$parse(input, options) { } if (s8 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f834(s6); + s0 = peg$f840(s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -83899,7 +83959,7 @@ function peg$parse(input, options) { s4 = peg$parseLambdaExprNoParens(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f835(s4); + s0 = peg$f841(s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -83943,7 +84003,7 @@ function peg$parse(input, options) { s4 = peg$parseFunctionCall(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f836(s4); + s0 = peg$f842(s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -83987,7 +84047,7 @@ function peg$parse(input, options) { s4 = peg$parseIdentifier(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f837(s4); + s0 = peg$f843(s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -84095,7 +84155,7 @@ function peg$parse(input, options) { } if (s11 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f838(s9); + s0 = peg$f844(s9); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -84181,7 +84241,7 @@ function peg$parse(input, options) { s7 = peg$parseReplaceItem(); if (s7 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f839(s7); + s0 = peg$f845(s7); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -84251,7 +84311,7 @@ function peg$parse(input, options) { } if (s8 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f840(s6); + s0 = peg$f846(s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -84303,7 +84363,7 @@ function peg$parse(input, options) { s4 = peg$parseReplaceItem(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f841(s4); + s0 = peg$f847(s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -84391,7 +84451,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f842(s1, s2); + s0 = peg$f848(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -84424,7 +84484,7 @@ function peg$parse(input, options) { s5 = peg$parseIdentifier(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f843(s1, s5); + s0 = peg$f849(s1, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -84511,7 +84571,7 @@ function peg$parse(input, options) { s8 = peg$parseColumnRefCont(); if (s8 !== peg$FAILED) { peg$savedPos = s3; - s3 = peg$f844(s1, s8); + s3 = peg$f850(s1, s8); } else { peg$currPos = s3; s3 = peg$FAILED; @@ -84578,7 +84638,7 @@ function peg$parse(input, options) { s8 = peg$parseColumnRefCont(); if (s8 !== peg$FAILED) { peg$savedPos = s3; - s3 = peg$f844(s1, s8); + s3 = peg$f850(s1, s8); } else { peg$currPos = s3; s3 = peg$FAILED; @@ -84656,7 +84716,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f845(s1, s2, s10, s13); + s0 = peg$f851(s1, s2, s10, s13); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -84740,7 +84800,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f846(s5, s9, s10); + s0 = peg$f852(s5, s9, s10); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -84924,7 +84984,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f847(s1); + s0 = peg$f853(s1); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -84975,7 +85035,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f848(s2); + s0 = peg$f854(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -85009,7 +85069,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f849(s2); + s0 = peg$f855(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -85047,7 +85107,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f850(); + s1 = peg$f856(); } s0 = s1; if (s0 === peg$FAILED) { @@ -85061,7 +85121,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f851(); + s1 = peg$f857(); } s0 = s1; if (s0 === peg$FAILED) { @@ -85075,7 +85135,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f852(); + s1 = peg$f858(); } s0 = s1; if (s0 === peg$FAILED) { @@ -85089,7 +85149,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f853(); + s1 = peg$f859(); } s0 = s1; if (s0 === peg$FAILED) { @@ -85103,7 +85163,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f854(); + s1 = peg$f860(); } s0 = s1; if (s0 === peg$FAILED) { @@ -85117,7 +85177,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f855(); + s1 = peg$f861(); } s0 = s1; if (s0 === peg$FAILED) { @@ -85131,7 +85191,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f856(); + s1 = peg$f862(); } s0 = s1; if (s0 === peg$FAILED) { @@ -85145,7 +85205,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f857(); + s1 = peg$f863(); } s0 = s1; if (s0 === peg$FAILED) { @@ -85159,7 +85219,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f858(); + s1 = peg$f864(); } s0 = s1; if (s0 === peg$FAILED) { @@ -85173,7 +85233,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f859(); + s1 = peg$f865(); } s0 = s1; if (s0 === peg$FAILED) { @@ -85187,7 +85247,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f860(); + s1 = peg$f866(); } s0 = s1; if (s0 === peg$FAILED) { @@ -85201,7 +85261,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f861(); + s1 = peg$f867(); } s0 = s1; if (s0 === peg$FAILED) { @@ -85215,7 +85275,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f862(); + s1 = peg$f868(); } s0 = s1; if (s0 === peg$FAILED) { @@ -85245,7 +85305,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f863(s2, s3); + s0 = peg$f869(s2, s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -85277,7 +85337,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f864(s2); + s0 = peg$f870(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -85305,7 +85365,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f865(s2); + s0 = peg$f871(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -85325,7 +85385,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f866(); + s1 = peg$f872(); } s0 = s1; } @@ -85389,7 +85449,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f867(); + s0 = peg$f873(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -85409,7 +85469,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f868(); + s1 = peg$f874(); } s0 = s1; if (s0 === peg$FAILED) { @@ -85440,7 +85500,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f869(s2); + s0 = peg$f875(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -85553,7 +85613,7 @@ function peg$parse(input, options) { } if (s10 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f870(s3); + s0 = peg$f876(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -85618,7 +85678,7 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f871(s1, s5); + s0 = peg$f877(s1, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -85639,7 +85699,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f872(s1); + s1 = peg$f878(s1); } s0 = s1; } @@ -85703,7 +85763,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = peg$currPos; - s2 = peg$f873(s1); + s2 = peg$f879(s1); if (s2) { s2 = undefined; } else { @@ -85711,7 +85771,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f874(s1); + s0 = peg$f880(s1); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -85745,7 +85805,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f875(s2); + s0 = peg$f881(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -85779,7 +85839,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f876(s2); + s0 = peg$f882(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -85885,7 +85945,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f877(s2); + s0 = peg$f883(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -85957,7 +86017,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f878(s1); + s1 = peg$f884(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -85985,7 +86045,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f879(s2); + s0 = peg$f885(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -86019,7 +86079,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f880(s2); + s0 = peg$f886(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -86125,7 +86185,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f881(s2); + s0 = peg$f887(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -86183,7 +86243,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f882(s1, s2); + s0 = peg$f888(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -86217,7 +86277,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f883(s1, s2); + s0 = peg$f889(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -86247,7 +86307,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f884(s2); + s0 = peg$f890(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -86281,7 +86341,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f885(s2); + s0 = peg$f891(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -86387,7 +86447,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f886(s2); + s0 = peg$f892(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -86428,7 +86488,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f887(); + s1 = peg$f893(); } s0 = s1; if (s0 === peg$FAILED) { @@ -86442,7 +86502,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f888(); + s1 = peg$f894(); } s0 = s1; if (s0 === peg$FAILED) { @@ -86456,7 +86516,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f889(); + s1 = peg$f895(); } s0 = s1; if (s0 === peg$FAILED) { @@ -86478,7 +86538,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f890(s2); + s0 = peg$f896(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -86498,7 +86558,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f891(); + s1 = peg$f897(); } s0 = s1; } @@ -86533,7 +86593,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f892(); + s1 = peg$f898(); } s0 = s1; if (s0 === peg$FAILED) { @@ -86581,7 +86641,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f893(s2); + s0 = peg$f899(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -86601,7 +86661,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f894(); + s1 = peg$f900(); } s0 = s1; if (s0 === peg$FAILED) { @@ -86623,7 +86683,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f895(s2); + s0 = peg$f901(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -86643,7 +86703,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f896(); + s1 = peg$f902(); } s0 = s1; } @@ -87451,7 +87511,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f897(s1); + s0 = peg$f903(s1); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -87505,7 +87565,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f898(s1); + s0 = peg$f904(s1); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -89054,7 +89114,7 @@ function peg$parse(input, options) { s3 = peg$parse_NLC(); } peg$savedPos = s0; - s0 = peg$f899(s1, s2); + s0 = peg$f905(s1, s2); peg$silentFails--; peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; @@ -89101,7 +89161,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$f900(); + s3 = peg$f906(); } s2 = s3; if (s2 === peg$FAILED) { @@ -89137,7 +89197,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s2; - s3 = peg$f900(); + s3 = peg$f906(); } s2 = s3; if (s2 === peg$FAILED) { @@ -89148,7 +89208,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s1 = peg$f901(s1); + s1 = peg$f907(s1); s0 = s1; peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; @@ -89218,7 +89278,7 @@ function peg$parse(input, options) { } if (s4 !== peg$FAILED) { peg$savedPos = s3; - s4 = peg$f902(); + s4 = peg$f908(); } s3 = s4; if (s3 === peg$FAILED) { @@ -89254,7 +89314,7 @@ function peg$parse(input, options) { } if (s4 !== peg$FAILED) { peg$savedPos = s3; - s4 = peg$f902(); + s4 = peg$f908(); } s3 = s4; if (s3 === peg$FAILED) { @@ -89265,7 +89325,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f903(s2); + s0 = peg$f909(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -89401,7 +89461,7 @@ function peg$parse(input, options) { } } peg$savedPos = s0; - s0 = peg$f904(); + s0 = peg$f910(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -89448,7 +89508,7 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f905(); + s0 = peg$f911(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -89504,7 +89564,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f906(); + s0 = peg$f912(); } else { peg$currPos = s0; s0 = peg$FAILED; diff --git a/tests/clickhouse-reference-ast-json.test.ts b/tests/clickhouse-reference-ast-json.test.ts new file mode 100644 index 000000000..c374987f5 --- /dev/null +++ b/tests/clickhouse-reference-ast-json.test.ts @@ -0,0 +1,53 @@ +import * as fs from 'fs'; +import * as path from 'path'; +import { explainJSON, parse } from '../src/index'; + +/** + * Reference suite for `formatExplainJSON()` / `explainJSON()` against the + * vendored ClickHouse `EXPLAIN AST json = 1` corpus. + * + * Each `cases/.sql` is parsed with this library, converted with + * `explainJSON()`, and the `ast` payload is deep-compared against the + * pretty-printed reference output in `cases/.json` (see the README in + * the corpus directory for the source PR and pinned commit SHA). + */ + +const CASES_DIR = path.join(__dirname, 'clickhouse-reference-ast-json', 'cases'); + +/** + * Known divergences from the reference output. Map of case basename (without + * extension) to the reason it is skipped. Keep this list empty when possible; + * document the cause when not. + */ +const SKIP: Record = {}; + +function discoverJSONCases(): string[] { + if (!fs.existsSync(CASES_DIR)) return []; + return fs + .readdirSync(CASES_DIR) + .filter((f) => f.endsWith('.sql')) + .map((f) => f.replace(/\.sql$/, '')) + .sort(); +} + +describe('clickhouse reference - ast json', () => { + for (const name of discoverJSONCases()) { + const skipReason = SKIP[name]; + const testFn = skipReason ? it.skip : it; + testFn(skipReason ? `${name} (skipped: ${skipReason})` : name, () => { + const sql = fs.readFileSync(path.join(CASES_DIR, `${name}.sql`), 'utf-8'); + const expected = JSON.parse(fs.readFileSync(path.join(CASES_DIR, `${name}.json`), 'utf-8')); + + const statements = parse(sql); + expect(statements).toHaveLength(1); + + const document = explainJSON(statements[0]); + expect(document.version).toBe(1); + // Round-trip through JSON to drop undefined values and compare structurally. + const actual = JSON.parse(JSON.stringify(document.ast)); + // The vendored fixtures at the pinned SHA are the bare AST node; the + // `{version, ast}` wrapper is part of the documented v1 contract. + expect(actual).toEqual('ast' in expected ? expected.ast : expected); + }); + } +}); diff --git a/tests/clickhouse-reference-ast-json/README.md b/tests/clickhouse-reference-ast-json/README.md new file mode 100644 index 000000000..81fc003f3 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/README.md @@ -0,0 +1,53 @@ +# ClickHouse `EXPLAIN AST json = 1` reference corpus + +This directory vendors the curated SQL → JSON-AST fixture corpus from the +upstream ClickHouse "JSON AST with properties" PR, which adds +`EXPLAIN AST json = 1` to ClickHouse: + +- **Source PR:** https://github.com/peter-leonov-ch/ClickHouse/pull/1 +- **Commit SHA (corpus generated from):** `ad33aa4ceba52f42afb17246cc2778d3733cfb7e` +- **Format version:** 1 (`AST_JSON_FORMAT_VERSION`); any backwards-incompatible + upstream shape change bumps the version +- **Upstream contract reference:** `AST.md` in the PR branch root + (https://github.com/peter-leonov-ch/ClickHouse/blob/ad33aa4ceba52f42afb17246cc2778d3733cfb7e/AST.md) + +## Layout + +`cases/` holds 41 numbered pairs sharing a basename: + +- `.sql` — one input statement (the source of truth) +- `.json` — the exact, pretty-printed output of + `EXPLAIN AST json = 1 ` from the reference ClickHouse build + +The corpus is used by `tests/clickhouse-reference-ast-json.test.ts`: each +`.sql` is parsed with this library, converted with `formatExplainJSON()`, and +the resulting `ast` payload is deep-compared (structurally, so key order and +whitespace are irrelevant) against the vendored `.json`. + +## Notes on the pinned snapshot + +- At the pinned SHA the reference output is the bare AST node (the + `{ "version": 1, "ast": ... }` document wrapper documented in the PR + description is emitted by `formatExplainJSON()` but not yet present in + these fixtures; the test compares the `ast` payload). +- 64-bit integer literal values are emitted as native JSON numbers at the + pinned SHA (`quote_64bit_integers = false`). + +## Regenerating + +Once a ClickHouse build containing the PR is available as an image (set +`CLICKHOUSE_IMAGE`), regenerate the `.json` files with: + +```bash +npm run generate:ast-json-fixtures +``` + +The script starts the docker-compose ClickHouse server (or reuses one running +at `CLICKHOUSE_URL`) and runs `EXPLAIN AST json = 1` for each `cases/*.sql`. +Until such an image exists, the vendored copies are the source of truth — do +not hand-edit them. + +The upstream PR also carries a bulk `shapes/` corpus (1,440 +structurally-distinct statements harvested from the ClickHouse stateless test +suite). It is intentionally not vendored here; it can be used later for +coverage screening rather than hard assertions. diff --git a/tests/clickhouse-reference-ast-json/cases/01_literals.json b/tests/clickhouse-reference-ast-json/cases/01_literals.json new file mode 100644 index 000000000..bd067e79b --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/01_literals.json @@ -0,0 +1,66 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Literal", + "value_type": "UInt64", + "value": 1 + }, + { + "type": "Literal", + "value_type": "Int64", + "value": -2 + }, + { + "type": "Literal", + "value_type": "Float64", + "value": 3.5 + }, + { + "type": "Literal", + "value_type": "String", + "value": "str" + }, + { + "type": "Literal", + "value_type": "Null", + "value": null + }, + { + "type": "Literal", + "value_type": "Bool", + "value": true + }, + { + "type": "Literal", + "value_type": "Array", + "value": "[1, 2]" + }, + { + "type": "Literal", + "value_type": "Tuple", + "value": "(1, 'a')" + }, + { + "type": "Function", + "name": "map", + "arguments": [ + { + "type": "Literal", + "value_type": "String", + "value": "k" + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 1 + } + ] + } + ] + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/01_literals.sql b/tests/clickhouse-reference-ast-json/cases/01_literals.sql new file mode 100644 index 000000000..c31e30d3e --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/01_literals.sql @@ -0,0 +1 @@ +SELECT 1, -2, 3.5, 'str', NULL, true, [1, 2], (1, 'a'), map('k', 1) diff --git a/tests/clickhouse-reference-ast-json/cases/02_identifiers.json b/tests/clickhouse-reference-ast-json/cases/02_identifiers.json new file mode 100644 index 000000000..0dba2561b --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/02_identifiers.json @@ -0,0 +1,24 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "t.b", + "name_parts": ["t", "b"] + }, + { + "type": "Identifier", + "name": "db.tbl.c", + "name_parts": ["db", "tbl", "c"] + } + ] + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/02_identifiers.sql b/tests/clickhouse-reference-ast-json/cases/02_identifiers.sql new file mode 100644 index 000000000..88fc5bda5 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/02_identifiers.sql @@ -0,0 +1 @@ +SELECT a, t.b, db.tbl.c diff --git a/tests/clickhouse-reference-ast-json/cases/03_function_call.json b/tests/clickhouse-reference-ast-json/cases/03_function_call.json new file mode 100644 index 000000000..9fe18e9d6 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/03_function_call.json @@ -0,0 +1,24 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Function", + "name": "f", + "arguments": [ + { + "type": "Identifier", + "name": "x" + }, + { + "type": "Identifier", + "name": "y" + } + ] + } + ] + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/03_function_call.sql b/tests/clickhouse-reference-ast-json/cases/03_function_call.sql new file mode 100644 index 000000000..1ea9f8240 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/03_function_call.sql @@ -0,0 +1 @@ +SELECT f(x, y) diff --git a/tests/clickhouse-reference-ast-json/cases/04_no_args.json b/tests/clickhouse-reference-ast-json/cases/04_no_args.json new file mode 100644 index 000000000..870f55310 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/04_no_args.json @@ -0,0 +1,15 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Function", + "name": "now", + "arguments": [] + } + ] + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/04_no_args.sql b/tests/clickhouse-reference-ast-json/cases/04_no_args.sql new file mode 100644 index 000000000..31700225c --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/04_no_args.sql @@ -0,0 +1 @@ +SELECT now() diff --git a/tests/clickhouse-reference-ast-json/cases/05_operators.json b/tests/clickhouse-reference-ast-json/cases/05_operators.json new file mode 100644 index 000000000..398e726f5 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/05_operators.json @@ -0,0 +1,117 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Function", + "name": "plus", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] + }, + { + "type": "Function", + "name": "in", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "x" + }, + { + "type": "Literal", + "value_type": "Tuple", + "value": "(1, 2)" + } + ] + }, + { + "type": "Function", + "name": "and", + "is_operator": true, + "arguments": [ + { + "type": "Function", + "name": "greaterOrEquals", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "y" + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 1 + } + ] + }, + { + "type": "Function", + "name": "lessOrEquals", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "y" + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 2 + } + ] + } + ] + }, + { + "type": "Function", + "name": "not", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "z" + } + ] + }, + { + "type": "Function", + "name": "or", + "is_operator": true, + "arguments": [ + { + "type": "Function", + "name": "and", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "p" + }, + { + "type": "Identifier", + "name": "q" + } + ] + }, + { + "type": "Identifier", + "name": "r" + } + ] + } + ] + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/05_operators.sql b/tests/clickhouse-reference-ast-json/cases/05_operators.sql new file mode 100644 index 000000000..3d608adf2 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/05_operators.sql @@ -0,0 +1 @@ +SELECT a + b, x IN (1, 2), y BETWEEN 1 AND 2, NOT z, p AND q OR r diff --git a/tests/clickhouse-reference-ast-json/cases/06_subscript.json b/tests/clickhouse-reference-ast-json/cases/06_subscript.json new file mode 100644 index 000000000..7b458fbc8 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/06_subscript.json @@ -0,0 +1,42 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Function", + "name": "arrayElement", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "arr" + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 1 + } + ] + }, + { + "type": "Function", + "name": "tupleElement", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "tup" + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 2 + } + ] + } + ] + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/06_subscript.sql b/tests/clickhouse-reference-ast-json/cases/06_subscript.sql new file mode 100644 index 000000000..2f077808f --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/06_subscript.sql @@ -0,0 +1 @@ +SELECT arr[1], tup.2 diff --git a/tests/clickhouse-reference-ast-json/cases/07_cast.json b/tests/clickhouse-reference-ast-json/cases/07_cast.json new file mode 100644 index 000000000..543d9c435 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/07_cast.json @@ -0,0 +1,41 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Function", + "name": "CAST", + "arguments": [ + { + "type": "Identifier", + "name": "x" + }, + { + "type": "Literal", + "value_type": "String", + "value": "Int64" + } + ] + }, + { + "type": "Function", + "name": "CAST", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "y" + }, + { + "type": "Literal", + "value_type": "String", + "value": "String" + } + ] + } + ] + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/07_cast.sql b/tests/clickhouse-reference-ast-json/cases/07_cast.sql new file mode 100644 index 000000000..c198db97c --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/07_cast.sql @@ -0,0 +1 @@ +SELECT CAST(x AS Int64), y::String diff --git a/tests/clickhouse-reference-ast-json/cases/08_lambda.json b/tests/clickhouse-reference-ast-json/cases/08_lambda.json new file mode 100644 index 000000000..12085986f --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/08_lambda.json @@ -0,0 +1,56 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Function", + "name": "arrayMap", + "arguments": [ + { + "type": "Function", + "name": "lambda", + "is_operator": true, + "is_lambda_function": true, + "kind": "LAMBDA_FUNCTION", + "arguments": [ + { + "type": "Function", + "name": "tuple", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "e" + } + ] + }, + { + "type": "Function", + "name": "multiply", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "e" + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 2 + } + ] + } + ] + }, + { + "type": "Identifier", + "name": "arr" + } + ] + } + ] + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/08_lambda.sql b/tests/clickhouse-reference-ast-json/cases/08_lambda.sql new file mode 100644 index 000000000..ee6c53eae --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/08_lambda.sql @@ -0,0 +1 @@ +SELECT arrayMap(e -> e * 2, arr) diff --git a/tests/clickhouse-reference-ast-json/cases/09_parametric_agg.json b/tests/clickhouse-reference-ast-json/cases/09_parametric_agg.json new file mode 100644 index 000000000..1ae36880c --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/09_parametric_agg.json @@ -0,0 +1,27 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Function", + "name": "quantile", + "arguments": [ + { + "type": "Identifier", + "name": "x" + } + ], + "parameters": [ + { + "type": "Literal", + "value_type": "Float64", + "value": 0.9 + } + ] + } + ] + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/09_parametric_agg.sql b/tests/clickhouse-reference-ast-json/cases/09_parametric_agg.sql new file mode 100644 index 000000000..74641f47b --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/09_parametric_agg.sql @@ -0,0 +1 @@ +SELECT quantile(0.9)(x) diff --git a/tests/clickhouse-reference-ast-json/cases/10_nulls_action.json b/tests/clickhouse-reference-ast-json/cases/10_nulls_action.json new file mode 100644 index 000000000..593936f50 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/10_nulls_action.json @@ -0,0 +1,36 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Function", + "name": "first_value", + "nulls_action": "IGNORE NULLS", + "arguments": [ + { + "type": "Identifier", + "name": "x" + } + ] + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "t" + } + } + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/10_nulls_action.sql b/tests/clickhouse-reference-ast-json/cases/10_nulls_action.sql new file mode 100644 index 000000000..1dd0497ea --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/10_nulls_action.sql @@ -0,0 +1 @@ +SELECT first_value(x) IGNORE NULLS FROM t diff --git a/tests/clickhouse-reference-ast-json/cases/11_window_named.json b/tests/clickhouse-reference-ast-json/cases/11_window_named.json new file mode 100644 index 000000000..4955eb14f --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/11_window_named.json @@ -0,0 +1,63 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Function", + "name": "sum", + "is_window_function": true, + "kind": "WINDOW_FUNCTION", + "arguments": [ + { + "type": "Identifier", + "name": "x" + } + ], + "window_name": "w" + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "t" + } + } + } + ] + }, + "window": [ + { + "type": "WindowListElement", + "name": "w", + "definition": { + "type": "WindowDefinition", + "partition_by": [ + { + "type": "Identifier", + "name": "g" + } + ], + "order_by": [ + { + "type": "OrderByElement", + "expression": { + "type": "Identifier", + "name": "x" + }, + "direction": "ASC" + } + ] + } + } + ] + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/11_window_named.sql b/tests/clickhouse-reference-ast-json/cases/11_window_named.sql new file mode 100644 index 000000000..07a821e5e --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/11_window_named.sql @@ -0,0 +1 @@ +SELECT sum(x) OVER w FROM t WINDOW w AS (PARTITION BY g ORDER BY x) diff --git a/tests/clickhouse-reference-ast-json/cases/12_window_inline.json b/tests/clickhouse-reference-ast-json/cases/12_window_inline.json new file mode 100644 index 000000000..81deff230 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/12_window_inline.json @@ -0,0 +1,66 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Function", + "name": "sum", + "is_window_function": true, + "kind": "WINDOW_FUNCTION", + "arguments": [ + { + "type": "Identifier", + "name": "x" + } + ], + "window_definition": { + "type": "WindowDefinition", + "partition_by": [ + { + "type": "Identifier", + "name": "g" + } + ], + "order_by": [ + { + "type": "OrderByElement", + "expression": { + "type": "Identifier", + "name": "x" + }, + "direction": "ASC" + } + ], + "frame_type": "ROWS", + "frame_begin_type": "Offset", + "frame_begin_offset": { + "type": "Literal", + "value_type": "UInt64", + "value": 1 + }, + "frame_begin_preceding": true, + "frame_end_type": "Current", + "frame_end_preceding": false + } + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "t" + } + } + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/12_window_inline.sql b/tests/clickhouse-reference-ast-json/cases/12_window_inline.sql new file mode 100644 index 000000000..bf4be97c4 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/12_window_inline.sql @@ -0,0 +1 @@ +SELECT sum(x) OVER (PARTITION BY g ORDER BY x ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) FROM t diff --git a/tests/clickhouse-reference-ast-json/cases/13_select_star.json b/tests/clickhouse-reference-ast-json/cases/13_select_star.json new file mode 100644 index 000000000..8cc08a786 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/13_select_star.json @@ -0,0 +1,44 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Asterisk" + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "foo" + } + } + } + ] + }, + "where": { + "type": "Function", + "name": "equals", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "x" + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 1 + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/13_select_star.sql b/tests/clickhouse-reference-ast-json/cases/13_select_star.sql new file mode 100644 index 000000000..585e65777 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/13_select_star.sql @@ -0,0 +1 @@ +SELECT * FROM foo WHERE x = 1 diff --git a/tests/clickhouse-reference-ast-json/cases/14_distinct.json b/tests/clickhouse-reference-ast-json/cases/14_distinct.json new file mode 100644 index 000000000..4d8b5c1cf --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/14_distinct.json @@ -0,0 +1,34 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "distinct": true, + "select": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "t" + } + } + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/14_distinct.sql b/tests/clickhouse-reference-ast-json/cases/14_distinct.sql new file mode 100644 index 000000000..ec7947b3b --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/14_distinct.sql @@ -0,0 +1 @@ +SELECT DISTINCT a, b FROM t diff --git a/tests/clickhouse-reference-ast-json/cases/15_group_by_rollup.json b/tests/clickhouse-reference-ast-json/cases/15_group_by_rollup.json new file mode 100644 index 000000000..9a7c1dae5 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/15_group_by_rollup.json @@ -0,0 +1,58 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "group_by_with_rollup": true, + "select": [ + { + "type": "Identifier", + "name": "g" + }, + { + "type": "Function", + "name": "count", + "arguments": [] + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "t" + } + } + } + ] + }, + "group_by": [ + { + "type": "Identifier", + "name": "g" + } + ], + "having": { + "type": "Function", + "name": "greater", + "is_operator": true, + "arguments": [ + { + "type": "Function", + "name": "count", + "arguments": [] + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 1 + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/15_group_by_rollup.sql b/tests/clickhouse-reference-ast-json/cases/15_group_by_rollup.sql new file mode 100644 index 000000000..7586d0259 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/15_group_by_rollup.sql @@ -0,0 +1 @@ +SELECT g, count() FROM t GROUP BY g WITH ROLLUP HAVING count() > 1 diff --git a/tests/clickhouse-reference-ast-json/cases/16_grouping_sets.json b/tests/clickhouse-reference-ast-json/cases/16_grouping_sets.json new file mode 100644 index 000000000..5204f33b3 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/16_grouping_sets.json @@ -0,0 +1,50 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "group_by_with_grouping_sets": true, + "select": [ + { + "type": "Identifier", + "name": "x" + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "t" + } + } + } + ] + }, + "group_by": [ + { + "type": "ExpressionList", + "children": [ + { + "type": "Identifier", + "name": "x" + } + ] + }, + { + "type": "ExpressionList", + "children": [ + { + "type": "Identifier", + "name": "y" + } + ] + } + ] + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/16_grouping_sets.sql b/tests/clickhouse-reference-ast-json/cases/16_grouping_sets.sql new file mode 100644 index 000000000..46ae2b1a6 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/16_grouping_sets.sql @@ -0,0 +1 @@ +SELECT x FROM t GROUP BY GROUPING SETS ((x), (y)) diff --git a/tests/clickhouse-reference-ast-json/cases/17_qualify.json b/tests/clickhouse-reference-ast-json/cases/17_qualify.json new file mode 100644 index 000000000..d23ea1d21 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/17_qualify.json @@ -0,0 +1,66 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Identifier", + "name": "x" + }, + { + "type": "Function", + "alias": "r", + "name": "row_number", + "is_window_function": true, + "kind": "WINDOW_FUNCTION", + "arguments": [], + "window_definition": { + "type": "WindowDefinition", + "order_by": [ + { + "type": "OrderByElement", + "expression": { + "type": "Identifier", + "name": "x" + }, + "direction": "ASC" + } + ] + } + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "t" + } + } + } + ] + }, + "qualify": { + "type": "Function", + "name": "equals", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "r" + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 1 + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/17_qualify.sql b/tests/clickhouse-reference-ast-json/cases/17_qualify.sql new file mode 100644 index 000000000..ad34263d3 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/17_qualify.sql @@ -0,0 +1 @@ +SELECT x, row_number() OVER (ORDER BY x) AS r FROM t QUALIFY r = 1 diff --git a/tests/clickhouse-reference-ast-json/cases/18_order_by_fill.json b/tests/clickhouse-reference-ast-json/cases/18_order_by_fill.json new file mode 100644 index 000000000..97e862210 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/18_order_by_fill.json @@ -0,0 +1,78 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Identifier", + "name": "x" + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "t" + } + } + } + ] + }, + "order_by": [ + { + "type": "OrderByElement", + "expression": { + "type": "Identifier", + "name": "x" + }, + "direction": "DESC", + "nulls_first": false, + "with_fill": true, + "fill_from": { + "type": "Literal", + "value_type": "UInt64", + "value": 0 + }, + "fill_to": { + "type": "Literal", + "value_type": "UInt64", + "value": 10 + }, + "fill_step": { + "type": "Literal", + "value_type": "UInt64", + "value": 2 + } + } + ], + "interpolate": [ + { + "type": "InterpolateElement", + "column": "x", + "expr": { + "type": "Function", + "name": "plus", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "x" + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 1 + } + ] + } + } + ] + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/18_order_by_fill.sql b/tests/clickhouse-reference-ast-json/cases/18_order_by_fill.sql new file mode 100644 index 000000000..b3e0e3c73 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/18_order_by_fill.sql @@ -0,0 +1 @@ +SELECT x FROM t ORDER BY x DESC NULLS LAST WITH FILL FROM 0 TO 10 STEP 2 INTERPOLATE (x AS x + 1) diff --git a/tests/clickhouse-reference-ast-json/cases/19_limits.json b/tests/clickhouse-reference-ast-json/cases/19_limits.json new file mode 100644 index 000000000..eb48c6bb6 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/19_limits.json @@ -0,0 +1,60 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Identifier", + "name": "x" + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "t" + } + } + } + ] + }, + "order_by": [ + { + "type": "OrderByElement", + "expression": { + "type": "Identifier", + "name": "x" + }, + "direction": "ASC" + } + ], + "limit_by_length": { + "type": "Literal", + "value_type": "UInt64", + "value": 5 + }, + "limit_by": [ + { + "type": "Identifier", + "name": "g" + } + ], + "limit_offset": { + "type": "Literal", + "value_type": "UInt64", + "value": 10 + }, + "limit_length": { + "type": "Literal", + "value_type": "UInt64", + "value": 100 + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/19_limits.sql b/tests/clickhouse-reference-ast-json/cases/19_limits.sql new file mode 100644 index 000000000..f613c334a --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/19_limits.sql @@ -0,0 +1 @@ +SELECT x FROM t ORDER BY x LIMIT 5 BY g LIMIT 100 OFFSET 10 diff --git a/tests/clickhouse-reference-ast-json/cases/20_settings.json b/tests/clickhouse-reference-ast-json/cases/20_settings.json new file mode 100644 index 000000000..ec1b336fe --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/20_settings.json @@ -0,0 +1,22 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Literal", + "value_type": "UInt64", + "value": 1 + } + ], + "settings": { + "type": "Set", + "changes": { + "max_threads": 4, + "max_block_size": 1000 + } + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/20_settings.sql b/tests/clickhouse-reference-ast-json/cases/20_settings.sql new file mode 100644 index 000000000..004f4829d --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/20_settings.sql @@ -0,0 +1 @@ +SELECT 1 SETTINGS max_threads = 4, max_block_size = 1000 diff --git a/tests/clickhouse-reference-ast-json/cases/21_join_on.json b/tests/clickhouse-reference-ast-json/cases/21_join_on.json new file mode 100644 index 000000000..ccb2e41be --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/21_join_on.json @@ -0,0 +1,59 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Asterisk" + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "a" + } + } + }, + { + "type": "TablesInSelectQueryElement", + "table_join": { + "type": "TableJoin", + "kind": "INNER", + "on": { + "type": "Function", + "name": "equals", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "a.x", + "name_parts": ["a", "x"] + }, + { + "type": "Identifier", + "name": "b.x", + "name_parts": ["b", "x"] + } + ] + } + }, + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "b" + } + } + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/21_join_on.sql b/tests/clickhouse-reference-ast-json/cases/21_join_on.sql new file mode 100644 index 000000000..85810e4e5 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/21_join_on.sql @@ -0,0 +1 @@ +SELECT * FROM a INNER JOIN b ON a.x = b.x diff --git a/tests/clickhouse-reference-ast-json/cases/22_join_using.json b/tests/clickhouse-reference-ast-json/cases/22_join_using.json new file mode 100644 index 000000000..443c91eb8 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/22_join_using.json @@ -0,0 +1,52 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Asterisk" + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "a" + } + } + }, + { + "type": "TablesInSelectQueryElement", + "table_join": { + "type": "TableJoin", + "kind": "LEFT", + "using": [ + { + "type": "Identifier", + "name": "x" + }, + { + "type": "Identifier", + "name": "y" + } + ] + }, + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "b" + } + } + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/22_join_using.sql b/tests/clickhouse-reference-ast-json/cases/22_join_using.sql new file mode 100644 index 000000000..b0a6aa6b7 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/22_join_using.sql @@ -0,0 +1 @@ +SELECT * FROM a LEFT JOIN b USING (x, y) diff --git a/tests/clickhouse-reference-ast-json/cases/23_join_global_any.json b/tests/clickhouse-reference-ast-json/cases/23_join_global_any.json new file mode 100644 index 000000000..2bbbf2817 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/23_join_global_any.json @@ -0,0 +1,61 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Asterisk" + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "a" + } + } + }, + { + "type": "TablesInSelectQueryElement", + "table_join": { + "type": "TableJoin", + "kind": "INNER", + "strictness": "ANY", + "locality": "GLOBAL", + "on": { + "type": "Function", + "name": "equals", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "a.x", + "name_parts": ["a", "x"] + }, + { + "type": "Identifier", + "name": "b.x", + "name_parts": ["b", "x"] + } + ] + } + }, + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "b" + } + } + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/23_join_global_any.sql b/tests/clickhouse-reference-ast-json/cases/23_join_global_any.sql new file mode 100644 index 000000000..68d3985a4 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/23_join_global_any.sql @@ -0,0 +1 @@ +SELECT * FROM a GLOBAL ANY INNER JOIN b ON a.x = b.x diff --git a/tests/clickhouse-reference-ast-json/cases/24_cross_comma.json b/tests/clickhouse-reference-ast-json/cases/24_cross_comma.json new file mode 100644 index 000000000..3a8719fcb --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/24_cross_comma.json @@ -0,0 +1,56 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Asterisk" + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "a" + } + } + }, + { + "type": "TablesInSelectQueryElement", + "table_join": { + "type": "TableJoin", + "kind": "CROSS" + }, + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "b" + } + } + }, + { + "type": "TablesInSelectQueryElement", + "table_join": { + "type": "TableJoin", + "kind": "COMMA" + }, + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "c" + } + } + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/24_cross_comma.sql b/tests/clickhouse-reference-ast-json/cases/24_cross_comma.sql new file mode 100644 index 000000000..2f6442207 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/24_cross_comma.sql @@ -0,0 +1 @@ +SELECT * FROM a CROSS JOIN b, c diff --git a/tests/clickhouse-reference-ast-json/cases/25_array_join.json b/tests/clickhouse-reference-ast-json/cases/25_array_join.json new file mode 100644 index 000000000..e9bf93ca7 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/25_array_join.json @@ -0,0 +1,46 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Asterisk" + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "t" + } + } + }, + { + "type": "TablesInSelectQueryElement", + "array_join": { + "type": "ArrayJoin", + "kind": "LEFT", + "expressions": [ + { + "type": "Identifier", + "alias": "e", + "name": "arr" + }, + { + "type": "Identifier", + "name": "other" + } + ] + } + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/25_array_join.sql b/tests/clickhouse-reference-ast-json/cases/25_array_join.sql new file mode 100644 index 000000000..3f6f25d64 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/25_array_join.sql @@ -0,0 +1 @@ +SELECT * FROM t LEFT ARRAY JOIN arr AS e, other diff --git a/tests/clickhouse-reference-ast-json/cases/26_table_function.json b/tests/clickhouse-reference-ast-json/cases/26_table_function.json new file mode 100644 index 000000000..c09719ee6 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/26_table_function.json @@ -0,0 +1,35 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Asterisk" + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "table_function": { + "type": "Function", + "name": "numbers", + "arguments": [ + { + "type": "Literal", + "value_type": "UInt64", + "value": 5 + } + ] + } + } + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/26_table_function.sql b/tests/clickhouse-reference-ast-json/cases/26_table_function.sql new file mode 100644 index 000000000..3b99fc0ce --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/26_table_function.sql @@ -0,0 +1 @@ +SELECT * FROM numbers(5) diff --git a/tests/clickhouse-reference-ast-json/cases/27_subquery_from.json b/tests/clickhouse-reference-ast-json/cases/27_subquery_from.json new file mode 100644 index 000000000..4b5dc5e83 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/27_subquery_from.json @@ -0,0 +1,43 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Asterisk" + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "subquery": { + "type": "Subquery", + "query": { + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Literal", + "alias": "a", + "value_type": "UInt64", + "value": 1 + } + ] + } + ] + } + } + } + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/27_subquery_from.sql b/tests/clickhouse-reference-ast-json/cases/27_subquery_from.sql new file mode 100644 index 000000000..271418e3f --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/27_subquery_from.sql @@ -0,0 +1 @@ +SELECT * FROM (SELECT 1 AS a) diff --git a/tests/clickhouse-reference-ast-json/cases/28_sample_final.json b/tests/clickhouse-reference-ast-json/cases/28_sample_final.json new file mode 100644 index 000000000..7c4ea0044 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/28_sample_final.json @@ -0,0 +1,34 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Asterisk" + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "tbl" + }, + "final": true, + "sample_size": { + "type": "SampleRatio", + "numerator": "1", + "denominator": "10" + } + } + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/28_sample_final.sql b/tests/clickhouse-reference-ast-json/cases/28_sample_final.sql new file mode 100644 index 000000000..096a35866 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/28_sample_final.sql @@ -0,0 +1 @@ +SELECT * FROM tbl FINAL SAMPLE 1/10 diff --git a/tests/clickhouse-reference-ast-json/cases/29_cte.json b/tests/clickhouse-reference-ast-json/cases/29_cte.json new file mode 100644 index 000000000..e41f17d55 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/29_cte.json @@ -0,0 +1,54 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "with": [ + { + "type": "WithElement", + "name": "cte", + "subquery": { + "type": "Subquery", + "query": { + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Literal", + "alias": "a", + "value_type": "UInt64", + "value": 1 + } + ] + } + ] + } + } + } + ], + "select": [ + { + "type": "Identifier", + "name": "a" + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "cte" + } + } + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/29_cte.sql b/tests/clickhouse-reference-ast-json/cases/29_cte.sql new file mode 100644 index 000000000..ae9011dbc --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/29_cte.sql @@ -0,0 +1 @@ +WITH cte AS (SELECT 1 AS a) SELECT a FROM cte diff --git a/tests/clickhouse-reference-ast-json/cases/30_scalar_with.json b/tests/clickhouse-reference-ast-json/cases/30_scalar_with.json new file mode 100644 index 000000000..fe54dfe4a --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/30_scalar_with.json @@ -0,0 +1,55 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "with": [ + { + "type": "Subquery", + "alias": "m", + "query": { + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Function", + "name": "max", + "arguments": [ + { + "type": "Identifier", + "name": "n" + } + ] + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "t" + } + } + } + ] + } + } + ] + } + } + ], + "select": [ + { + "type": "Identifier", + "name": "m" + } + ] + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/30_scalar_with.sql b/tests/clickhouse-reference-ast-json/cases/30_scalar_with.sql new file mode 100644 index 000000000..c6ffce83a --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/30_scalar_with.sql @@ -0,0 +1 @@ +WITH (SELECT max(n) FROM t) AS m SELECT m diff --git a/tests/clickhouse-reference-ast-json/cases/31_union_all.json b/tests/clickhouse-reference-ast-json/cases/31_union_all.json new file mode 100644 index 000000000..c09aaae5b --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/31_union_all.json @@ -0,0 +1,25 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Literal", + "value_type": "UInt64", + "value": 1 + } + ] + }, + { + "type": "SelectQuery", + "select": [ + { + "type": "Literal", + "value_type": "UInt64", + "value": 2 + } + ] + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/31_union_all.sql b/tests/clickhouse-reference-ast-json/cases/31_union_all.sql new file mode 100644 index 000000000..7679fc93b --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/31_union_all.sql @@ -0,0 +1 @@ +SELECT 1 UNION ALL SELECT 2 diff --git a/tests/clickhouse-reference-ast-json/cases/32_union_distinct.json b/tests/clickhouse-reference-ast-json/cases/32_union_distinct.json new file mode 100644 index 000000000..621e4370f --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/32_union_distinct.json @@ -0,0 +1,26 @@ +{ + "type": "SelectWithUnionQuery", + "union_mode": "UNION_DISTINCT", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Literal", + "value_type": "UInt64", + "value": 1 + } + ] + }, + { + "type": "SelectQuery", + "select": [ + { + "type": "Literal", + "value_type": "UInt64", + "value": 2 + } + ] + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/32_union_distinct.sql b/tests/clickhouse-reference-ast-json/cases/32_union_distinct.sql new file mode 100644 index 000000000..469dfc5b2 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/32_union_distinct.sql @@ -0,0 +1 @@ +SELECT 1 UNION DISTINCT SELECT 2 diff --git a/tests/clickhouse-reference-ast-json/cases/33_intersect.json b/tests/clickhouse-reference-ast-json/cases/33_intersect.json new file mode 100644 index 000000000..fcd98f9dd --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/33_intersect.json @@ -0,0 +1,31 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectIntersectExceptQuery", + "operator": "INTERSECT ALL", + "children": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Literal", + "value_type": "UInt64", + "value": 1 + } + ] + }, + { + "type": "SelectQuery", + "select": [ + { + "type": "Literal", + "value_type": "UInt64", + "value": 2 + } + ] + } + ] + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/33_intersect.sql b/tests/clickhouse-reference-ast-json/cases/33_intersect.sql new file mode 100644 index 000000000..75d49c11f --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/33_intersect.sql @@ -0,0 +1 @@ +SELECT 1 INTERSECT SELECT 2 diff --git a/tests/clickhouse-reference-ast-json/cases/34_except.json b/tests/clickhouse-reference-ast-json/cases/34_except.json new file mode 100644 index 000000000..56c3ef128 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/34_except.json @@ -0,0 +1,36 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectIntersectExceptQuery", + "operator": "EXCEPT ALL", + "children": [ + { + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Literal", + "value_type": "UInt64", + "value": 1 + } + ] + } + ] + }, + { + "type": "SelectQuery", + "select": [ + { + "type": "Literal", + "value_type": "UInt64", + "value": 2 + } + ] + } + ] + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/34_except.sql b/tests/clickhouse-reference-ast-json/cases/34_except.sql new file mode 100644 index 000000000..94c30037d --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/34_except.sql @@ -0,0 +1 @@ +SELECT 1 EXCEPT SELECT 2 diff --git a/tests/clickhouse-reference-ast-json/cases/35_qualified_star.json b/tests/clickhouse-reference-ast-json/cases/35_qualified_star.json new file mode 100644 index 000000000..576f47799 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/35_qualified_star.json @@ -0,0 +1,32 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "QualifiedAsterisk", + "qualifier": { + "type": "Identifier", + "name": "t" + } + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "t" + } + } + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/35_qualified_star.sql b/tests/clickhouse-reference-ast-json/cases/35_qualified_star.sql new file mode 100644 index 000000000..27b4fe798 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/35_qualified_star.sql @@ -0,0 +1 @@ +SELECT t.* FROM t diff --git a/tests/clickhouse-reference-ast-json/cases/36_except_transform.json b/tests/clickhouse-reference-ast-json/cases/36_except_transform.json new file mode 100644 index 000000000..d76e1105b --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/36_except_transform.json @@ -0,0 +1,46 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Asterisk", + "transformers": { + "type": "ColumnsTransformerList", + "children": [ + { + "type": "ColumnsExceptTransformer", + "children": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] + } + ] + } + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "t" + } + } + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/36_except_transform.sql b/tests/clickhouse-reference-ast-json/cases/36_except_transform.sql new file mode 100644 index 000000000..f21a8421b --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/36_except_transform.sql @@ -0,0 +1 @@ +SELECT * EXCEPT (a, b) FROM t diff --git a/tests/clickhouse-reference-ast-json/cases/37_apply_transform.json b/tests/clickhouse-reference-ast-json/cases/37_apply_transform.json new file mode 100644 index 000000000..47b6ba4c8 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/37_apply_transform.json @@ -0,0 +1,37 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Asterisk", + "transformers": { + "type": "ColumnsTransformerList", + "children": [ + { + "type": "ColumnsApplyTransformer", + "func_name": "sum" + } + ] + } + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "t" + } + } + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/37_apply_transform.sql b/tests/clickhouse-reference-ast-json/cases/37_apply_transform.sql new file mode 100644 index 000000000..625e0bfb2 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/37_apply_transform.sql @@ -0,0 +1 @@ +SELECT * APPLY(sum) FROM t diff --git a/tests/clickhouse-reference-ast-json/cases/38_replace_transform.json b/tests/clickhouse-reference-ast-json/cases/38_replace_transform.json new file mode 100644 index 000000000..4d3b8ff28 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/38_replace_transform.json @@ -0,0 +1,60 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Asterisk", + "transformers": { + "type": "ColumnsTransformerList", + "children": [ + { + "type": "ColumnsReplaceTransformer", + "children": [ + { + "type": "ColumnsReplaceTransformer::Replacement", + "name": "y", + "children": [ + { + "type": "Function", + "name": "plus", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "x" + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 1 + } + ] + } + ] + } + ] + } + ] + } + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "t" + } + } + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/38_replace_transform.sql b/tests/clickhouse-reference-ast-json/cases/38_replace_transform.sql new file mode 100644 index 000000000..fb6d0bad8 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/38_replace_transform.sql @@ -0,0 +1 @@ +SELECT * REPLACE (x + 1 AS y) FROM t diff --git a/tests/clickhouse-reference-ast-json/cases/39_columns_regexp.json b/tests/clickhouse-reference-ast-json/cases/39_columns_regexp.json new file mode 100644 index 000000000..f73071048 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/39_columns_regexp.json @@ -0,0 +1,29 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "ColumnsRegexpMatcher", + "pattern": "a.*" + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "t" + } + } + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/39_columns_regexp.sql b/tests/clickhouse-reference-ast-json/cases/39_columns_regexp.sql new file mode 100644 index 000000000..aade522ae --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/39_columns_regexp.sql @@ -0,0 +1 @@ +SELECT COLUMNS('a.*') FROM t diff --git a/tests/clickhouse-reference-ast-json/cases/40_columns_list.json b/tests/clickhouse-reference-ast-json/cases/40_columns_list.json new file mode 100644 index 000000000..ce29baa05 --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/40_columns_list.json @@ -0,0 +1,38 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "ColumnsListMatcher", + "columns": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "t" + } + } + } + ] + } + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/40_columns_list.sql b/tests/clickhouse-reference-ast-json/cases/40_columns_list.sql new file mode 100644 index 000000000..96e082ece --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/40_columns_list.sql @@ -0,0 +1 @@ +SELECT COLUMNS(a, b) FROM t diff --git a/tests/clickhouse-reference-ast-json/cases/41_showcase.json b/tests/clickhouse-reference-ast-json/cases/41_showcase.json new file mode 100644 index 000000000..369d0c42e --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/41_showcase.json @@ -0,0 +1,673 @@ +{ + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "distinct": true, + "group_by_with_rollup": true, + "with": [ + { + "type": "WithElement", + "name": "recent", + "subquery": { + "type": "Subquery", + "query": { + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Identifier", + "alias": "n", + "name": "number" + }, + { + "type": "Function", + "alias": "g", + "name": "modulo", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "number" + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 3 + } + ] + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "table_function": { + "type": "Function", + "name": "numbers", + "arguments": [ + { + "type": "Literal", + "value_type": "UInt64", + "value": 100 + } + ] + } + } + } + ] + }, + "where": { + "type": "Function", + "name": "greater", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "number" + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 1 + } + ] + } + } + ] + } + } + }, + { + "type": "Subquery", + "alias": "max_n", + "query": { + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Function", + "name": "max", + "arguments": [ + { + "type": "Identifier", + "name": "n" + } + ] + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "recent" + } + } + } + ] + } + } + ] + } + } + ], + "select": [ + { + "type": "Identifier", + "alias": "grp", + "name": "a.g", + "name_parts": ["a", "g"] + }, + { + "type": "Function", + "alias": "total", + "name": "plus", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "a.n", + "name_parts": ["a", "n"] + }, + { + "type": "Identifier", + "name": "b.v", + "name_parts": ["b", "v"] + } + ] + }, + { + "type": "Function", + "alias": "scaled", + "name": "arrayMap", + "arguments": [ + { + "type": "Function", + "name": "lambda", + "is_operator": true, + "is_lambda_function": true, + "kind": "LAMBDA_FUNCTION", + "arguments": [ + { + "type": "Function", + "name": "tuple", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "e" + } + ] + }, + { + "type": "Function", + "name": "multiply", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "e" + }, + { + "type": "Identifier", + "name": "max_n" + } + ] + } + ] + }, + { + "type": "Function", + "name": "groupArray", + "arguments": [ + { + "type": "Identifier", + "name": "a.n", + "name_parts": ["a", "n"] + } + ] + } + ] + }, + { + "type": "Function", + "alias": "running", + "name": "sum", + "is_window_function": true, + "kind": "WINDOW_FUNCTION", + "arguments": [ + { + "type": "Identifier", + "name": "b.v", + "name_parts": ["b", "v"] + } + ], + "window_definition": { + "type": "WindowDefinition", + "partition_by": [ + { + "type": "Identifier", + "name": "a.g", + "name_parts": ["a", "g"] + } + ], + "order_by": [ + { + "type": "OrderByElement", + "expression": { + "type": "Identifier", + "name": "a.n", + "name_parts": ["a", "n"] + }, + "direction": "ASC" + } + ], + "frame_type": "ROWS", + "frame_begin_type": "Offset", + "frame_begin_offset": { + "type": "Literal", + "value_type": "UInt64", + "value": 1 + }, + "frame_begin_preceding": true, + "frame_end_type": "Current", + "frame_end_preceding": false + } + }, + { + "type": "Function", + "alias": "cnt", + "name": "count", + "is_window_function": true, + "kind": "WINDOW_FUNCTION", + "arguments": [ + { + "type": "Asterisk" + } + ], + "window_name": "w" + }, + { + "type": "Function", + "alias": "bucket", + "name": "multiIf", + "arguments": [ + { + "type": "Function", + "name": "greater", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "a.n", + "name_parts": ["a", "n"] + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 10 + } + ] + }, + { + "type": "Literal", + "value_type": "String", + "value": "hi" + }, + { + "type": "Literal", + "value_type": "String", + "value": "lo" + } + ] + }, + { + "type": "Function", + "alias": "nf", + "name": "CAST", + "arguments": [ + { + "type": "Identifier", + "name": "a.n", + "name_parts": ["a", "n"] + }, + { + "type": "Literal", + "value_type": "String", + "value": "Float64" + } + ] + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "alias": "a", + "name": "recent" + } + } + }, + { + "type": "TablesInSelectQueryElement", + "table_join": { + "type": "TableJoin", + "kind": "INNER", + "on": { + "type": "Function", + "name": "equals", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "a.n", + "name_parts": ["a", "n"] + }, + { + "type": "Identifier", + "name": "b.n", + "name_parts": ["b", "n"] + } + ] + } + }, + "table_expression": { + "type": "TableExpression", + "subquery": { + "type": "Subquery", + "alias": "b", + "query": { + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Identifier", + "name": "n" + }, + { + "type": "Function", + "alias": "v", + "name": "multiply", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "n" + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 2 + } + ] + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "recent" + } + } + } + ] + } + } + ] + } + } + } + } + ] + }, + "prewhere": { + "type": "Function", + "name": "notEquals", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "a.n", + "name_parts": ["a", "n"] + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 0 + } + ] + }, + "where": { + "type": "Function", + "name": "and", + "is_operator": true, + "arguments": [ + { + "type": "Function", + "name": "in", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "a.n", + "name_parts": ["a", "n"] + }, + { + "type": "Subquery", + "query": { + "type": "SelectWithUnionQuery", + "selects": [ + { + "type": "SelectQuery", + "select": [ + { + "type": "Identifier", + "name": "n" + } + ], + "tables": { + "type": "TablesInSelectQuery", + "children": [ + { + "type": "TablesInSelectQueryElement", + "table_expression": { + "type": "TableExpression", + "database_and_table_name": { + "type": "TableIdentifier", + "name": "recent" + } + } + } + ] + } + } + ] + } + } + ] + }, + { + "type": "Function", + "name": "and", + "is_operator": true, + "arguments": [ + { + "type": "Function", + "name": "greaterOrEquals", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "b.v", + "name_parts": ["b", "v"] + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 1 + } + ] + }, + { + "type": "Function", + "name": "lessOrEquals", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "b.v", + "name_parts": ["b", "v"] + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 1000 + } + ] + } + ] + } + ] + }, + "group_by": [ + { + "type": "Identifier", + "name": "a.g", + "name_parts": ["a", "g"] + }, + { + "type": "Identifier", + "name": "a.n", + "name_parts": ["a", "n"] + } + ], + "having": { + "type": "Function", + "name": "greater", + "is_operator": true, + "arguments": [ + { + "type": "Function", + "name": "sum", + "arguments": [ + { + "type": "Identifier", + "name": "b.v", + "name_parts": ["b", "v"] + } + ] + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 10 + } + ] + }, + "window": [ + { + "type": "WindowListElement", + "name": "w", + "definition": { + "type": "WindowDefinition", + "partition_by": [ + { + "type": "Identifier", + "name": "a.g", + "name_parts": ["a", "g"] + } + ], + "order_by": [ + { + "type": "OrderByElement", + "expression": { + "type": "Identifier", + "name": "a.n", + "name_parts": ["a", "n"] + }, + "direction": "DESC" + } + ] + } + } + ], + "qualify": { + "type": "Function", + "name": "greaterOrEquals", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "running" + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 0 + } + ] + }, + "order_by": [ + { + "type": "OrderByElement", + "expression": { + "type": "Identifier", + "name": "total" + }, + "direction": "DESC", + "nulls_first": false, + "with_fill": true, + "fill_from": { + "type": "Literal", + "value_type": "UInt64", + "value": 0 + }, + "fill_to": { + "type": "Literal", + "value_type": "UInt64", + "value": 100 + }, + "fill_step": { + "type": "Literal", + "value_type": "UInt64", + "value": 10 + } + } + ], + "limit_by_length": { + "type": "Literal", + "value_type": "UInt64", + "value": 5 + }, + "limit_by": [ + { + "type": "Identifier", + "name": "a.g", + "name_parts": ["a", "g"] + } + ], + "limit_offset": { + "type": "Literal", + "value_type": "UInt64", + "value": 10 + }, + "limit_length": { + "type": "Literal", + "value_type": "UInt64", + "value": 100 + }, + "settings": { + "type": "Set", + "changes": { + "max_threads": 4 + } + }, + "interpolate": [ + { + "type": "InterpolateElement", + "column": "nf", + "expr": { + "type": "Function", + "name": "plus", + "is_operator": true, + "arguments": [ + { + "type": "Identifier", + "name": "nf" + }, + { + "type": "Literal", + "value_type": "UInt64", + "value": 1 + } + ] + } + } + ] + } + ] +} diff --git a/tests/clickhouse-reference-ast-json/cases/41_showcase.sql b/tests/clickhouse-reference-ast-json/cases/41_showcase.sql new file mode 100644 index 000000000..736593d4a --- /dev/null +++ b/tests/clickhouse-reference-ast-json/cases/41_showcase.sql @@ -0,0 +1 @@ +WITH recent AS (SELECT number AS n, number % 3 AS g FROM numbers(100) WHERE number > 1), (SELECT max(n) FROM recent) AS max_n SELECT DISTINCT a.g AS grp, a.n + b.v AS total, arrayMap(e -> e * max_n, groupArray(a.n)) AS scaled, sum(b.v) OVER (PARTITION BY a.g ORDER BY a.n ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS running, count(*) OVER w AS cnt, CASE WHEN a.n > 10 THEN 'hi' ELSE 'lo' END AS bucket, CAST(a.n AS Float64) AS nf FROM recent AS a INNER JOIN (SELECT n, n * 2 AS v FROM recent) AS b ON a.n = b.n PREWHERE a.n != 0 WHERE a.n IN (SELECT n FROM recent) AND b.v BETWEEN 1 AND 1000 GROUP BY a.g, a.n WITH ROLLUP HAVING sum(b.v) > 10 WINDOW w AS (PARTITION BY a.g ORDER BY a.n DESC) QUALIFY running >= 0 ORDER BY total DESC NULLS LAST WITH FILL FROM 0 TO 100 STEP 10 INTERPOLATE (nf AS nf + 1) LIMIT 5 BY a.g LIMIT 100 OFFSET 10 SETTINGS max_threads = 4 diff --git a/tests/clickhouse-reference/00042_any_left_join.sql.expected.ast.json b/tests/clickhouse-reference/00042_any_left_join.sql.expected.ast.json index 745e00c1e..a6a963799 100644 --- a/tests/clickhouse-reference/00042_any_left_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00042_any_left_join.sql.expected.ast.json @@ -118,7 +118,8 @@ "columns": [ "EventDate" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00042_any_left_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00042_any_left_join.sql.expected.formatted.sql index 02b47a916..d010213d1 100644 --- a/tests/clickhouse-reference/00042_any_left_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00042_any_left_join.sql.expected.formatted.sql @@ -11,7 +11,7 @@ FROM FROM test.hits GROUP BY EventDate ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT StartDate AS EventDate, sum(Sign) AS visits diff --git a/tests/clickhouse-reference/00043_any_left_join.sql.expected.ast.json b/tests/clickhouse-reference/00043_any_left_join.sql.expected.ast.json index 05cca87a1..2cbfac334 100644 --- a/tests/clickhouse-reference/00043_any_left_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00043_any_left_join.sql.expected.ast.json @@ -93,7 +93,8 @@ "columns": [ "EventDate" ] - } + }, + "strictness": "ANY" }, "groupBy": { "kind": "expressions", diff --git a/tests/clickhouse-reference/00043_any_left_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00043_any_left_join.sql.expected.formatted.sql index aff110216..efb426e46 100644 --- a/tests/clickhouse-reference/00043_any_left_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00043_any_left_join.sql.expected.formatted.sql @@ -5,7 +5,7 @@ SELECT any(visits) FROM test.hits -LEFT JOIN ( +ANY LEFT JOIN ( SELECT StartDate AS EventDate, sum(Sign) AS visits diff --git a/tests/clickhouse-reference/00044_any_left_join_string.sql.expected.ast.json b/tests/clickhouse-reference/00044_any_left_join_string.sql.expected.ast.json index dcf2fc9ed..1116e952e 100644 --- a/tests/clickhouse-reference/00044_any_left_join_string.sql.expected.ast.json +++ b/tests/clickhouse-reference/00044_any_left_join_string.sql.expected.ast.json @@ -134,7 +134,8 @@ "columns": [ "domain" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00044_any_left_join_string.sql.expected.formatted.sql b/tests/clickhouse-reference/00044_any_left_join_string.sql.expected.formatted.sql index ea2a21a5a..f21b1b262 100644 --- a/tests/clickhouse-reference/00044_any_left_join_string.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00044_any_left_join_string.sql.expected.formatted.sql @@ -11,7 +11,7 @@ FROM FROM test.hits GROUP BY domain ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT domain(StartURL) AS domain, sum(Sign) AS visits diff --git a/tests/clickhouse-reference/00049_any_left_join.sql.expected.ast.json b/tests/clickhouse-reference/00049_any_left_join.sql.expected.ast.json index 2c8a670ad..2f621ec9f 100644 --- a/tests/clickhouse-reference/00049_any_left_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00049_any_left_join.sql.expected.ast.json @@ -105,7 +105,8 @@ "columns": [ "number" ] - } + }, + "strictness": "ANY" }, "limit": { "count": { diff --git a/tests/clickhouse-reference/00049_any_left_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00049_any_left_join.sql.expected.formatted.sql index 84f72f9e4..27f54f1e9 100644 --- a/tests/clickhouse-reference/00049_any_left_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00049_any_left_join.sql.expected.formatted.sql @@ -5,7 +5,7 @@ FROM ( joined FROM `system`.numbers - LEFT JOIN ( + ANY LEFT JOIN ( SELECT number * 2 AS number, number * 10 + 1 AS joined diff --git a/tests/clickhouse-reference/00050_any_left_join.sql.expected.ast.json b/tests/clickhouse-reference/00050_any_left_join.sql.expected.ast.json index 358b8790a..b028e223f 100644 --- a/tests/clickhouse-reference/00050_any_left_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00050_any_left_join.sql.expected.ast.json @@ -104,7 +104,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00050_any_left_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00050_any_left_join.sql.expected.formatted.sql index 3047eed46..20dd73012 100644 --- a/tests/clickhouse-reference/00050_any_left_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00050_any_left_join.sql.expected.formatted.sql @@ -7,7 +7,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS a -LEFT JOIN ( +ANY LEFT JOIN ( SELECT number * 2 AS k, number AS joined diff --git a/tests/clickhouse-reference/00051_any_inner_join.sql.expected.ast.json b/tests/clickhouse-reference/00051_any_inner_join.sql.expected.ast.json index 682153dd8..4c6d25baa 100644 --- a/tests/clickhouse-reference/00051_any_inner_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00051_any_inner_join.sql.expected.ast.json @@ -117,7 +117,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00051_any_inner_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00051_any_inner_join.sql.expected.formatted.sql index 0f59fcd8a..9aa94fb66 100644 --- a/tests/clickhouse-reference/00051_any_inner_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00051_any_inner_join.sql.expected.formatted.sql @@ -9,7 +9,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS a -INNER JOIN ( +ANY INNER JOIN ( SELECT number * 2 AS k, number AS joined diff --git a/tests/clickhouse-reference/00052_all_left_join.sql.expected.ast.json b/tests/clickhouse-reference/00052_all_left_join.sql.expected.ast.json index b2a598d4f..62477cfe0 100644 --- a/tests/clickhouse-reference/00052_all_left_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00052_all_left_join.sql.expected.ast.json @@ -97,7 +97,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00052_all_left_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00052_all_left_join.sql.expected.formatted.sql index a405b2c98..795f614e2 100644 --- a/tests/clickhouse-reference/00052_all_left_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00052_all_left_join.sql.expected.formatted.sql @@ -5,7 +5,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS js1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT intDiv(number, 2) AS k, number AS joined diff --git a/tests/clickhouse-reference/00053_all_inner_join.sql.expected.ast.json b/tests/clickhouse-reference/00053_all_inner_join.sql.expected.ast.json index c00653119..653e6b8cb 100644 --- a/tests/clickhouse-reference/00053_all_inner_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00053_all_inner_join.sql.expected.ast.json @@ -106,7 +106,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00053_all_inner_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00053_all_inner_join.sql.expected.formatted.sql index 4ae94cfa9..70b2ac26e 100644 --- a/tests/clickhouse-reference/00053_all_inner_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00053_all_inner_join.sql.expected.formatted.sql @@ -7,7 +7,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS a -INNER JOIN ( +ALL INNER JOIN ( SELECT intDiv(number, 2) AS k, number AS joined diff --git a/tests/clickhouse-reference/00054_join_string.sql.expected.ast.json b/tests/clickhouse-reference/00054_join_string.sql.expected.ast.json index 39ca33156..1243fe7ca 100644 --- a/tests/clickhouse-reference/00054_join_string.sql.expected.ast.json +++ b/tests/clickhouse-reference/00054_join_string.sql.expected.ast.json @@ -139,7 +139,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00054_join_string.sql.expected.formatted.sql b/tests/clickhouse-reference/00054_join_string.sql.expected.formatted.sql index 19bdd41da..38cea5f54 100644 --- a/tests/clickhouse-reference/00054_join_string.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00054_join_string.sql.expected.formatted.sql @@ -5,7 +5,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS js1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT reinterpretAsString(intDiv(number, 2) + reinterpretAsUInt8('A')) AS k, number AS joined diff --git a/tests/clickhouse-reference/00055_join_two_numbers.sql.expected.ast.json b/tests/clickhouse-reference/00055_join_two_numbers.sql.expected.ast.json index f4c02c9db..e940ec315 100644 --- a/tests/clickhouse-reference/00055_join_two_numbers.sql.expected.ast.json +++ b/tests/clickhouse-reference/00055_join_two_numbers.sql.expected.ast.json @@ -162,7 +162,8 @@ "k1", "k2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00055_join_two_numbers.sql.expected.formatted.sql b/tests/clickhouse-reference/00055_join_two_numbers.sql.expected.formatted.sql index 1eb812ba6..b4e128693 100644 --- a/tests/clickhouse-reference/00055_join_two_numbers.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00055_join_two_numbers.sql.expected.formatted.sql @@ -10,7 +10,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS js1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT number % 2 AS k1, number % 6 AS k2, diff --git a/tests/clickhouse-reference/00056_join_number_string.sql.expected.ast.json b/tests/clickhouse-reference/00056_join_number_string.sql.expected.ast.json index a5365f3f8..cb82cee67 100644 --- a/tests/clickhouse-reference/00056_join_number_string.sql.expected.ast.json +++ b/tests/clickhouse-reference/00056_join_number_string.sql.expected.ast.json @@ -174,7 +174,8 @@ "k1", "k2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00056_join_number_string.sql.expected.formatted.sql b/tests/clickhouse-reference/00056_join_number_string.sql.expected.formatted.sql index 2e79cbcab..2e7025bec 100644 --- a/tests/clickhouse-reference/00056_join_number_string.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00056_join_number_string.sql.expected.formatted.sql @@ -10,7 +10,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS js1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT number % 2 AS k1, toString(number % 6) AS k2, diff --git a/tests/clickhouse-reference/00057_join_aliases.sql.expected.ast.json b/tests/clickhouse-reference/00057_join_aliases.sql.expected.ast.json index 5a57e49f4..ebb74082a 100644 --- a/tests/clickhouse-reference/00057_join_aliases.sql.expected.ast.json +++ b/tests/clickhouse-reference/00057_join_aliases.sql.expected.ast.json @@ -155,7 +155,8 @@ "columns": [ "n" ] - } + }, + "strictness": "ANY" }, "limit": { "count": { diff --git a/tests/clickhouse-reference/00057_join_aliases.sql.expected.formatted.sql b/tests/clickhouse-reference/00057_join_aliases.sql.expected.formatted.sql index 923770a30..ec20585aa 100644 --- a/tests/clickhouse-reference/00057_join_aliases.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00057_join_aliases.sql.expected.formatted.sql @@ -14,7 +14,7 @@ FROM ( number / 2 AS n FROM `system`.numbers ) AS js1 - LEFT JOIN ( + ANY LEFT JOIN ( SELECT number / 3 AS n, number AS j1, diff --git a/tests/clickhouse-reference/00063_loyalty_joins.sql.expected.ast.json b/tests/clickhouse-reference/00063_loyalty_joins.sql.expected.ast.json index 45feb938a..de21d987e 100644 --- a/tests/clickhouse-reference/00063_loyalty_joins.sql.expected.ast.json +++ b/tests/clickhouse-reference/00063_loyalty_joins.sql.expected.ast.json @@ -301,7 +301,8 @@ "columns": [ "UserID" ] - } + }, + "strictness": "ANY" }, "groupBy": { "kind": "expressions", @@ -614,7 +615,8 @@ "columns": [ "UserID" ] - } + }, + "strictness": "ANY" }, "groupBy": { "kind": "expressions", @@ -945,7 +947,8 @@ "columns": [ "UserID" ] - } + }, + "strictness": "ANY" } } }, @@ -1330,7 +1333,8 @@ "columns": [ "UserID" ] - } + }, + "strictness": "ANY" }, "groupBy": { "kind": "expressions", diff --git a/tests/clickhouse-reference/00063_loyalty_joins.sql.expected.formatted.sql b/tests/clickhouse-reference/00063_loyalty_joins.sql.expected.formatted.sql index 57d31dcdf..03436be7f 100644 --- a/tests/clickhouse-reference/00063_loyalty_joins.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00063_loyalty_joins.sql.expected.formatted.sql @@ -8,7 +8,7 @@ SELECT count() FROM test.hits -LEFT JOIN ( +ANY LEFT JOIN ( SELECT UserID, sum(SearchEngineID = 2) AS yandex, @@ -32,7 +32,7 @@ FROM SELECT UserID FROM test.hits ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT UserID, sum(SearchEngineID = 2) AS yandex, @@ -60,7 +60,7 @@ FROM ( SELECT UserID FROM test.hits ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT UserID, sum(SearchEngineID = 2) AS yandex, @@ -83,7 +83,7 @@ SELECT bar(log(c + 1) * 1000, 0, log(3000000) * 1000, 80) FROM test.hits -INNER JOIN ( +ANY INNER JOIN ( SELECT UserID, toInt8(if(yandex > google, yandex / ((yandex + google)), negate(google) / ((yandex + google))) * 10) AS loyalty diff --git a/tests/clickhouse-reference/00065_loyalty_with_storage_join.sql.expected.ast.json b/tests/clickhouse-reference/00065_loyalty_with_storage_join.sql.expected.ast.json index c1f41173b..bd03c03d8 100644 --- a/tests/clickhouse-reference/00065_loyalty_with_storage_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00065_loyalty_with_storage_join.sql.expected.ast.json @@ -331,7 +331,8 @@ "columns": [ "UserID" ] - } + }, + "strictness": "SEMI" }, "groupBy": { "kind": "expressions", diff --git a/tests/clickhouse-reference/00065_loyalty_with_storage_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00065_loyalty_with_storage_join.sql.expected.formatted.sql index 8388eac5f..78256587d 100644 --- a/tests/clickhouse-reference/00065_loyalty_with_storage_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00065_loyalty_with_storage_join.sql.expected.formatted.sql @@ -22,7 +22,7 @@ SELECT count() FROM test.hits -LEFT JOIN `join` +SEMI LEFT JOIN `join` USING (UserID) GROUP BY loyalty ORDER BY loyalty ASC; diff --git a/tests/clickhouse-reference/00074_full_join.sql.expected.ast.json b/tests/clickhouse-reference/00074_full_join.sql.expected.ast.json index 29f6666bb..0209fe629 100644 --- a/tests/clickhouse-reference/00074_full_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00074_full_join.sql.expected.ast.json @@ -186,7 +186,8 @@ "columns": [ "CounterID" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "naryExpr", @@ -431,7 +432,8 @@ "columns": [ "CounterID" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "naryExpr", @@ -676,7 +678,8 @@ "columns": [ "CounterID" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "naryExpr", @@ -921,7 +924,8 @@ "columns": [ "CounterID" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "naryExpr", diff --git a/tests/clickhouse-reference/00074_full_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00074_full_join.sql.expected.formatted.sql index 5a624a269..dff268517 100644 --- a/tests/clickhouse-reference/00074_full_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00074_full_join.sql.expected.formatted.sql @@ -15,7 +15,7 @@ FROM FROM test.hits GROUP BY CounterID ) -FULL JOIN ( +ANY FULL JOIN ( SELECT (CounterID % 100000) AS CounterID, sum(Sign) AS visits @@ -43,7 +43,7 @@ FROM FROM test.hits GROUP BY CounterID ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT (CounterID % 100000) AS CounterID, sum(Sign) AS visits @@ -71,7 +71,7 @@ FROM FROM test.hits GROUP BY CounterID ) -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT (CounterID % 100000) AS CounterID, sum(Sign) AS visits @@ -99,7 +99,7 @@ FROM FROM test.hits GROUP BY CounterID ) -INNER JOIN ( +ANY INNER JOIN ( SELECT (CounterID % 100000) AS CounterID, sum(Sign) AS visits diff --git a/tests/clickhouse-reference/00098_l_union_all.sql.expected.ast.json b/tests/clickhouse-reference/00098_l_union_all.sql.expected.ast.json index e304001d7..cf379b1f9 100644 --- a/tests/clickhouse-reference/00098_l_union_all.sql.expected.ast.json +++ b/tests/clickhouse-reference/00098_l_union_all.sql.expected.ast.json @@ -170,7 +170,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -373,7 +374,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -577,7 +579,8 @@ "a", "b" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00098_l_union_all.sql.expected.formatted.sql b/tests/clickhouse-reference/00098_l_union_all.sql.expected.formatted.sql index fe1c30a30..d8d90933b 100644 --- a/tests/clickhouse-reference/00098_l_union_all.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00098_l_union_all.sql.expected.formatted.sql @@ -17,7 +17,7 @@ FROM 3, 4 ) AS js1 -INNER JOIN ( +ANY INNER JOIN ( SELECT 1 AS a, 2 AS b, @@ -52,7 +52,7 @@ FROM 3, 4 ) AS js1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT 1 AS a, 2 AS b, @@ -87,7 +87,7 @@ FROM 3, 4 ) AS js1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT 1 AS a, 2 AS b, diff --git a/tests/clickhouse-reference/00099_join_many_blocks_segfault.sql.expected.ast.json b/tests/clickhouse-reference/00099_join_many_blocks_segfault.sql.expected.ast.json index cb6e08fa9..035c536bb 100644 --- a/tests/clickhouse-reference/00099_join_many_blocks_segfault.sql.expected.ast.json +++ b/tests/clickhouse-reference/00099_join_many_blocks_segfault.sql.expected.ast.json @@ -101,7 +101,8 @@ "columns": [ "DomainID" ] - } + }, + "strictness": "ANY" } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/00099_join_many_blocks_segfault.sql.expected.formatted.sql b/tests/clickhouse-reference/00099_join_many_blocks_segfault.sql.expected.formatted.sql index 120524737..dfe098ee5 100644 --- a/tests/clickhouse-reference/00099_join_many_blocks_segfault.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00099_join_many_blocks_segfault.sql.expected.formatted.sql @@ -6,7 +6,7 @@ FROM SELECT 1 AS DomainID FROM `system`.one ) AS js1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 1 AS DomainID, 'abc' AS Domain diff --git a/tests/clickhouse-reference/00118_storage_join.sql.expected.ast.json b/tests/clickhouse-reference/00118_storage_join.sql.expected.ast.json index 448c0f009..00fc36f3d 100644 --- a/tests/clickhouse-reference/00118_storage_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00118_storage_join.sql.expected.ast.json @@ -123,7 +123,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -225,7 +226,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -324,7 +326,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -463,7 +466,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -570,7 +574,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -684,7 +689,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -815,7 +821,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00118_storage_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00118_storage_join.sql.expected.formatted.sql index d4d89af95..cc94ee92b 100644 --- a/tests/clickhouse-reference/00118_storage_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00118_storage_join.sql.expected.formatted.sql @@ -18,7 +18,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS js1 -LEFT JOIN t2 +ANY LEFT JOIN t2 USING (k) ORDER BY k ASC; @@ -36,7 +36,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS js1 -LEFT JOIN t2 +ANY LEFT JOIN t2 USING (k) ORDER BY k ASC; @@ -53,7 +53,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS js1 -LEFT JOIN t2 +ANY LEFT JOIN t2 USING (k) ORDER BY k ASC; @@ -70,7 +70,7 @@ FROM GROUP BY toUInt64(number / 3) WITH TOTALS ) AS js1 -LEFT JOIN t2 +ANY LEFT JOIN t2 USING (k) ORDER BY k ASC; @@ -86,7 +86,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS js1 -LEFT JOIN t2 +ANY LEFT JOIN t2 ON js1.k == t2.k ORDER BY k ASC; @@ -103,7 +103,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS js1 -LEFT JOIN t2 +ANY LEFT JOIN t2 ON js1.k == t2.k ORDER BY k ASC; @@ -119,7 +119,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS js1 -LEFT JOIN t2 +ANY LEFT JOIN t2 ON js1.k == t2.k OR js1.s == t2.k ORDER BY k ASC; -- { serverError NOT_IMPLEMENTED, INCOMPATIBLE_TYPE_OF_JOIN } diff --git a/tests/clickhouse-reference/00119_storage_join.sql.expected.ast.json b/tests/clickhouse-reference/00119_storage_join.sql.expected.ast.json index cd168e401..7390935b3 100644 --- a/tests/clickhouse-reference/00119_storage_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00119_storage_join.sql.expected.ast.json @@ -186,7 +186,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" } }, { @@ -248,7 +249,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" } }, { @@ -316,7 +318,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" } }, { @@ -404,7 +407,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" } }, { @@ -508,7 +512,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" } }, { diff --git a/tests/clickhouse-reference/00119_storage_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00119_storage_join.sql.expected.formatted.sql index b4a836fbb..55237aa44 100644 --- a/tests/clickhouse-reference/00119_storage_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00119_storage_join.sql.expected.formatted.sql @@ -23,7 +23,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS js1 -LEFT JOIN t2 +ANY LEFT JOIN t2 USING (k); SELECT @@ -35,7 +35,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS js1 -LEFT JOIN t2 +ANY LEFT JOIN t2 USING (k); SELECT @@ -48,7 +48,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS js1 -LEFT JOIN t2 +ANY LEFT JOIN t2 USING (k); SELECT @@ -65,7 +65,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS js1 -LEFT JOIN t2 +ANY LEFT JOIN t2 USING (k); SELECT @@ -82,7 +82,7 @@ FROM WITH TOTALS ORDER BY number ASC ) AS t1 -LEFT JOIN t2 AS t2 +ANY LEFT JOIN t2 AS t2 USING (k); DROP TABLE t2; \ No newline at end of file diff --git a/tests/clickhouse-reference/00120_join_and_group_by.sql.expected.ast.json b/tests/clickhouse-reference/00120_join_and_group_by.sql.expected.ast.json index 6a724eced..d4950d94b 100644 --- a/tests/clickhouse-reference/00120_join_and_group_by.sql.expected.ast.json +++ b/tests/clickhouse-reference/00120_join_and_group_by.sql.expected.ast.json @@ -47,7 +47,8 @@ "columns": [ "dummy" ] - } + }, + "strictness": "ANY" }, "groupBy": { "kind": "expressions", @@ -183,7 +184,8 @@ "columns": [ "number" ] - } + }, + "strictness": "ANY" }, "groupBy": { "kind": "expressions", diff --git a/tests/clickhouse-reference/00120_join_and_group_by.sql.expected.formatted.sql b/tests/clickhouse-reference/00120_join_and_group_by.sql.expected.formatted.sql index aa7b00197..48e2faa6f 100644 --- a/tests/clickhouse-reference/00120_join_and_group_by.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00120_join_and_group_by.sql.expected.formatted.sql @@ -1,7 +1,7 @@ SELECT value FROM `system`.one -LEFT JOIN ( +ANY LEFT JOIN ( SELECT dummy, dummy AS value @@ -21,7 +21,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS js1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT number, intHash32(number) AS value2 diff --git a/tests/clickhouse-reference/00122_join_with_subquery_with_subquery.sql.expected.ast.json b/tests/clickhouse-reference/00122_join_with_subquery_with_subquery.sql.expected.ast.json index be97fc48f..88b9b4f0c 100644 --- a/tests/clickhouse-reference/00122_join_with_subquery_with_subquery.sql.expected.ast.json +++ b/tests/clickhouse-reference/00122_join_with_subquery_with_subquery.sql.expected.ast.json @@ -81,7 +81,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/00122_join_with_subquery_with_subquery.sql.expected.formatted.sql b/tests/clickhouse-reference/00122_join_with_subquery_with_subquery.sql.expected.formatted.sql index 87872dbd2..e2af417e8 100644 --- a/tests/clickhouse-reference/00122_join_with_subquery_with_subquery.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00122_join_with_subquery_with_subquery.sql.expected.formatted.sql @@ -4,7 +4,7 @@ FROM SELECT 1 AS k FROM `system`.one ) AS js1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT k FROM ( SELECT diff --git a/tests/clickhouse-reference/00138_table_aliases.sql.expected.ast.json b/tests/clickhouse-reference/00138_table_aliases.sql.expected.ast.json index 0cbcd949c..30d3cf4dc 100644 --- a/tests/clickhouse-reference/00138_table_aliases.sql.expected.ast.json +++ b/tests/clickhouse-reference/00138_table_aliases.sql.expected.ast.json @@ -87,7 +87,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/00138_table_aliases.sql.expected.formatted.sql b/tests/clickhouse-reference/00138_table_aliases.sql.expected.formatted.sql index 2b7ace178..1963473f0 100644 --- a/tests/clickhouse-reference/00138_table_aliases.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00138_table_aliases.sql.expected.formatted.sql @@ -9,7 +9,7 @@ FROM SELECT 1 AS k FROM `system`.one ) AS xxx -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 1 AS k, 'Hello' AS s diff --git a/tests/clickhouse-reference/00150_with_totals_and_join.sql.expected.ast.json b/tests/clickhouse-reference/00150_with_totals_and_join.sql.expected.ast.json index a63e4db35..e4d9ebcb1 100644 --- a/tests/clickhouse-reference/00150_with_totals_and_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00150_with_totals_and_join.sql.expected.ast.json @@ -200,7 +200,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -404,7 +405,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -608,7 +610,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -813,7 +816,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00150_with_totals_and_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00150_with_totals_and_join.sql.expected.formatted.sql index 6b884deb7..964b1684f 100644 --- a/tests/clickhouse-reference/00150_with_totals_and_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00150_with_totals_and_join.sql.expected.formatted.sql @@ -16,7 +16,7 @@ FROM ) GROUP BY k ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT intDiv(number, 4) AS k, sum(number) AS s2 @@ -47,7 +47,7 @@ FROM GROUP BY k WITH TOTALS ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT intDiv(number, 4) AS k, sum(number) AS s2 @@ -77,7 +77,7 @@ FROM ) GROUP BY k ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT intDiv(number, 4) AS k, sum(number) AS s2 @@ -109,7 +109,7 @@ FROM GROUP BY k WITH TOTALS ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT intDiv(number, 4) AS k, sum(number) AS s2 diff --git a/tests/clickhouse-reference/00162_shard_global_join.sql.expected.ast.json b/tests/clickhouse-reference/00162_shard_global_join.sql.expected.ast.json index 495ac8c09..8c2a29152 100644 --- a/tests/clickhouse-reference/00162_shard_global_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00162_shard_global_join.sql.expected.ast.json @@ -140,7 +140,9 @@ "columns": [ "n" ] - } + }, + "strictness": "ANY", + "global": true }, "limit": { "count": { diff --git a/tests/clickhouse-reference/00162_shard_global_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00162_shard_global_join.sql.expected.formatted.sql index 503ef9a0b..08941fafe 100644 --- a/tests/clickhouse-reference/00162_shard_global_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00162_shard_global_join.sql.expected.formatted.sql @@ -8,7 +8,7 @@ FROM SELECT toFloat64(dummy + 2) AS n FROM remote('127.0.0.{2,3}', `system`.one) ) AS jr1 -LEFT JOIN ( +GLOBAL ANY LEFT JOIN ( SELECT number / 3 AS n, number AS j1, diff --git a/tests/clickhouse-reference/00163_shard_join_with_empty_table.sql.expected.ast.json b/tests/clickhouse-reference/00163_shard_join_with_empty_table.sql.expected.ast.json index b3aa319a9..75b90b290 100644 --- a/tests/clickhouse-reference/00163_shard_join_with_empty_table.sql.expected.ast.json +++ b/tests/clickhouse-reference/00163_shard_join_with_empty_table.sql.expected.ast.json @@ -195,7 +195,8 @@ "columns": [ "n" ] - } + }, + "strictness": "ANY" }, "limit": { "count": { @@ -386,7 +387,8 @@ "columns": [ "n" ] - } + }, + "strictness": "ANY" }, "limit": { "count": { @@ -564,7 +566,9 @@ "columns": [ "n" ] - } + }, + "strictness": "ANY", + "global": true }, "limit": { "count": { @@ -755,7 +759,9 @@ "columns": [ "n" ] - } + }, + "strictness": "ANY", + "global": true }, "limit": { "count": { diff --git a/tests/clickhouse-reference/00163_shard_join_with_empty_table.sql.expected.formatted.sql b/tests/clickhouse-reference/00163_shard_join_with_empty_table.sql.expected.formatted.sql index da4243a74..217123e19 100644 --- a/tests/clickhouse-reference/00163_shard_join_with_empty_table.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00163_shard_join_with_empty_table.sql.expected.formatted.sql @@ -19,7 +19,7 @@ FROM ( number / 2 AS n FROM remote('127.0.0.{2,3}', `system`.numbers) ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT number / 3 AS n, number AS j1, @@ -46,7 +46,7 @@ FROM ( number / 2 AS n FROM remote('127.0.0.{2,3}', `system`.one) ) - INNER JOIN ( + ANY INNER JOIN ( SELECT number / 3 AS n, number AS j1, @@ -73,7 +73,7 @@ FROM ( number / 2 AS n FROM remote('127.0.0.{2,3}', `system`.numbers) ) - LEFT JOIN ( + GLOBAL ANY LEFT JOIN ( SELECT number / 3 AS n, number AS j1, @@ -100,7 +100,7 @@ FROM ( number / 2 AS n FROM remote('127.0.0.{2,3}', `system`.one) ) - INNER JOIN ( + GLOBAL ANY INNER JOIN ( SELECT number / 3 AS n, number AS j1, diff --git a/tests/clickhouse-reference/00169_join_constant_keys.sql.expected.ast.json b/tests/clickhouse-reference/00169_join_constant_keys.sql.expected.ast.json index 7b6f12760..457abf96d 100644 --- a/tests/clickhouse-reference/00169_join_constant_keys.sql.expected.ast.json +++ b/tests/clickhouse-reference/00169_join_constant_keys.sql.expected.ast.json @@ -146,7 +146,8 @@ "key2", "key1" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00169_join_constant_keys.sql.expected.formatted.sql b/tests/clickhouse-reference/00169_join_constant_keys.sql.expected.formatted.sql index 691184ff8..b9dd7cee2 100644 --- a/tests/clickhouse-reference/00169_join_constant_keys.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00169_join_constant_keys.sql.expected.formatted.sql @@ -9,7 +9,7 @@ FROM 0 AS key2, 999 AS table_1 ) AS js1 -INNER JOIN ( +ALL INNER JOIN ( SELECT arrayJoin([1, 3, 2]) AS key1, 0 AS key2, diff --git a/tests/clickhouse-reference/00181_aggregate_functions_statistics.sql.expected.ast.json b/tests/clickhouse-reference/00181_aggregate_functions_statistics.sql.expected.ast.json index 5ee2120b8..611896cb5 100644 --- a/tests/clickhouse-reference/00181_aggregate_functions_statistics.sql.expected.ast.json +++ b/tests/clickhouse-reference/00181_aggregate_functions_statistics.sql.expected.ast.json @@ -3605,7 +3605,8 @@ "columns": [ "ID" ] - } + }, + "strictness": "ANY" } } } @@ -3616,7 +3617,8 @@ "columns": [ "ID2" ] - } + }, + "strictness": "ANY" } }, { @@ -4091,7 +4093,8 @@ "columns": [ "ID" ] - } + }, + "strictness": "ANY" } } } @@ -4102,7 +4105,8 @@ "columns": [ "ID2" ] - } + }, + "strictness": "ANY" } }, { diff --git a/tests/clickhouse-reference/00181_aggregate_functions_statistics.sql.expected.formatted.sql b/tests/clickhouse-reference/00181_aggregate_functions_statistics.sql.expected.formatted.sql index 859a5b923..27733ccbf 100644 --- a/tests/clickhouse-reference/00181_aggregate_functions_statistics.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00181_aggregate_functions_statistics.sql.expected.formatted.sql @@ -225,7 +225,7 @@ FROM covarSamp(x_value, y_value) AS COVAR1 FROM series ) -INNER JOIN ( +ANY INNER JOIN ( SELECT arrayJoin([1]) AS ID2, sum(VAL) / ((count() - 1)) AS COVAR2 @@ -239,7 +239,7 @@ INNER JOIN ( avg(y_value) AS AVG_Y FROM series ) - INNER JOIN ( + ANY INNER JOIN ( SELECT i AS ID, x_value AS X, @@ -278,7 +278,7 @@ FROM covarPop(x_value, y_value) AS COVAR1 FROM series ) -INNER JOIN ( +ANY INNER JOIN ( SELECT arrayJoin([1]) AS ID2, sum(VAL) / count() AS COVAR2 @@ -292,7 +292,7 @@ INNER JOIN ( avg(y_value) AS AVG_Y FROM series ) - INNER JOIN ( + ANY INNER JOIN ( SELECT i AS ID, x_value AS X, diff --git a/tests/clickhouse-reference/00181_aggregate_functions_statistics_stable.sql.expected.ast.json b/tests/clickhouse-reference/00181_aggregate_functions_statistics_stable.sql.expected.ast.json index fd948a76e..97314ff80 100644 --- a/tests/clickhouse-reference/00181_aggregate_functions_statistics_stable.sql.expected.ast.json +++ b/tests/clickhouse-reference/00181_aggregate_functions_statistics_stable.sql.expected.ast.json @@ -1539,7 +1539,8 @@ "columns": [ "ID" ] - } + }, + "strictness": "ANY" } } } @@ -1550,7 +1551,8 @@ "columns": [ "ID2" ] - } + }, + "strictness": "ANY" } }, { @@ -2025,7 +2027,8 @@ "columns": [ "ID" ] - } + }, + "strictness": "ANY" } } } @@ -2036,7 +2039,8 @@ "columns": [ "ID2" ] - } + }, + "strictness": "ANY" } }, { diff --git a/tests/clickhouse-reference/00181_aggregate_functions_statistics_stable.sql.expected.formatted.sql b/tests/clickhouse-reference/00181_aggregate_functions_statistics_stable.sql.expected.formatted.sql index 7f29e3801..4039a5898 100644 --- a/tests/clickhouse-reference/00181_aggregate_functions_statistics_stable.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00181_aggregate_functions_statistics_stable.sql.expected.formatted.sql @@ -133,7 +133,7 @@ FROM covarSampStable(x_value, y_value) AS COVAR1 FROM series ) -INNER JOIN ( +ANY INNER JOIN ( SELECT arrayJoin([1]) AS ID2, sum(VAL) / ((count() - 1)) AS COVAR2 @@ -147,7 +147,7 @@ INNER JOIN ( avg(y_value) AS AVG_Y FROM series ) - INNER JOIN ( + ANY INNER JOIN ( SELECT i AS ID, x_value AS X, @@ -186,7 +186,7 @@ FROM covarPopStable(x_value, y_value) AS COVAR1 FROM series ) -INNER JOIN ( +ANY INNER JOIN ( SELECT arrayJoin([1]) AS ID2, sum(VAL) / count() AS COVAR2 @@ -200,7 +200,7 @@ INNER JOIN ( avg(y_value) AS AVG_Y FROM series ) - INNER JOIN ( + ANY INNER JOIN ( SELECT i AS ID, x_value AS X, diff --git a/tests/clickhouse-reference/00181_cross_join_compression.sql.expected.ast.json b/tests/clickhouse-reference/00181_cross_join_compression.sql.expected.ast.json index acd123600..c59eb5b1d 100644 --- a/tests/clickhouse-reference/00181_cross_join_compression.sql.expected.ast.json +++ b/tests/clickhouse-reference/00181_cross_join_compression.sql.expected.ast.json @@ -43,6 +43,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "database": "test", diff --git a/tests/clickhouse-reference/00181_cross_join_compression.sql.expected.formatted.sql b/tests/clickhouse-reference/00181_cross_join_compression.sql.expected.formatted.sql index 9d1f4d230..263b983ce 100644 --- a/tests/clickhouse-reference/00181_cross_join_compression.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00181_cross_join_compression.sql.expected.formatted.sql @@ -8,6 +8,6 @@ SELECT StartURL FROM unit -CROSS JOIN test.visits +, test.visits ORDER BY (CounterID, StartURL) DESC LIMIT 1000; \ No newline at end of file diff --git a/tests/clickhouse-reference/00203_full_join.sql.expected.ast.json b/tests/clickhouse-reference/00203_full_join.sql.expected.ast.json index c4d7bb0e5..4f3ebd9f5 100644 --- a/tests/clickhouse-reference/00203_full_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00203_full_join.sql.expected.ast.json @@ -158,7 +158,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -315,7 +316,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -472,7 +474,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -629,7 +632,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -780,7 +784,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -943,7 +948,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -1100,7 +1106,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -1257,7 +1264,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -1414,7 +1422,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -1565,7 +1574,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -1765,7 +1775,8 @@ "k1", "k2" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1852,7 +1863,8 @@ "k1", "k2" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00203_full_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00203_full_join.sql.expected.formatted.sql index 5aaa351fe..57aac7515 100644 --- a/tests/clickhouse-reference/00203_full_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00203_full_join.sql.expected.formatted.sql @@ -12,7 +12,7 @@ FROM arrayJoin([1, 2, 3]) AS k, 'Hello' AS x ) -FULL JOIN ( +ANY FULL JOIN ( SELECT range(k) AS y, arrayJoin([3, 4, 5]) AS k @@ -30,7 +30,7 @@ FROM arrayJoin([1, 2, 3]) AS k, 'Hello' AS x ) -FULL JOIN ( +ANY FULL JOIN ( SELECT range(k) AS y, arrayJoin([3, 4, 5]) AS k @@ -48,7 +48,7 @@ FROM arrayJoin([1, 2, 3]) AS k, 'Hello' AS x ) -FULL JOIN ( +ANY FULL JOIN ( SELECT range(k) AS y, arrayJoin([3, 4, 5]) AS k @@ -66,7 +66,7 @@ FROM arrayJoin([1, 2, 3]) AS k, 'Hello' AS x ) -FULL JOIN ( +ANY FULL JOIN ( SELECT range(k) AS y, arrayJoin([3, 4, 5]) AS k @@ -82,7 +82,7 @@ FROM arrayJoin([1, 2, 3]) AS k, 'Hello' AS x ) -FULL JOIN ( +ANY FULL JOIN ( SELECT range(k) AS y, arrayJoin([3, 4, 5]) AS k @@ -101,7 +101,7 @@ FROM arrayJoin([1, 2, 3]) AS k, 'Hello' AS x ) -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT range(k) AS y, arrayJoin([3, 4, 5]) AS k @@ -119,7 +119,7 @@ FROM arrayJoin([1, 2, 3]) AS k, 'Hello' AS x ) -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT range(k) AS y, arrayJoin([3, 4, 5]) AS k @@ -137,7 +137,7 @@ FROM arrayJoin([1, 2, 3]) AS k, 'Hello' AS x ) -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT range(k) AS y, arrayJoin([3, 4, 5]) AS k @@ -155,7 +155,7 @@ FROM arrayJoin([1, 2, 3]) AS k, 'Hello' AS x ) -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT range(k) AS y, arrayJoin([3, 4, 5]) AS k @@ -171,7 +171,7 @@ FROM arrayJoin([1, 2, 3]) AS k, 'Hello' AS x ) -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT range(k) AS y, arrayJoin([3, 4, 5]) AS k @@ -214,7 +214,7 @@ SELECT val_t2 FROM t1_00203 -FULL JOIN t2_00203 +ANY FULL JOIN t2_00203 USING (k3, k1, k2) ORDER BY k1 ASC, @@ -229,7 +229,7 @@ SELECT val_t2 FROM t1_00203 -RIGHT JOIN t2_00203 +ANY RIGHT JOIN t2_00203 USING (k3, k1, k2) ORDER BY k1 ASC, diff --git a/tests/clickhouse-reference/00217_shard_global_subquery_columns_with_same_name.sql.expected.ast.json b/tests/clickhouse-reference/00217_shard_global_subquery_columns_with_same_name.sql.expected.ast.json index 5f2d13928..52cd313ad 100644 --- a/tests/clickhouse-reference/00217_shard_global_subquery_columns_with_same_name.sql.expected.ast.json +++ b/tests/clickhouse-reference/00217_shard_global_subquery_columns_with_same_name.sql.expected.ast.json @@ -106,7 +106,9 @@ "columns": [ "k" ] - } + }, + "strictness": "ALL", + "global": true } }, { diff --git a/tests/clickhouse-reference/00217_shard_global_subquery_columns_with_same_name.sql.expected.formatted.sql b/tests/clickhouse-reference/00217_shard_global_subquery_columns_with_same_name.sql.expected.formatted.sql index 6b42cb84f..606c08cf3 100644 --- a/tests/clickhouse-reference/00217_shard_global_subquery_columns_with_same_name.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00217_shard_global_subquery_columns_with_same_name.sql.expected.formatted.sql @@ -9,7 +9,7 @@ FROM SELECT 42 AS k FROM remote('127.0.0.2', `system`.one) ) -FULL JOIN ( +GLOBAL ALL FULL JOIN ( SELECT 42 AS k, 1 AS a, diff --git a/tests/clickhouse-reference/00219_full_right_join_column_order.sql.expected.ast.json b/tests/clickhouse-reference/00219_full_right_join_column_order.sql.expected.ast.json index 5a90717c0..14911ede2 100644 --- a/tests/clickhouse-reference/00219_full_right_join_column_order.sql.expected.ast.json +++ b/tests/clickhouse-reference/00219_full_right_join_column_order.sql.expected.ast.json @@ -91,7 +91,8 @@ "a", "b" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -195,7 +196,8 @@ "b", "a" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -327,7 +329,8 @@ "a", "b" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -459,7 +462,8 @@ "b", "a" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00219_full_right_join_column_order.sql.expected.formatted.sql b/tests/clickhouse-reference/00219_full_right_join_column_order.sql.expected.formatted.sql index f530823e7..850c05a8f 100644 --- a/tests/clickhouse-reference/00219_full_right_join_column_order.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00219_full_right_join_column_order.sql.expected.formatted.sql @@ -9,7 +9,7 @@ FROM 1 AS a, 2000 AS b ) AS js1 -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT 2 AS a, 3000 AS b @@ -28,7 +28,7 @@ FROM 1 AS a, 2000 AS b ) AS js1 -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT 2 AS a, 3000 AS b @@ -47,7 +47,7 @@ FROM 1 AS a, 2000 AS b ) AS js1 -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT 2 AS a, 3000 AS b @@ -70,7 +70,7 @@ FROM 1 AS a, 2000 AS b ) AS js1 -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT 2 AS a, 3000 AS b diff --git a/tests/clickhouse-reference/00225_join_duplicate_columns.sql.expected.ast.json b/tests/clickhouse-reference/00225_join_duplicate_columns.sql.expected.ast.json index c8c76c4ae..219034b1a 100644 --- a/tests/clickhouse-reference/00225_join_duplicate_columns.sql.expected.ast.json +++ b/tests/clickhouse-reference/00225_join_duplicate_columns.sql.expected.ast.json @@ -102,7 +102,8 @@ "columns": [ "c" ] - } + }, + "strictness": "ANY" } }, { @@ -186,7 +187,8 @@ "columns": [ "c" ] - } + }, + "strictness": "ANY" } }, { @@ -369,7 +371,8 @@ "columns": [ "c" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00225_join_duplicate_columns.sql.expected.formatted.sql b/tests/clickhouse-reference/00225_join_duplicate_columns.sql.expected.formatted.sql index 057546d3c..f1cb7dd5c 100644 --- a/tests/clickhouse-reference/00225_join_duplicate_columns.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00225_join_duplicate_columns.sql.expected.formatted.sql @@ -14,7 +14,7 @@ FROM 1 AS a, 42 AS c ) AS js1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 2 AS b, 2 AS b, @@ -29,7 +29,7 @@ FROM 1 AS a, 42 AS c ) AS js1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 2 AS b, 2 AS b, @@ -54,7 +54,7 @@ FROM a ASC, c ASC ) AS js1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 2 AS b, 2 AS b, diff --git a/tests/clickhouse-reference/00316_rounding_functions_and_empty_block.sql.expected.ast.json b/tests/clickhouse-reference/00316_rounding_functions_and_empty_block.sql.expected.ast.json index 2a76fb83f..ea5c35d62 100644 --- a/tests/clickhouse-reference/00316_rounding_functions_and_empty_block.sql.expected.ast.json +++ b/tests/clickhouse-reference/00316_rounding_functions_and_empty_block.sql.expected.ast.json @@ -154,7 +154,8 @@ "columns": [ "DeviceIDHash" ] - } + }, + "strictness": "ANY" } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/00316_rounding_functions_and_empty_block.sql.expected.formatted.sql b/tests/clickhouse-reference/00316_rounding_functions_and_empty_block.sql.expected.formatted.sql index f4f81ad67..482d07022 100644 --- a/tests/clickhouse-reference/00316_rounding_functions_and_empty_block.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00316_rounding_functions_and_empty_block.sql.expected.formatted.sql @@ -11,7 +11,7 @@ FROM 2697418689476658272, 1458561552 ) AS js1 -INNER JOIN ( +ANY INNER JOIN ( SELECT 1034415739529768519 AS DeviceIDHash, 1458566664 AS ReferrerTimestamp diff --git a/tests/clickhouse-reference/00353_join_by_tuple.sql.expected.ast.json b/tests/clickhouse-reference/00353_join_by_tuple.sql.expected.ast.json index 178103a7f..465eca06a 100644 --- a/tests/clickhouse-reference/00353_join_by_tuple.sql.expected.ast.json +++ b/tests/clickhouse-reference/00353_join_by_tuple.sql.expected.ast.json @@ -88,7 +88,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/00353_join_by_tuple.sql.expected.formatted.sql b/tests/clickhouse-reference/00353_join_by_tuple.sql.expected.formatted.sql index 04b014852..e5abd3ff1 100644 --- a/tests/clickhouse-reference/00353_join_by_tuple.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00353_join_by_tuple.sql.expected.formatted.sql @@ -5,7 +5,7 @@ FROM ( SELECT (1, 2) AS a ) AS js1 -INNER JOIN ( +ANY INNER JOIN ( SELECT (1, 2) AS a ) AS js2 USING (a); \ No newline at end of file diff --git a/tests/clickhouse-reference/00370_duplicate_columns_in_subqueries.sql.expected.ast.json b/tests/clickhouse-reference/00370_duplicate_columns_in_subqueries.sql.expected.ast.json index 0c3b838d2..20d04650c 100644 --- a/tests/clickhouse-reference/00370_duplicate_columns_in_subqueries.sql.expected.ast.json +++ b/tests/clickhouse-reference/00370_duplicate_columns_in_subqueries.sql.expected.ast.json @@ -450,7 +450,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" } }, { @@ -547,7 +548,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" } }, { @@ -659,7 +661,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" } }, { @@ -771,7 +774,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -910,7 +914,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00370_duplicate_columns_in_subqueries.sql.expected.formatted.sql b/tests/clickhouse-reference/00370_duplicate_columns_in_subqueries.sql.expected.formatted.sql index 968ad882c..f3c513b92 100644 --- a/tests/clickhouse-reference/00370_duplicate_columns_in_subqueries.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00370_duplicate_columns_in_subqueries.sql.expected.formatted.sql @@ -78,7 +78,7 @@ FROM b, c ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 1 AS a ) USING (a); @@ -95,7 +95,7 @@ FROM 1 AS b, 1 AS c ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 1 AS a ) USING (a); @@ -113,7 +113,7 @@ FROM 1 AS b, 2 AS c ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 42 AS a, 3 AS d @@ -133,7 +133,7 @@ FROM 1 AS b, 2 AS c ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 42 AS a, 3 AS d @@ -155,7 +155,7 @@ FROM 'world' AS b1, a1 ) -FULL JOIN ( +ANY FULL JOIN ( SELECT 1 AS k, 'hello' AS a2, diff --git a/tests/clickhouse-reference/00437_nulls_first_last.sql.expected.ast.json b/tests/clickhouse-reference/00437_nulls_first_last.sql.expected.ast.json index 5bd49857b..48d87322e 100644 --- a/tests/clickhouse-reference/00437_nulls_first_last.sql.expected.ast.json +++ b/tests/clickhouse-reference/00437_nulls_first_last.sql.expected.ast.json @@ -255,7 +255,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -385,7 +386,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -645,7 +647,8 @@ "x" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ] }, @@ -775,7 +778,8 @@ "x" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ] }, @@ -1085,7 +1089,8 @@ "y" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -1230,7 +1235,8 @@ "x" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -1240,7 +1246,8 @@ "y" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, diff --git a/tests/clickhouse-reference/00437_nulls_first_last.sql.expected.formatted.sql b/tests/clickhouse-reference/00437_nulls_first_last.sql.expected.formatted.sql index 12bf6e77e..baeb2a2bf 100644 --- a/tests/clickhouse-reference/00437_nulls_first_last.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00437_nulls_first_last.sql.expected.formatted.sql @@ -12,7 +12,7 @@ FROM ( FROM `system`.numbers LIMIT 10 ) -ORDER BY x ASC; +ORDER BY x ASC NULLS FIRST; SELECT x FROM ( @@ -20,7 +20,7 @@ FROM ( FROM `system`.numbers LIMIT 10 ) -ORDER BY x ASC; +ORDER BY x ASC NULLS LAST; SELECT x FROM ( @@ -36,7 +36,7 @@ FROM ( FROM `system`.numbers LIMIT 10 ) -ORDER BY x DESC; +ORDER BY x DESC NULLS FIRST; SELECT x FROM ( @@ -44,7 +44,7 @@ FROM ( FROM `system`.numbers LIMIT 10 ) -ORDER BY x DESC; +ORDER BY x DESC NULLS LAST; SELECT x, @@ -72,7 +72,7 @@ FROM ( ) ORDER BY x ASC, - y ASC; + y ASC NULLS FIRST; SELECT x, @@ -85,8 +85,8 @@ FROM ( LIMIT 10 ) ORDER BY - x DESC, - y ASC; + x DESC NULLS FIRST, + y ASC NULLS FIRST; SET max_block_size = 5; diff --git a/tests/clickhouse-reference/00444_join_use_nulls.sql.expected.ast.json b/tests/clickhouse-reference/00444_join_use_nulls.sql.expected.ast.json index b45f82696..a9affa866 100644 --- a/tests/clickhouse-reference/00444_join_use_nulls.sql.expected.ast.json +++ b/tests/clickhouse-reference/00444_join_use_nulls.sql.expected.ast.json @@ -166,7 +166,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -309,7 +310,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -452,7 +454,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -595,7 +598,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00444_join_use_nulls.sql.expected.formatted.sql b/tests/clickhouse-reference/00444_join_use_nulls.sql.expected.formatted.sql index 3c6614c4a..c0a7fd15e 100644 --- a/tests/clickhouse-reference/00444_join_use_nulls.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00444_join_use_nulls.sql.expected.formatted.sql @@ -16,7 +16,7 @@ FROM FROM `system`.numbers LIMIT 10 ) -INNER JOIN ( +ANY INNER JOIN ( SELECT number AS k, toString(number) AS b @@ -38,7 +38,7 @@ FROM FROM `system`.numbers LIMIT 10 ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT number AS k, toString(number) AS b @@ -60,7 +60,7 @@ FROM FROM `system`.numbers LIMIT 10 ) -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT number AS k, toString(number) AS b @@ -82,7 +82,7 @@ FROM FROM `system`.numbers LIMIT 10 ) -FULL JOIN ( +ANY FULL JOIN ( SELECT number AS k, toString(number) AS b diff --git a/tests/clickhouse-reference/00445_join_nullable_keys.sql.expected.ast.json b/tests/clickhouse-reference/00445_join_nullable_keys.sql.expected.ast.json index 16da54e2b..f258d2e8d 100644 --- a/tests/clickhouse-reference/00445_join_nullable_keys.sql.expected.ast.json +++ b/tests/clickhouse-reference/00445_join_nullable_keys.sql.expected.ast.json @@ -179,7 +179,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -335,7 +336,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -502,7 +504,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00445_join_nullable_keys.sql.expected.formatted.sql b/tests/clickhouse-reference/00445_join_nullable_keys.sql.expected.formatted.sql index 6416720a7..f2da702a5 100644 --- a/tests/clickhouse-reference/00445_join_nullable_keys.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00445_join_nullable_keys.sql.expected.formatted.sql @@ -16,7 +16,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS js1 -INNER JOIN ( +ANY INNER JOIN ( SELECT number AS k, toString(number) AS b @@ -38,7 +38,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS js1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT nullIf(number, 8) AS k, toString(number) AS b @@ -60,7 +60,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS js1 -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT nullIf(number, 8) AS k, toString(number) AS b diff --git a/tests/clickhouse-reference/00456_alter_nullable.sql.expected.ast.json b/tests/clickhouse-reference/00456_alter_nullable.sql.expected.ast.json index 24052cd03..5a5f3f6f2 100644 --- a/tests/clickhouse-reference/00456_alter_nullable.sql.expected.ast.json +++ b/tests/clickhouse-reference/00456_alter_nullable.sql.expected.ast.json @@ -186,7 +186,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, diff --git a/tests/clickhouse-reference/00456_alter_nullable.sql.expected.formatted.sql b/tests/clickhouse-reference/00456_alter_nullable.sql.expected.formatted.sql index b19844efc..483ccae3d 100644 --- a/tests/clickhouse-reference/00456_alter_nullable.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00456_alter_nullable.sql.expected.formatted.sql @@ -21,7 +21,7 @@ INSERT INTO nullable_alter (x); SELECT x FROM nullable_alter -ORDER BY x ASC; +ORDER BY x ASC NULLS FIRST; ALTER TABLE nullable_alter MODIFY COLUMN x Nullable(FixedString(5)); diff --git a/tests/clickhouse-reference/00475_in_join_db_table.sql.expected.ast.json b/tests/clickhouse-reference/00475_in_join_db_table.sql.expected.ast.json index 42aeabe04..1ce546b93 100644 --- a/tests/clickhouse-reference/00475_in_join_db_table.sql.expected.ast.json +++ b/tests/clickhouse-reference/00475_in_join_db_table.sql.expected.ast.json @@ -222,7 +222,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00475_in_join_db_table.sql.expected.formatted.sql b/tests/clickhouse-reference/00475_in_join_db_table.sql.expected.formatted.sql index 92d247927..577cb0fd6 100644 --- a/tests/clickhouse-reference/00475_in_join_db_table.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00475_in_join_db_table.sql.expected.formatted.sql @@ -38,7 +38,7 @@ FROM ( SELECT arrayJoin([1, 2]) AS k ) AS js1 -LEFT JOIN `join` +ANY LEFT JOIN `join` USING (k) ORDER BY `ALL` ASC; diff --git a/tests/clickhouse-reference/00549_join_use_nulls.sql.expected.ast.json b/tests/clickhouse-reference/00549_join_use_nulls.sql.expected.ast.json index 2cb8d6a83..4699a9413 100644 --- a/tests/clickhouse-reference/00549_join_use_nulls.sql.expected.ast.json +++ b/tests/clickhouse-reference/00549_join_use_nulls.sql.expected.ast.json @@ -201,7 +201,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00549_join_use_nulls.sql.expected.formatted.sql b/tests/clickhouse-reference/00549_join_use_nulls.sql.expected.formatted.sql index a182acca0..c8da0a611 100644 --- a/tests/clickhouse-reference/00549_join_use_nulls.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00549_join_use_nulls.sql.expected.formatted.sql @@ -22,7 +22,7 @@ FROM FROM `system`.numbers LIMIT 2 ) AS js1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT number AS k, toString(number) AS b diff --git a/tests/clickhouse-reference/00555_right_join_excessive_rows.sql.expected.ast.json b/tests/clickhouse-reference/00555_right_join_excessive_rows.sql.expected.ast.json index 028fc2155..d02c72862 100644 --- a/tests/clickhouse-reference/00555_right_join_excessive_rows.sql.expected.ast.json +++ b/tests/clickhouse-reference/00555_right_join_excessive_rows.sql.expected.ast.json @@ -111,7 +111,8 @@ "columns": [ "s" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00555_right_join_excessive_rows.sql.expected.formatted.sql b/tests/clickhouse-reference/00555_right_join_excessive_rows.sql.expected.formatted.sql index b22e089e0..62bb9ff86 100644 --- a/tests/clickhouse-reference/00555_right_join_excessive_rows.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00555_right_join_excessive_rows.sql.expected.formatted.sql @@ -8,7 +8,7 @@ FROM SELECT toUInt64(1) AS s LIMIT 1 ) AS js1 -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT number AS s, s AS x diff --git a/tests/clickhouse-reference/00561_storage_join.sql.expected.ast.json b/tests/clickhouse-reference/00561_storage_join.sql.expected.ast.json index 71e6def4e..8d61b7708 100644 --- a/tests/clickhouse-reference/00561_storage_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00561_storage_join.sql.expected.ast.json @@ -417,7 +417,8 @@ "columns": [ "id2" ] - } + }, + "strictness": "SEMI" } }, { @@ -463,7 +464,8 @@ "columns": [ "id2" ] - } + }, + "strictness": "SEMI" }, "leadingComments": [ "-- type conversion" @@ -512,7 +514,8 @@ "columns": [ "id2" ] - } + }, + "strictness": "SEMI" }, "leadingComments": [ "-- can't convert right side in case on storage join" diff --git a/tests/clickhouse-reference/00561_storage_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00561_storage_join.sql.expected.formatted.sql index 282d06115..92dd8cff1 100644 --- a/tests/clickhouse-reference/00561_storage_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00561_storage_join.sql.expected.formatted.sql @@ -48,7 +48,7 @@ FROM ( SELECT toUInt64(arrayJoin(range(50))) AS id2 ) AS js1 -LEFT JOIN joinbug_join +SEMI LEFT JOIN joinbug_join USING (id2); -- type conversion @@ -57,7 +57,7 @@ FROM ( SELECT toUInt32(11) AS id2 ) AS js1 -LEFT JOIN joinbug_join +SEMI LEFT JOIN joinbug_join USING (id2); -- can't convert right side in case on storage join @@ -66,7 +66,7 @@ FROM ( SELECT toInt64(11) AS id2 ) AS js1 -LEFT JOIN joinbug_join +SEMI LEFT JOIN joinbug_join USING (id2); -- { serverError TYPE_MISMATCH, 386 } DROP TABLE joinbug; diff --git a/tests/clickhouse-reference/00563_complex_in_expression.sql.expected.ast.json b/tests/clickhouse-reference/00563_complex_in_expression.sql.expected.ast.json index cf3dd45a3..dc247c7cc 100644 --- a/tests/clickhouse-reference/00563_complex_in_expression.sql.expected.ast.json +++ b/tests/clickhouse-reference/00563_complex_in_expression.sql.expected.ast.json @@ -346,7 +346,8 @@ "columns": [ "key" ] - } + }, + "strictness": "ALL" } }, { diff --git a/tests/clickhouse-reference/00563_complex_in_expression.sql.expected.formatted.sql b/tests/clickhouse-reference/00563_complex_in_expression.sql.expected.formatted.sql index 488e499bd..abb50a436 100644 --- a/tests/clickhouse-reference/00563_complex_in_expression.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00563_complex_in_expression.sql.expected.formatted.sql @@ -36,7 +36,7 @@ INSERT INTO join_with_index; SELECT key + 1 FROM join_with_index -INNER JOIN ( +ALL INNER JOIN ( SELECT key, data diff --git a/tests/clickhouse-reference/00577_full_join_segfault.sql.expected.ast.json b/tests/clickhouse-reference/00577_full_join_segfault.sql.expected.ast.json index 2e7021dce..fc47f628c 100644 --- a/tests/clickhouse-reference/00577_full_join_segfault.sql.expected.ast.json +++ b/tests/clickhouse-reference/00577_full_join_segfault.sql.expected.ast.json @@ -149,7 +149,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -252,7 +253,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00577_full_join_segfault.sql.expected.formatted.sql b/tests/clickhouse-reference/00577_full_join_segfault.sql.expected.formatted.sql index f24b7069f..ccd96ea2d 100644 --- a/tests/clickhouse-reference/00577_full_join_segfault.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00577_full_join_segfault.sql.expected.formatted.sql @@ -16,7 +16,7 @@ FROM 123 AS b1, a1 ) -FULL JOIN ( +ANY FULL JOIN ( SELECT 1 AS k, 'hello' AS a2, @@ -38,7 +38,7 @@ FROM 123 AS b, a ) -FULL JOIN ( +ANY FULL JOIN ( SELECT 1 AS k ) USING (k) diff --git a/tests/clickhouse-reference/00585_union_all_subquery_aggregation_column_removal.sql.expected.ast.json b/tests/clickhouse-reference/00585_union_all_subquery_aggregation_column_removal.sql.expected.ast.json index ab2efb69a..ce862ca1a 100644 --- a/tests/clickhouse-reference/00585_union_all_subquery_aggregation_column_removal.sql.expected.ast.json +++ b/tests/clickhouse-reference/00585_union_all_subquery_aggregation_column_removal.sql.expected.ast.json @@ -1794,7 +1794,8 @@ "total", "domain" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -2244,7 +2245,8 @@ "total", "domain" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -2694,7 +2696,8 @@ "total", "domain" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00585_union_all_subquery_aggregation_column_removal.sql.expected.formatted.sql b/tests/clickhouse-reference/00585_union_all_subquery_aggregation_column_removal.sql.expected.formatted.sql index a0f1ffaca..5b46465e9 100644 --- a/tests/clickhouse-reference/00585_union_all_subquery_aggregation_column_removal.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00585_union_all_subquery_aggregation_column_removal.sql.expected.formatted.sql @@ -190,7 +190,7 @@ FROM ORDER BY domain ASC LIMIT 10 ) AS js1 -FULL JOIN ( +ALL FULL JOIN ( SELECT sum(total_count) AS total, domain @@ -243,7 +243,7 @@ FROM ORDER BY domain ASC LIMIT 10 ) AS js1 -FULL JOIN ( +ALL FULL JOIN ( SELECT sum(total_count) AS total, domain @@ -296,7 +296,7 @@ FROM ORDER BY domain ASC LIMIT 10 ) AS js1 -FULL JOIN ( +ALL FULL JOIN ( SELECT sum(total_count) AS total, domain diff --git a/tests/clickhouse-reference/00597_push_down_predicate_long.sql.expected.ast.json b/tests/clickhouse-reference/00597_push_down_predicate_long.sql.expected.ast.json index 34e8a1f3a..9dab11ebd 100644 --- a/tests/clickhouse-reference/00597_push_down_predicate_long.sql.expected.ast.json +++ b/tests/clickhouse-reference/00597_push_down_predicate_long.sql.expected.ast.json @@ -860,7 +860,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -949,7 +950,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -1037,7 +1039,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -1126,7 +1129,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -1214,7 +1218,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -1303,7 +1308,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -1391,7 +1397,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -3674,7 +3681,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -3741,7 +3749,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -3814,7 +3823,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -3887,7 +3897,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -3948,7 +3959,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -4016,7 +4028,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -4085,7 +4098,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -4160,7 +4174,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" } } }, @@ -4238,7 +4253,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" } } }, @@ -4322,7 +4338,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" } } }, @@ -4401,7 +4418,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -4470,7 +4488,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -4545,7 +4564,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -4659,7 +4679,8 @@ "date", "id" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -4770,7 +4791,8 @@ "date", "id" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -4887,7 +4909,8 @@ "date", "id" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -4996,7 +5019,8 @@ ] } } - } + }, + "strictness": "ANY" } } }, @@ -5088,7 +5112,8 @@ ] } } - } + }, + "strictness": "ANY" } } }, @@ -5168,7 +5193,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -5248,7 +5274,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -5334,7 +5361,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", diff --git a/tests/clickhouse-reference/00597_push_down_predicate_long.sql.expected.formatted.sql b/tests/clickhouse-reference/00597_push_down_predicate_long.sql.expected.formatted.sql index 3bc6b8d6d..8b9bca702 100644 --- a/tests/clickhouse-reference/00597_push_down_predicate_long.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00597_push_down_predicate_long.sql.expected.formatted.sql @@ -96,7 +96,7 @@ FROM ( SELECT 1 AS a ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 1 AS a, 1 AS b @@ -111,7 +111,7 @@ FROM ( SELECT 1 AS a ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 1 AS a, 1 AS b @@ -130,7 +130,7 @@ FROM 1 AS a, 1 AS b ) -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT 1 AS a ) USING (a) @@ -145,7 +145,7 @@ FROM 1 AS a, 1 AS b ) -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT 1 AS a ) USING (a) @@ -160,7 +160,7 @@ FROM ( SELECT 1 AS a ) -FULL JOIN ( +ANY FULL JOIN ( SELECT 1 AS a, 1 AS b @@ -175,7 +175,7 @@ FROM ( SELECT 1 AS a ) -FULL JOIN ( +ANY FULL JOIN ( SELECT 1 AS a, 1 AS b @@ -193,7 +193,7 @@ FROM 1 AS a, 1 AS b ) -FULL JOIN ( +ANY FULL JOIN ( SELECT 1 AS a ) USING (a) @@ -572,7 +572,7 @@ FROM SELECT * FROM test_00597 ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM test_00597 ) @@ -585,7 +585,7 @@ FROM SELECT * FROM test_00597 ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM test_00597 ) @@ -599,7 +599,7 @@ FROM SELECT * FROM test_00597 ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM test_00597 ) @@ -613,7 +613,7 @@ FROM ( SELECT toInt8(1) AS id ) -LEFT JOIN test_00597 +ANY LEFT JOIN test_00597 USING (id) WHERE value = 1; @@ -622,7 +622,7 @@ FROM ( SELECT toInt8(1) AS id ) -LEFT JOIN test_00597 +ANY LEFT JOIN test_00597 USING (id) WHERE value = 1; @@ -633,7 +633,7 @@ FROM ( SELECT toInt8(1) AS id ) -LEFT JOIN test_00597 AS b +ANY LEFT JOIN test_00597 AS b USING (id) WHERE value = 1; @@ -642,7 +642,7 @@ FROM ( SELECT toInt8(1) AS id ) -LEFT JOIN test_00597 AS b +ANY LEFT JOIN test_00597 AS b USING (id) WHERE value = 1; @@ -656,7 +656,7 @@ FROM ( SELECT * FROM test_00597 ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT * FROM test_00597 ) @@ -672,7 +672,7 @@ FROM ( SELECT * FROM test_00597 ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT * FROM test_00597 ) @@ -689,7 +689,7 @@ FROM ( SELECT * FROM test_00597 ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT * FROM test_00597 ) @@ -706,7 +706,7 @@ FROM SELECT * FROM test_00597 ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM test_00597 ) AS b @@ -719,7 +719,7 @@ FROM SELECT * FROM test_00597 ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM test_00597 ) AS b @@ -733,7 +733,7 @@ FROM SELECT * FROM test_00597 ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM test_00597 ) AS b @@ -752,7 +752,7 @@ FROM FROM `system`.numbers LIMIT 1 ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM test_00597 ) AS b @@ -768,7 +768,7 @@ FROM FROM `system`.numbers LIMIT 1 ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM test_00597 ) AS b @@ -785,7 +785,7 @@ FROM FROM `system`.numbers LIMIT 1 ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM test_00597 ) AS b @@ -802,7 +802,7 @@ FROM ( SELECT * FROM test_00597 ) AS a - LEFT JOIN ( + ANY LEFT JOIN ( SELECT * FROM test_00597 ) AS b @@ -818,7 +818,7 @@ FROM ( SELECT * FROM test_00597 ) AS a - LEFT JOIN ( + ANY LEFT JOIN ( SELECT * FROM test_00597 ) AS b @@ -834,7 +834,7 @@ FROM SELECT * FROM test_00597 ) -INNER JOIN ( +ANY INNER JOIN ( SELECT * FROM ( SELECT * @@ -850,7 +850,7 @@ FROM SELECT * FROM test_00597 ) -INNER JOIN ( +ANY INNER JOIN ( SELECT * FROM ( SELECT * @@ -867,7 +867,7 @@ FROM SELECT * FROM test_00597 ) -INNER JOIN ( +ANY INNER JOIN ( SELECT * FROM ( SELECT * diff --git a/tests/clickhouse-reference/00612_pk_in_tuple.sql.expected.ast.json b/tests/clickhouse-reference/00612_pk_in_tuple.sql.expected.ast.json index 5ffb19b4d..5835be5f5 100644 --- a/tests/clickhouse-reference/00612_pk_in_tuple.sql.expected.ast.json +++ b/tests/clickhouse-reference/00612_pk_in_tuple.sql.expected.ast.json @@ -1201,7 +1201,8 @@ "columns": [ "key" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "inExpr", @@ -1302,7 +1303,8 @@ "columns": [ "key" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "inExpr", diff --git a/tests/clickhouse-reference/00612_pk_in_tuple.sql.expected.formatted.sql b/tests/clickhouse-reference/00612_pk_in_tuple.sql.expected.formatted.sql index b97f789be..96b8a8bbb 100644 --- a/tests/clickhouse-reference/00612_pk_in_tuple.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00612_pk_in_tuple.sql.expected.formatted.sql @@ -103,7 +103,7 @@ WHERE (key, val.x) IN ((1, 1), (2, 2)); SELECT max(key) FROM tab_00612 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT key, arrayJoin(n.x) AS val @@ -115,7 +115,7 @@ WHERE (key, val) IN (1, 1); SELECT max(key) FROM tab_00612 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT key, arrayJoin(n.x) AS val diff --git a/tests/clickhouse-reference/00615_nullable_alter_optimize.sql.expected.ast.json b/tests/clickhouse-reference/00615_nullable_alter_optimize.sql.expected.ast.json index abaa2c156..1b8297228 100644 --- a/tests/clickhouse-reference/00615_nullable_alter_optimize.sql.expected.ast.json +++ b/tests/clickhouse-reference/00615_nullable_alter_optimize.sql.expected.ast.json @@ -204,7 +204,8 @@ "data" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, diff --git a/tests/clickhouse-reference/00615_nullable_alter_optimize.sql.expected.formatted.sql b/tests/clickhouse-reference/00615_nullable_alter_optimize.sql.expected.formatted.sql index d8ce8b661..bd2e471a7 100644 --- a/tests/clickhouse-reference/00615_nullable_alter_optimize.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00615_nullable_alter_optimize.sql.expected.formatted.sql @@ -19,7 +19,7 @@ ALTER TABLE test_00615 ADD COLUMN data Nullable(Float64); SELECT * FROM test_00615 -ORDER BY data ASC; +ORDER BY data ASC NULLS FIRST; OPTIMIZE TABLE test_00615; diff --git a/tests/clickhouse-reference/00632_get_sample_block_cache.sql.expected.ast.json b/tests/clickhouse-reference/00632_get_sample_block_cache.sql.expected.ast.json index 98c3c6136..e3c792cce 100644 --- a/tests/clickhouse-reference/00632_get_sample_block_cache.sql.expected.ast.json +++ b/tests/clickhouse-reference/00632_get_sample_block_cache.sql.expected.ast.json @@ -1783,7 +1783,8 @@ "columns": [ "entityIri" ] - } + }, + "strictness": "ANY" } } }, @@ -1985,7 +1986,8 @@ "columns": [ "entityIri" ] - } + }, + "strictness": "ANY" } } }, @@ -2134,7 +2136,8 @@ "columns": [ "entityIri" ] - } + }, + "strictness": "ANY" } } }, @@ -2328,7 +2331,8 @@ "columns": [ "entityIri" ] - } + }, + "strictness": "ANY" } } }, @@ -2455,7 +2459,8 @@ "columns": [ "entityIri" ] - } + }, + "strictness": "ANY" } } }, @@ -2582,7 +2587,8 @@ "columns": [ "entityIri" ] - } + }, + "strictness": "ANY" } } }, @@ -2723,7 +2729,8 @@ "columns": [ "entityIri" ] - } + }, + "strictness": "ANY" } } }, @@ -2903,7 +2910,8 @@ "columns": [ "entityIri" ] - } + }, + "strictness": "ANY" } } }, @@ -3017,7 +3025,8 @@ "columns": [ "entityIri" ] - } + }, + "strictness": "ANY" } } }, @@ -3131,7 +3140,8 @@ "columns": [ "entityIri" ] - } + }, + "strictness": "ANY" } } }, @@ -3266,7 +3276,8 @@ "columns": [ "entityIri" ] - } + }, + "strictness": "ANY" } } }, @@ -3392,7 +3403,8 @@ "columns": [ "entityIri" ] - } + }, + "strictness": "ANY" } } }, @@ -3527,7 +3539,8 @@ "columns": [ "entityIri" ] - } + }, + "strictness": "ANY" } } }, @@ -3646,7 +3659,8 @@ "columns": [ "entityIri" ] - } + }, + "strictness": "ANY" } } }, @@ -3760,7 +3774,8 @@ "columns": [ "entityIri" ] - } + }, + "strictness": "ANY" } } } diff --git a/tests/clickhouse-reference/00632_get_sample_block_cache.sql.expected.formatted.sql b/tests/clickhouse-reference/00632_get_sample_block_cache.sql.expected.formatted.sql index 037c7dec8..1de28d39a 100644 --- a/tests/clickhouse-reference/00632_get_sample_block_cache.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00632_get_sample_block_cache.sql.expected.formatted.sql @@ -259,7 +259,7 @@ FROM ( SELECT entityIri FROM dict_string ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT uniq(learnerId) AS `watchers-count`, entityIri @@ -273,7 +273,7 @@ FROM ( ) USING (entityIri) ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT avg(viewDurationSum) AS `time-repeating-average`, entityIri @@ -297,7 +297,7 @@ FROM ( ) USING (entityIri) ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT avg(views.viewDuration) AS `reject-views-duration-average`, entityIri @@ -312,7 +312,7 @@ FROM ( ) USING (entityIri) ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT avg(viewsCount) AS `repeating-views-count-average`, entityIri @@ -336,7 +336,7 @@ FROM ( ) USING (entityIri) ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT avg(views.viewDuration) AS `views-duration-average`, entityIri @@ -350,7 +350,7 @@ FROM ( ) USING (entityIri) ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT avg(views.watchedPart) AS `watched-part-average`, entityIri @@ -364,7 +364,7 @@ FROM ( ) USING (entityIri) ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT count() AS `rejects-count`, entityIri @@ -379,7 +379,7 @@ FROM ( ) USING (entityIri) ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT avg(progressMax) AS `progress-average`, entityIri @@ -402,7 +402,7 @@ FROM ( ) USING (entityIri) ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT avg(fullWatchedViews) AS `views-count-before-full-watched-average`, entityIri @@ -414,7 +414,7 @@ FROM ( ) USING (entityIri) ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT any(duration) AS duration, entityIri @@ -426,7 +426,7 @@ FROM ( ) USING (entityIri) ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT uniq(learnerId) AS `full-watched-learners-count`, entityIri @@ -439,7 +439,7 @@ FROM ( ) USING (entityIri) ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT uniq(learnerId) AS `overall-watchers-count`, entityIri @@ -453,7 +453,7 @@ FROM ( ) USING (entityIri) ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT uniq(learnerId) AS `overall-full-watched-learners-count`, entityIri @@ -466,7 +466,7 @@ FROM ( ) USING (entityIri) ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT count() AS `views-count`, entityIri @@ -480,7 +480,7 @@ FROM ( ) USING (entityIri) ) - LEFT JOIN ( + ANY LEFT JOIN ( SELECT avg(fullWatchedTime) AS `time-before-full-watched-average`, entityIri diff --git a/tests/clickhouse-reference/00665_alter_nullable_string_to_nullable_uint8.sql.expected.ast.json b/tests/clickhouse-reference/00665_alter_nullable_string_to_nullable_uint8.sql.expected.ast.json index df4287bc4..e3d976d1a 100644 --- a/tests/clickhouse-reference/00665_alter_nullable_string_to_nullable_uint8.sql.expected.ast.json +++ b/tests/clickhouse-reference/00665_alter_nullable_string_to_nullable_uint8.sql.expected.ast.json @@ -94,7 +94,8 @@ "boolean_false" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, diff --git a/tests/clickhouse-reference/00665_alter_nullable_string_to_nullable_uint8.sql.expected.formatted.sql b/tests/clickhouse-reference/00665_alter_nullable_string_to_nullable_uint8.sql.expected.formatted.sql index 00329a8c5..a3049fa3e 100644 --- a/tests/clickhouse-reference/00665_alter_nullable_string_to_nullable_uint8.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00665_alter_nullable_string_to_nullable_uint8.sql.expected.formatted.sql @@ -14,7 +14,7 @@ FROM alter_00665; SELECT * FROM alter_00665 -ORDER BY boolean_false ASC; +ORDER BY boolean_false ASC NULLS LAST; ALTER TABLE alter_00665 MODIFY COLUMN boolean_false Nullable(UInt8); diff --git a/tests/clickhouse-reference/00674_join_on_syntax.sql.expected.ast.json b/tests/clickhouse-reference/00674_join_on_syntax.sql.expected.ast.json index 630342e09..04fd591cf 100644 --- a/tests/clickhouse-reference/00674_join_on_syntax.sql.expected.ast.json +++ b/tests/clickhouse-reference/00674_join_on_syntax.sql.expected.ast.json @@ -284,7 +284,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -332,7 +333,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -380,7 +382,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -428,7 +431,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -482,7 +486,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -539,7 +544,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -602,7 +608,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -665,7 +672,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -725,7 +733,8 @@ } } } - } + }, + "strictness": "ANY" } }, { @@ -785,7 +794,8 @@ } } } - } + }, + "strictness": "ANY" } }, { @@ -863,7 +873,8 @@ } } } - } + }, + "strictness": "ANY" } }, { @@ -956,7 +967,8 @@ } } } - } + }, + "strictness": "ANY" } }, { @@ -1034,7 +1046,8 @@ } } } - } + }, + "strictness": "ANY" } }, { @@ -1104,7 +1117,8 @@ } ] } - } + }, + "strictness": "ANY" } }, { @@ -1174,7 +1188,8 @@ } ] } - } + }, + "strictness": "ANY" } }, { @@ -1256,7 +1271,8 @@ } ] } - } + }, + "strictness": "ANY" } }, { @@ -1356,7 +1372,8 @@ } ] } - } + }, + "strictness": "ANY" } }, { @@ -1462,7 +1479,8 @@ } ] } - } + }, + "strictness": "ANY" } }, { @@ -1580,7 +1598,8 @@ } ] } - } + }, + "strictness": "ANY" } }, { @@ -1695,7 +1714,8 @@ } ] } - } + }, + "strictness": "ANY" } }, { @@ -1759,7 +1779,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -1823,7 +1844,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -1887,7 +1909,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -1951,7 +1974,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -2015,7 +2039,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -2079,7 +2104,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -2143,7 +2169,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -2207,7 +2234,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -2271,7 +2299,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -2335,7 +2364,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -2403,7 +2433,8 @@ } } } - } + }, + "strictness": "ANY" } }, { @@ -2472,7 +2503,8 @@ } } } - } + }, + "strictness": "ANY" } }, { @@ -2542,7 +2574,8 @@ } } } - } + }, + "strictness": "ANY" } }, { @@ -2616,7 +2649,8 @@ } } } - } + }, + "strictness": "ANY" } }, { @@ -2685,7 +2719,8 @@ } } } - } + }, + "strictness": "ANY" }, "format": "JSONEachRow" }, @@ -2756,7 +2791,8 @@ } } } - } + }, + "strictness": "ANY" }, "format": "JSONEachRow" }, @@ -2827,7 +2863,8 @@ } } } - } + }, + "strictness": "ANY" }, "format": "JSONEachRow" }, @@ -2881,7 +2918,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -2937,7 +2975,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -2996,7 +3035,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -3067,7 +3107,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -3129,7 +3170,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -3197,7 +3239,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -3286,7 +3329,8 @@ } } } - } + }, + "strictness": "ANY" } }, { @@ -3369,7 +3413,8 @@ } } } - } + }, + "strictness": "ANY" } }, { @@ -3468,7 +3513,8 @@ } } } - } + }, + "strictness": "ANY" } }, { @@ -3567,7 +3613,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -3675,7 +3722,8 @@ } } } - } + }, + "strictness": "ANY" }, "format": "TSV" }, @@ -3751,7 +3799,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -3836,7 +3885,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -3939,7 +3989,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -4017,7 +4068,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -4098,7 +4150,8 @@ } } } - } + }, + "strictness": "ANY" }, "format": "JSONEachRow" }, diff --git a/tests/clickhouse-reference/00674_join_on_syntax.sql.expected.formatted.sql b/tests/clickhouse-reference/00674_join_on_syntax.sql.expected.formatted.sql index cd49a2f3d..815fd3170 100644 --- a/tests/clickhouse-reference/00674_join_on_syntax.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00674_join_on_syntax.sql.expected.formatted.sql @@ -53,7 +53,7 @@ INSERT INTO tab1_copy; SELECT a1 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON b1 = a2; SELECT @@ -61,7 +61,7 @@ SELECT b1 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON b1 = a2; SELECT @@ -69,7 +69,7 @@ SELECT a2 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON b1 = a2; SELECT @@ -77,7 +77,7 @@ SELECT b2 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON b1 = a2; SELECT @@ -86,13 +86,13 @@ SELECT b2 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON b1 = a2; SELECT b1 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON toInt32(a1 + 1) = a2; SELECT @@ -100,7 +100,7 @@ SELECT a2 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON toInt32(a1 + 1) = a2; SELECT @@ -108,19 +108,19 @@ SELECT b2 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON toInt32(a1 + 1) = a2; SELECT a1 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON b1 + 1 = a2 + 1; SELECT a2 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON b1 + 1 = a2 + 1; SELECT @@ -130,7 +130,7 @@ SELECT b2 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON b1 + 1 = a2 + 1; SELECT @@ -141,7 +141,7 @@ SELECT a2 + 1 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON b1 + 1 = a2 + 1; SELECT @@ -151,7 +151,7 @@ SELECT b2 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON a1 + 4 = b2 + 2; SELECT @@ -159,7 +159,7 @@ SELECT b2 FROM tab2 -LEFT JOIN tab3 +ANY LEFT JOIN tab3 ON a2 = a3 AND b2 = b3; @@ -168,7 +168,7 @@ SELECT b3 FROM tab2 -LEFT JOIN tab3 +ANY LEFT JOIN tab3 ON a2 = a3 AND b2 = b3; @@ -179,14 +179,14 @@ SELECT b3 FROM tab2 -LEFT JOIN tab3 +ANY LEFT JOIN tab3 ON a2 = a3 AND b2 = b3; SELECT a1 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON b1 + 1 = a2 + 1 AND a1 + 4 = b2 + 2; @@ -195,7 +195,7 @@ SELECT b2 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON b1 + 1 = a2 + 1 AND a1 + 4 = b2 + 2; @@ -206,7 +206,7 @@ SELECT b2 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON b1 + 1 = a2 + 1 AND a1 + 4 = b2 + 2; @@ -215,7 +215,7 @@ SELECT b2 + 1 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON b1 + 1 = a2 + 1 AND a1 + 4 = b2 + 2; @@ -226,7 +226,7 @@ SELECT b2 FROM tab1 AS `first` -LEFT JOIN tab2 AS second_ +ANY LEFT JOIN tab2 AS second_ ON `first`.b1 = second_.a2; SELECT @@ -236,7 +236,7 @@ SELECT b2 FROM tab1 AS `first` -LEFT JOIN tab2 AS second_ +ANY LEFT JOIN tab2 AS second_ ON second_.a2 = `first`.b1; SELECT @@ -246,7 +246,7 @@ SELECT b2 FROM tab1 AS `first` -LEFT JOIN tab2 AS second_ +ANY LEFT JOIN tab2 AS second_ ON tab1.b1 = tab2.a2; SELECT @@ -256,7 +256,7 @@ SELECT b2 FROM tab1 AS `first` -LEFT JOIN tab2 AS second_ +ANY LEFT JOIN tab2 AS second_ ON tab2.a2 = tab1.b1; SELECT @@ -266,7 +266,7 @@ SELECT b2 FROM tab1 AS `first` -LEFT JOIN tab2 AS second_ +ANY LEFT JOIN tab2 AS second_ ON `first`.b1 = tab2.a2; SELECT @@ -276,7 +276,7 @@ SELECT b2 FROM tab1 AS `first` -LEFT JOIN tab2 AS second_ +ANY LEFT JOIN tab2 AS second_ ON tab2.a2 = `first`.b1; SELECT @@ -286,7 +286,7 @@ SELECT b2 FROM tab1 AS `first` -LEFT JOIN tab2 AS second_ +ANY LEFT JOIN tab2 AS second_ ON tab1.b1 = second_.a2; SELECT @@ -296,7 +296,7 @@ SELECT b2 FROM tab1 AS `first` -LEFT JOIN tab2 AS second_ +ANY LEFT JOIN tab2 AS second_ ON second_.a2 = tab1.b1; SELECT @@ -306,7 +306,7 @@ SELECT second_.b2 FROM tab1 AS `first` -LEFT JOIN tab2 AS second_ +ANY LEFT JOIN tab2 AS second_ ON b1 = a2; SELECT @@ -316,7 +316,7 @@ SELECT tab2.b2 FROM tab1 AS `first` -LEFT JOIN tab2 AS second_ +ANY LEFT JOIN tab2 AS second_ ON b1 = a2; SELECT @@ -324,7 +324,7 @@ SELECT b2 FROM tab2 -LEFT JOIN tab3 +ANY LEFT JOIN tab3 ON a2 + b2 = a3 + b3; SELECT @@ -332,7 +332,7 @@ SELECT b2 FROM tab2 -LEFT JOIN tab3 +ANY LEFT JOIN tab3 ON a3 + tab3.b3 = a2 + b2; SELECT @@ -340,7 +340,7 @@ SELECT b2 FROM tab2 AS second_ -LEFT JOIN tab3 +ANY LEFT JOIN tab3 ON a3 + b3 = a2 + second_.b2; SELECT @@ -348,7 +348,7 @@ SELECT b2 FROM tab2 AS second_ -LEFT JOIN tab3 AS third +ANY LEFT JOIN tab3 AS third ON third.a3 + tab3.b3 = tab2.a2 + second_.b2; SELECT @@ -356,7 +356,7 @@ SELECT tab1_copy.a1 FROM tab1 -LEFT JOIN tab1_copy +ANY LEFT JOIN tab1_copy ON tab1.b1 + 3 = tab1_copy.b1 + 2 FORMAT JSONEachRow; @@ -365,7 +365,7 @@ SELECT copy.a1 FROM tab1 -LEFT JOIN tab1_copy AS copy +ANY LEFT JOIN tab1_copy AS copy ON tab1.b1 + 3 = tab1_copy.b1 + 2 FORMAT JSONEachRow; @@ -374,14 +374,14 @@ SELECT tab1_copy.a1 FROM tab1 -LEFT JOIN tab1_copy AS copy +ANY LEFT JOIN tab1_copy AS copy ON tab1.b1 + 3 = tab1_copy.b1 + 2 FORMAT JSONEachRow; SELECT a1 FROM tab1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM tab2 ) @@ -390,7 +390,7 @@ LEFT JOIN ( SELECT a1 FROM tab1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT a2 FROM tab2 ) @@ -401,7 +401,7 @@ SELECT b1 FROM tab1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM tab2 ) @@ -414,7 +414,7 @@ SELECT b2 FROM tab1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM tab2 ) @@ -425,7 +425,7 @@ SELECT a2 FROM tab1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT a2 FROM tab2 ) @@ -434,7 +434,7 @@ LEFT JOIN ( SELECT b1 FROM tab1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM tab2 ) @@ -447,7 +447,7 @@ SELECT b2 FROM tab1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM tab2 ) @@ -459,7 +459,7 @@ SELECT a2 FROM tab1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM tab2 ) @@ -472,7 +472,7 @@ SELECT b2 FROM tab1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT *, a2 AS z @@ -487,7 +487,7 @@ SELECT b2 FROM tab1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT *, a2 + 1 AS z @@ -502,7 +502,7 @@ SELECT b2 FROM tab1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT *, a2 + 1 AS z @@ -518,7 +518,7 @@ SELECT b2 FROM tab1 AS `first` -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM tab2 ) AS second_ @@ -531,7 +531,7 @@ SELECT b2 FROM tab1 AS `first` -LEFT JOIN ( +ANY LEFT JOIN ( SELECT *, a2 AS z @@ -546,7 +546,7 @@ SELECT b2 FROM tab1 AS `first` -LEFT JOIN ( +ANY LEFT JOIN ( SELECT *, a2 + 1 AS z @@ -561,7 +561,7 @@ SELECT second_.b2 FROM tab1 AS `first` -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM tab2 ) AS second_ @@ -572,7 +572,7 @@ SELECT s.a1 FROM tab1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM tab1_copy ) AS s diff --git a/tests/clickhouse-reference/00679_replace_asterisk.sql.expected.ast.json b/tests/clickhouse-reference/00679_replace_asterisk.sql.expected.ast.json index d264548f7..4a739fec0 100644 --- a/tests/clickhouse-reference/00679_replace_asterisk.sql.expected.ast.json +++ b/tests/clickhouse-reference/00679_replace_asterisk.sql.expected.ast.json @@ -131,7 +131,8 @@ "columns": [ "id" ] - } + }, + "strictness": "SEMI" } }, { @@ -208,7 +209,8 @@ "columns": [ "id" ] - } + }, + "strictness": "SEMI" } }, { @@ -292,7 +294,8 @@ "columns": [ "id" ] - } + }, + "strictness": "SEMI" } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/00679_replace_asterisk.sql.expected.formatted.sql b/tests/clickhouse-reference/00679_replace_asterisk.sql.expected.formatted.sql index deef6009b..f686c1808 100644 --- a/tests/clickhouse-reference/00679_replace_asterisk.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00679_replace_asterisk.sql.expected.formatted.sql @@ -15,7 +15,7 @@ FROM 2 AS value, 3 AS A ) -LEFT JOIN ( +SEMI LEFT JOIN ( SELECT 1 AS id, 4 AS values, @@ -32,7 +32,7 @@ FROM 1 AS id, 2 AS value ) -LEFT JOIN ( +SEMI LEFT JOIN ( SELECT 1 AS id, 3 AS values @@ -49,7 +49,7 @@ FROM 1 AS id, 2 AS value ) -LEFT JOIN ( +SEMI LEFT JOIN ( SELECT 1 AS id, 3 AS values diff --git a/tests/clickhouse-reference/00689_join_table_function.sql.expected.ast.json b/tests/clickhouse-reference/00689_join_table_function.sql.expected.ast.json index 86079f002..824c2f6e3 100644 --- a/tests/clickhouse-reference/00689_join_table_function.sql.expected.ast.json +++ b/tests/clickhouse-reference/00689_join_table_function.sql.expected.ast.json @@ -53,7 +53,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00689_join_table_function.sql.expected.formatted.sql b/tests/clickhouse-reference/00689_join_table_function.sql.expected.formatted.sql index 96be90fa6..4608b0c0a 100644 --- a/tests/clickhouse-reference/00689_join_table_function.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00689_join_table_function.sql.expected.formatted.sql @@ -1,6 +1,6 @@ SELECT * FROM numbers(3) AS a -LEFT JOIN numbers(3) AS b +ANY LEFT JOIN numbers(3) AS b ON a.number = b.number ORDER BY a.number ASC; \ No newline at end of file diff --git a/tests/clickhouse-reference/00702_join_with_using.sql.expected.ast.json b/tests/clickhouse-reference/00702_join_with_using.sql.expected.ast.json index c57f52f28..a880954a5 100644 --- a/tests/clickhouse-reference/00702_join_with_using.sql.expected.ast.json +++ b/tests/clickhouse-reference/00702_join_with_using.sql.expected.ast.json @@ -125,7 +125,8 @@ "a", "b" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -320,7 +321,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -390,7 +392,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -472,7 +475,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -557,7 +561,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -637,7 +642,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -718,7 +724,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00702_join_with_using.sql.expected.formatted.sql b/tests/clickhouse-reference/00702_join_with_using.sql.expected.formatted.sql index c042001a6..a8e67540c 100644 --- a/tests/clickhouse-reference/00702_join_with_using.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00702_join_with_using.sql.expected.formatted.sql @@ -23,7 +23,7 @@ INSERT INTO using2; SELECT * FROM using1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT * FROM using2 ) AS js2 @@ -62,7 +62,7 @@ INSERT INTO children (id, childName); SELECT * FROM persons -INNER JOIN children +ALL INNER JOIN children USING (id) ORDER BY id ASC, @@ -72,7 +72,7 @@ ORDER BY SELECT * FROM persons -INNER JOIN ( +ALL INNER JOIN ( SELECT * FROM children ) AS j @@ -88,7 +88,7 @@ FROM SELECT * FROM persons ) AS s -INNER JOIN ( +ALL INNER JOIN ( SELECT * FROM children ) AS j @@ -104,7 +104,7 @@ SET joined_subquery_requires_alias = 0; SELECT * FROM persons -INNER JOIN ( +ALL INNER JOIN ( SELECT * FROM children ) @@ -120,7 +120,7 @@ FROM SELECT * FROM persons ) -INNER JOIN ( +ALL INNER JOIN ( SELECT * FROM children ) @@ -136,7 +136,7 @@ FROM SELECT * FROM persons ) AS s -INNER JOIN ( +ALL INNER JOIN ( SELECT * FROM children ) diff --git a/tests/clickhouse-reference/00703_join_crash.sql.expected.ast.json b/tests/clickhouse-reference/00703_join_crash.sql.expected.ast.json index a6bcc0d50..203e98f81 100644 --- a/tests/clickhouse-reference/00703_join_crash.sql.expected.ast.json +++ b/tests/clickhouse-reference/00703_join_crash.sql.expected.ast.json @@ -183,7 +183,8 @@ } } } - } + }, + "strictness": "ANY" } }, { diff --git a/tests/clickhouse-reference/00703_join_crash.sql.expected.formatted.sql b/tests/clickhouse-reference/00703_join_crash.sql.expected.formatted.sql index 31dc6513c..7f3224a69 100644 --- a/tests/clickhouse-reference/00703_join_crash.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00703_join_crash.sql.expected.formatted.sql @@ -28,7 +28,7 @@ SELECT tab1.b1 FROM tab1 -LEFT JOIN tab1_copy +ANY LEFT JOIN tab1_copy ON tab1.b1 + 3 = tab1_copy.b1 + 2; DROP TABLE tab1; diff --git a/tests/clickhouse-reference/00721_force_by_identical_result_after_merge_zookeeper_long.sql.expected.ast.json b/tests/clickhouse-reference/00721_force_by_identical_result_after_merge_zookeeper_long.sql.expected.ast.json index 61b407cc2..ba261960b 100644 --- a/tests/clickhouse-reference/00721_force_by_identical_result_after_merge_zookeeper_long.sql.expected.ast.json +++ b/tests/clickhouse-reference/00721_force_by_identical_result_after_merge_zookeeper_long.sql.expected.ast.json @@ -246,7 +246,8 @@ "columns": [ "x" ] - } + }, + "strictness": "SEMI" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00721_force_by_identical_result_after_merge_zookeeper_long.sql.expected.formatted.sql b/tests/clickhouse-reference/00721_force_by_identical_result_after_merge_zookeeper_long.sql.expected.formatted.sql index 9678346ee..c8bdf5be4 100644 --- a/tests/clickhouse-reference/00721_force_by_identical_result_after_merge_zookeeper_long.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00721_force_by_identical_result_after_merge_zookeeper_long.sql.expected.formatted.sql @@ -38,7 +38,7 @@ SELECT t1.y - t2.y FROM byte_identical_r1 AS t1 -LEFT JOIN byte_identical_r2 AS t2 +SEMI LEFT JOIN byte_identical_r2 AS t2 USING (x) ORDER BY x ASC; diff --git a/tests/clickhouse-reference/00722_inner_join.sql.expected.ast.json b/tests/clickhouse-reference/00722_inner_join.sql.expected.ast.json index 7217d0ee2..54cc8804b 100644 --- a/tests/clickhouse-reference/00722_inner_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00722_inner_join.sql.expected.ast.json @@ -98,7 +98,8 @@ "columns": [ "database" ] - } + }, + "strictness": "ALL" }, "where": { "kind": "naryExpr", @@ -194,7 +195,8 @@ "columns": [ "database" ] - } + }, + "strictness": "ALL" }, "where": { "kind": "naryExpr", @@ -310,7 +312,8 @@ "columns": [ "database" ] - } + }, + "strictness": "ALL" }, "where": { "kind": "naryExpr", @@ -430,7 +433,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ALL" }, "where": { "kind": "naryExpr", @@ -1373,7 +1377,8 @@ "columns": [ "name" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", diff --git a/tests/clickhouse-reference/00722_inner_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00722_inner_join.sql.expected.formatted.sql index b1587d454..bd9bd4bd8 100644 --- a/tests/clickhouse-reference/00722_inner_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00722_inner_join.sql.expected.formatted.sql @@ -14,7 +14,7 @@ SELECT t.name FROM `system`.tables AS t -INNER JOIN ( +ALL INNER JOIN ( SELECT name AS database FROM `system`.databases ) AS db @@ -31,7 +31,7 @@ FROM SELECT name AS database FROM `system`.databases ) AS db -INNER JOIN `system`.tables AS t +ALL INNER JOIN `system`.tables AS t USING (database) WHERE database = 'system' AND t.name = 'one' @@ -47,7 +47,7 @@ FROM database FROM `system`.tables ) AS t -INNER JOIN ( +ALL INNER JOIN ( SELECT name AS database FROM `system`.databases ) AS db @@ -66,7 +66,7 @@ FROM database AS x FROM `system`.tables ) AS t -INNER JOIN ( +ALL INNER JOIN ( SELECT name AS x FROM `system`.databases ) AS db @@ -209,7 +209,7 @@ SELECT t.name FROM `system`.tables AS t -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 'system' AS base, 'one' AS name diff --git a/tests/clickhouse-reference/00725_join_on_bug_1.sql.expected.ast.json b/tests/clickhouse-reference/00725_join_on_bug_1.sql.expected.ast.json index 30493b2e5..40de2b6dd 100644 --- a/tests/clickhouse-reference/00725_join_on_bug_1.sql.expected.ast.json +++ b/tests/clickhouse-reference/00725_join_on_bug_1.sql.expected.ast.json @@ -186,7 +186,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00725_join_on_bug_1.sql.expected.formatted.sql b/tests/clickhouse-reference/00725_join_on_bug_1.sql.expected.formatted.sql index 0044cb384..d4a83484c 100644 --- a/tests/clickhouse-reference/00725_join_on_bug_1.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00725_join_on_bug_1.sql.expected.formatted.sql @@ -33,6 +33,6 @@ SELECT a2.* FROM a1 -LEFT JOIN a2 +ANY LEFT JOIN a2 USING (a) ORDER BY b ASC; \ No newline at end of file diff --git a/tests/clickhouse-reference/00725_join_on_bug_2.sql.expected.ast.json b/tests/clickhouse-reference/00725_join_on_bug_2.sql.expected.ast.json index 4e1998bf9..048196e61 100644 --- a/tests/clickhouse-reference/00725_join_on_bug_2.sql.expected.ast.json +++ b/tests/clickhouse-reference/00725_join_on_bug_2.sql.expected.ast.json @@ -215,7 +215,8 @@ "a", "b" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -263,7 +264,8 @@ "a", "b" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -403,7 +405,8 @@ ], "parenthesized": true } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -507,7 +510,8 @@ ], "parenthesized": true } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -644,7 +648,8 @@ ], "parenthesized": true } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -731,7 +736,8 @@ ], "parenthesized": true } - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00725_join_on_bug_2.sql.expected.formatted.sql b/tests/clickhouse-reference/00725_join_on_bug_2.sql.expected.formatted.sql index 148917844..96d2c812d 100644 --- a/tests/clickhouse-reference/00725_join_on_bug_2.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00725_join_on_bug_2.sql.expected.formatted.sql @@ -33,7 +33,7 @@ SELECT s_b FROM t_00725_2 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT a, b, @@ -49,7 +49,7 @@ SELECT s_00725_2.* FROM t_00725_2 -LEFT JOIN s_00725_2 +ALL LEFT JOIN s_00725_2 USING (a, b) ORDER BY `ALL` ASC; @@ -60,7 +60,7 @@ SELECT s_b FROM t_00725_2 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT a, b, @@ -75,7 +75,7 @@ ORDER BY `ALL` ASC; SELECT * FROM t_00725_2 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT a AS s_a, b AS s_b @@ -92,7 +92,7 @@ SELECT s_b FROM t_00725_2 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT a, b, @@ -109,7 +109,7 @@ SELECT s_00725_2.* FROM t_00725_2 -LEFT JOIN s_00725_2 +ALL LEFT JOIN s_00725_2 ON (s_00725_2.a = t_00725_2.a AND s_00725_2.b = t_00725_2.b) ORDER BY `ALL` ASC; \ No newline at end of file diff --git a/tests/clickhouse-reference/00725_join_on_bug_3.sql.expected.ast.json b/tests/clickhouse-reference/00725_join_on_bug_3.sql.expected.ast.json index ce268228d..420ab6723 100644 --- a/tests/clickhouse-reference/00725_join_on_bug_3.sql.expected.ast.json +++ b/tests/clickhouse-reference/00725_join_on_bug_3.sql.expected.ast.json @@ -169,7 +169,8 @@ ], "parenthesized": true } - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00725_join_on_bug_3.sql.expected.formatted.sql b/tests/clickhouse-reference/00725_join_on_bug_3.sql.expected.formatted.sql index 85a5948ee..851292156 100644 --- a/tests/clickhouse-reference/00725_join_on_bug_3.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00725_join_on_bug_3.sql.expected.formatted.sql @@ -26,7 +26,7 @@ INSERT INTO z_00725_3; SELECT * FROM t_00725_3 -LEFT JOIN z_00725_3 +ALL LEFT JOIN z_00725_3 ON (z_00725_3.c = t_00725_3.a AND z_00725_3.d = t_00725_3.b) ORDER BY t_00725_3.a ASC; \ No newline at end of file diff --git a/tests/clickhouse-reference/00725_join_on_bug_4.sql.expected.ast.json b/tests/clickhouse-reference/00725_join_on_bug_4.sql.expected.ast.json index 91bb390ed..5c026f361 100644 --- a/tests/clickhouse-reference/00725_join_on_bug_4.sql.expected.ast.json +++ b/tests/clickhouse-reference/00725_join_on_bug_4.sql.expected.ast.json @@ -169,7 +169,8 @@ ], "parenthesized": true } - } + }, + "strictness": "ALL" }, "where": { "kind": "naryExpr", diff --git a/tests/clickhouse-reference/00725_join_on_bug_4.sql.expected.formatted.sql b/tests/clickhouse-reference/00725_join_on_bug_4.sql.expected.formatted.sql index 4f18e64e6..308762e22 100644 --- a/tests/clickhouse-reference/00725_join_on_bug_4.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00725_join_on_bug_4.sql.expected.formatted.sql @@ -25,7 +25,7 @@ INSERT INTO s_00725_4; SELECT t_00725_4.* FROM t_00725_4 -LEFT JOIN s_00725_4 +ALL LEFT JOIN s_00725_4 ON (s_00725_4.a = t_00725_4.a AND s_00725_4.b = t_00725_4.b) WHERE s_00725_4.a = 0 diff --git a/tests/clickhouse-reference/00740_database_in_nested_view.sql.expected.ast.json b/tests/clickhouse-reference/00740_database_in_nested_view.sql.expected.ast.json index 44a81f4fb..14d31a402 100644 --- a/tests/clickhouse-reference/00740_database_in_nested_view.sql.expected.ast.json +++ b/tests/clickhouse-reference/00740_database_in_nested_view.sql.expected.ast.json @@ -148,7 +148,8 @@ "columns": [ "N" ] - } + }, + "strictness": "ANY" } } }, diff --git a/tests/clickhouse-reference/00740_database_in_nested_view.sql.expected.formatted.sql b/tests/clickhouse-reference/00740_database_in_nested_view.sql.expected.formatted.sql index 4d836ec2e..fd70cf749 100644 --- a/tests/clickhouse-reference/00740_database_in_nested_view.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00740_database_in_nested_view.sql.expected.formatted.sql @@ -30,7 +30,7 @@ SELECT N AS x FROM test_00740 -LEFT JOIN test_00740 +ANY LEFT JOIN test_00740 USING (N); SELECT * diff --git a/tests/clickhouse-reference/00740_optimize_predicate_expression.sql.expected.ast.json b/tests/clickhouse-reference/00740_optimize_predicate_expression.sql.expected.ast.json index 9254e057f..b241eaadb 100644 --- a/tests/clickhouse-reference/00740_optimize_predicate_expression.sql.expected.ast.json +++ b/tests/clickhouse-reference/00740_optimize_predicate_expression.sql.expected.ast.json @@ -278,7 +278,8 @@ "columns": [ "site" ] - } + }, + "strictness": "ALL" } } }, @@ -509,7 +510,8 @@ "columns": [ "site" ] - } + }, + "strictness": "ALL" } } } diff --git a/tests/clickhouse-reference/00740_optimize_predicate_expression.sql.expected.formatted.sql b/tests/clickhouse-reference/00740_optimize_predicate_expression.sql.expected.formatted.sql index fbf8a1c42..131d1f1f3 100644 --- a/tests/clickhouse-reference/00740_optimize_predicate_expression.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00740_optimize_predicate_expression.sql.expected.formatted.sql @@ -29,7 +29,7 @@ FROM ( FROM perf AS perf_1 WHERE user_id = 0 ) AS jss1 - INNER JOIN ( + ALL INNER JOIN ( SELECT perf_2.site, perf_2.z AS z_2 @@ -51,7 +51,7 @@ FROM ( FROM perf AS perf_1 WHERE user_id = 0 ) AS js1 - INNER JOIN ( + ALL INNER JOIN ( SELECT perf_2.site, perf_2.z AS z_2 diff --git a/tests/clickhouse-reference/00744_join_not_found_column.sql.expected.ast.json b/tests/clickhouse-reference/00744_join_not_found_column.sql.expected.ast.json index b34625c4b..0181837d2 100644 --- a/tests/clickhouse-reference/00744_join_not_found_column.sql.expected.ast.json +++ b/tests/clickhouse-reference/00744_join_not_found_column.sql.expected.ast.json @@ -131,7 +131,8 @@ "columns": [ "1" ] - } + }, + "strictness": "ALL" }, "limit": { "count": { @@ -213,7 +214,8 @@ "columns": [ "1" ] - } + }, + "strictness": "ALL" }, "limit": { "count": { diff --git a/tests/clickhouse-reference/00744_join_not_found_column.sql.expected.formatted.sql b/tests/clickhouse-reference/00744_join_not_found_column.sql.expected.formatted.sql index 54120fc53..08e5c7b05 100644 --- a/tests/clickhouse-reference/00744_join_not_found_column.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00744_join_not_found_column.sql.expected.formatted.sql @@ -21,7 +21,7 @@ FROM ( 1 FROM test_00744 ) - INNER JOIN ( + ALL INNER JOIN ( SELECT count(), 1 @@ -41,7 +41,7 @@ FROM 1 FROM test_00744 ) -INNER JOIN ( +ALL INNER JOIN ( SELECT count(), 1 diff --git a/tests/clickhouse-reference/00749_inner_join_of_unnamed_subqueries.sql.expected.ast.json b/tests/clickhouse-reference/00749_inner_join_of_unnamed_subqueries.sql.expected.ast.json index 63d383c4c..b2a391b6c 100644 --- a/tests/clickhouse-reference/00749_inner_join_of_unnamed_subqueries.sql.expected.ast.json +++ b/tests/clickhouse-reference/00749_inner_join_of_unnamed_subqueries.sql.expected.ast.json @@ -220,7 +220,8 @@ "columns": [ "APIKey" ] - } + }, + "strictness": "ALL" } } }, @@ -229,7 +230,8 @@ "columns": [ "APIKey" ] - } + }, + "strictness": "ALL" } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/00749_inner_join_of_unnamed_subqueries.sql.expected.formatted.sql b/tests/clickhouse-reference/00749_inner_join_of_unnamed_subqueries.sql.expected.formatted.sql index d09678ef7..ae64d01f4 100644 --- a/tests/clickhouse-reference/00749_inner_join_of_unnamed_subqueries.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00749_inner_join_of_unnamed_subqueries.sql.expected.formatted.sql @@ -29,7 +29,7 @@ SELECT ConversionEventValue FROM left_table AS left_table -INNER JOIN ( +ALL INNER JOIN ( SELECT * FROM ( @@ -38,7 +38,7 @@ INNER JOIN ( EventValueForPostback AS ConversionEventValue FROM right_table AS right_table ) - INNER JOIN ( + ALL INNER JOIN ( SELECT APIKey FROM left_table AS left_table GROUP BY APIKey diff --git a/tests/clickhouse-reference/00779_all_right_join_max_block_size.sql.expected.ast.json b/tests/clickhouse-reference/00779_all_right_join_max_block_size.sql.expected.ast.json index 24c8c6043..8377ed345 100644 --- a/tests/clickhouse-reference/00779_all_right_join_max_block_size.sql.expected.ast.json +++ b/tests/clickhouse-reference/00779_all_right_join_max_block_size.sql.expected.ast.json @@ -185,7 +185,8 @@ "columns": [ "s" ] - } + }, + "strictness": "ALL" }, "groupBy": { "kind": "expressions", diff --git a/tests/clickhouse-reference/00779_all_right_join_max_block_size.sql.expected.formatted.sql b/tests/clickhouse-reference/00779_all_right_join_max_block_size.sql.expected.formatted.sql index b18f98cd8..315c01eeb 100644 --- a/tests/clickhouse-reference/00779_all_right_join_max_block_size.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00779_all_right_join_max_block_size.sql.expected.formatted.sql @@ -11,7 +11,7 @@ FROM ( SELECT 1 AS s ) AS js1 -RIGHT JOIN ( +ALL RIGHT JOIN ( SELECT arrayJoin([2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3]) AS s ) AS js2 USING (s) diff --git a/tests/clickhouse-reference/00800_low_cardinality_join.sql.expected.ast.json b/tests/clickhouse-reference/00800_low_cardinality_join.sql.expected.ast.json index e1ce4a875..e9e2c46bf 100644 --- a/tests/clickhouse-reference/00800_low_cardinality_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00800_low_cardinality_join.sql.expected.ast.json @@ -86,7 +86,8 @@ "columns": [ "val" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -168,7 +169,8 @@ "columns": [ "val" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -250,7 +252,8 @@ "columns": [ "val" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -338,7 +341,8 @@ "columns": [ "val" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -426,7 +430,8 @@ "columns": [ "val" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -514,7 +519,8 @@ "columns": [ "val" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -608,7 +614,8 @@ "columns": [ "val" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -702,7 +709,8 @@ "columns": [ "val" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -802,7 +810,8 @@ "columns": [ "val" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -909,7 +918,8 @@ } } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1019,7 +1029,8 @@ } } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1132,7 +1143,8 @@ } } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1245,7 +1257,8 @@ } } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1364,7 +1377,8 @@ } } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1483,7 +1497,8 @@ } } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1602,7 +1617,8 @@ } } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1727,7 +1743,8 @@ } } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1852,7 +1869,8 @@ } } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1983,7 +2001,8 @@ } } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -2104,7 +2123,8 @@ } } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -2231,7 +2251,8 @@ } } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -2358,7 +2379,8 @@ } } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -2491,7 +2513,8 @@ } } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -2630,7 +2653,8 @@ } } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -2769,7 +2793,8 @@ } } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -2914,7 +2939,8 @@ } } } - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00800_low_cardinality_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00800_low_cardinality_join.sql.expected.formatted.sql index ab032dfb5..63cd67512 100644 --- a/tests/clickhouse-reference/00800_low_cardinality_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00800_low_cardinality_join.sql.expected.formatted.sql @@ -8,7 +8,7 @@ FROM SELECT dummy AS val FROM `system`.one ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT dummy AS val FROM `system`.one ) @@ -21,7 +21,7 @@ FROM SELECT toLowCardinality(dummy) AS val FROM `system`.one ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT dummy AS val FROM `system`.one ) @@ -34,7 +34,7 @@ FROM SELECT dummy AS val FROM `system`.one ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(dummy) AS val FROM `system`.one ) @@ -47,7 +47,7 @@ FROM SELECT toLowCardinality(dummy) AS val FROM `system`.one ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(dummy) AS val FROM `system`.one ) @@ -60,7 +60,7 @@ FROM SELECT toLowCardinality(toNullable(dummy)) AS val FROM `system`.one ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT dummy AS val FROM `system`.one ) @@ -73,7 +73,7 @@ FROM SELECT dummy AS val FROM `system`.one ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(toNullable(dummy)) AS val FROM `system`.one ) @@ -86,7 +86,7 @@ FROM SELECT toLowCardinality(toNullable(dummy)) AS val FROM `system`.one ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(dummy) AS val FROM `system`.one ) @@ -99,7 +99,7 @@ FROM SELECT toLowCardinality(dummy) AS val FROM `system`.one ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(toNullable(dummy)) AS val FROM `system`.one ) @@ -112,7 +112,7 @@ FROM SELECT toLowCardinality(toNullable(dummy)) AS val FROM `system`.one ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(toNullable(dummy)) AS val FROM `system`.one ) @@ -125,7 +125,7 @@ FROM SELECT dummy AS val FROM `system`.one ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT dummy AS val FROM `system`.one ) @@ -138,7 +138,7 @@ FROM SELECT dummy AS val FROM `system`.one ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT dummy AS rval FROM `system`.one ) @@ -151,7 +151,7 @@ FROM SELECT toLowCardinality(dummy) AS val FROM `system`.one ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT dummy AS rval FROM `system`.one ) @@ -164,7 +164,7 @@ FROM SELECT dummy AS val FROM `system`.one ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(dummy) AS rval FROM `system`.one ) @@ -177,7 +177,7 @@ FROM SELECT toLowCardinality(dummy) AS val FROM `system`.one ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(dummy) AS rval FROM `system`.one ) @@ -190,7 +190,7 @@ FROM SELECT toLowCardinality(toNullable(dummy)) AS val FROM `system`.one ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT dummy AS rval FROM `system`.one ) @@ -203,7 +203,7 @@ FROM SELECT dummy AS val FROM `system`.one ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(toNullable(dummy)) AS rval FROM `system`.one ) @@ -216,7 +216,7 @@ FROM SELECT toLowCardinality(toNullable(dummy)) AS val FROM `system`.one ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(dummy) AS rval FROM `system`.one ) @@ -229,7 +229,7 @@ FROM SELECT toLowCardinality(dummy) AS val FROM `system`.one ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(toNullable(dummy)) AS rval FROM `system`.one ) @@ -242,7 +242,7 @@ FROM SELECT toLowCardinality(toNullable(dummy)) AS val FROM `system`.one ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(toNullable(dummy)) AS rval FROM `system`.one ) @@ -256,7 +256,7 @@ FROM FROM `system`.numbers LIMIT 3 ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT number AS r FROM `system`.numbers LIMIT 3 @@ -271,7 +271,7 @@ FROM FROM `system`.numbers LIMIT 3 ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT number AS r FROM `system`.numbers LIMIT 3 @@ -286,7 +286,7 @@ FROM FROM `system`.numbers LIMIT 3 ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(number) AS r FROM `system`.numbers LIMIT 3 @@ -301,7 +301,7 @@ FROM FROM `system`.numbers LIMIT 3 ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(number) AS r FROM `system`.numbers LIMIT 3 @@ -316,7 +316,7 @@ FROM FROM `system`.numbers LIMIT 3 ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(number) AS r FROM `system`.numbers LIMIT 3 @@ -331,7 +331,7 @@ FROM FROM `system`.numbers LIMIT 3 ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(toNullable(number)) AS r FROM `system`.numbers LIMIT 3 @@ -346,7 +346,7 @@ FROM FROM `system`.numbers LIMIT 3 ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(toNullable(number)) AS r FROM `system`.numbers LIMIT 3 diff --git a/tests/clickhouse-reference/00816_join_column_names_sarg.sql.expected.ast.json b/tests/clickhouse-reference/00816_join_column_names_sarg.sql.expected.ast.json index 6ba950c4b..c88bb07a8 100644 --- a/tests/clickhouse-reference/00816_join_column_names_sarg.sql.expected.ast.json +++ b/tests/clickhouse-reference/00816_join_column_names_sarg.sql.expected.ast.json @@ -140,7 +140,8 @@ ] } } - } + }, + "strictness": "ALL" } }, { @@ -191,7 +192,8 @@ ] } } - } + }, + "strictness": "ALL" }, "leadingComments": [ "-- Received exception from server (version 18.14.1):", @@ -248,7 +250,8 @@ ] } } - } + }, + "strictness": "ALL" }, "leadingComments": [ "-- and this" diff --git a/tests/clickhouse-reference/00816_join_column_names_sarg.sql.expected.formatted.sql b/tests/clickhouse-reference/00816_join_column_names_sarg.sql.expected.formatted.sql index 510a371da..8f69409d8 100644 --- a/tests/clickhouse-reference/00816_join_column_names_sarg.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00816_join_column_names_sarg.sql.expected.formatted.sql @@ -25,7 +25,7 @@ SELECT t2_00816.a FROM t1_00816 -INNER JOIN t2_00816 +ALL INNER JOIN t2_00816 ON t1_00816.a = t2_00816.a; -- Received exception from server (version 18.14.1): @@ -36,7 +36,7 @@ SELECT t2_00816.* FROM t1_00816 -INNER JOIN t2_00816 +ALL INNER JOIN t2_00816 ON t1_00816.a = t2_00816.a; -- and this @@ -45,7 +45,7 @@ SELECT t2_00816.val FROM t1_00816 -INNER JOIN t2_00816 +ALL INNER JOIN t2_00816 ON t1_00816.a = t2_00816.a; DROP TABLE t1_00816; diff --git a/tests/clickhouse-reference/00818_inner_join_bug_3567.sql.expected.ast.json b/tests/clickhouse-reference/00818_inner_join_bug_3567.sql.expected.ast.json index f52fbcb54..f953741ac 100644 --- a/tests/clickhouse-reference/00818_inner_join_bug_3567.sql.expected.ast.json +++ b/tests/clickhouse-reference/00818_inner_join_bug_3567.sql.expected.ast.json @@ -242,7 +242,8 @@ "a", "b" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -322,7 +323,8 @@ "a", "b" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00818_inner_join_bug_3567.sql.expected.formatted.sql b/tests/clickhouse-reference/00818_inner_join_bug_3567.sql.expected.formatted.sql index b23495d3a..4070c78f1 100644 --- a/tests/clickhouse-reference/00818_inner_join_bug_3567.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00818_inner_join_bug_3567.sql.expected.formatted.sql @@ -41,7 +41,7 @@ FORMAT PrettyCompact; SELECT * FROM table1 AS t1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT *, c, @@ -57,7 +57,7 @@ FORMAT PrettyCompact; SELECT * FROM table1 AS t1 -INNER JOIN ( +ALL INNER JOIN ( SELECT *, c, diff --git a/tests/clickhouse-reference/00819_full_join_wrong_columns_in_block.sql.expected.ast.json b/tests/clickhouse-reference/00819_full_join_wrong_columns_in_block.sql.expected.ast.json index 7f26f4c6c..51cd6afa9 100644 --- a/tests/clickhouse-reference/00819_full_join_wrong_columns_in_block.sql.expected.ast.json +++ b/tests/clickhouse-reference/00819_full_join_wrong_columns_in_block.sql.expected.ast.json @@ -385,7 +385,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" } }, { @@ -455,7 +456,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" } }, { @@ -525,7 +527,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" } }, { @@ -595,7 +598,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" } }, { diff --git a/tests/clickhouse-reference/00819_full_join_wrong_columns_in_block.sql.expected.formatted.sql b/tests/clickhouse-reference/00819_full_join_wrong_columns_in_block.sql.expected.formatted.sql index 34908ff45..90ed3922a 100644 --- a/tests/clickhouse-reference/00819_full_join_wrong_columns_in_block.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00819_full_join_wrong_columns_in_block.sql.expected.formatted.sql @@ -67,7 +67,7 @@ FROM 1 AS a, 'x' AS b ) -INNER JOIN ( +ANY INNER JOIN ( SELECT 1 AS a, 'y' AS b @@ -81,7 +81,7 @@ FROM 1 AS a, 'x' AS b ) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 1 AS a, 'y' AS b @@ -95,7 +95,7 @@ FROM 1 AS a, 'x' AS b ) -FULL JOIN ( +ANY FULL JOIN ( SELECT 1 AS a, 'y' AS b @@ -109,7 +109,7 @@ FROM 1 AS a, 'x' AS b ) -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT 1 AS a, 'y' AS b diff --git a/tests/clickhouse-reference/00821_distributed_storage_with_join_on.sql.expected.ast.json b/tests/clickhouse-reference/00821_distributed_storage_with_join_on.sql.expected.ast.json index 3e1e32ce2..eaf71ec60 100644 --- a/tests/clickhouse-reference/00821_distributed_storage_with_join_on.sql.expected.ast.json +++ b/tests/clickhouse-reference/00821_distributed_storage_with_join_on.sql.expected.ast.json @@ -131,7 +131,8 @@ ] } } - } + }, + "strictness": "ALL" }, "limit": { "count": { @@ -211,7 +212,8 @@ ] } } - } + }, + "strictness": "ALL" }, "limit": { "count": { @@ -285,7 +287,8 @@ ] } } - } + }, + "strictness": "ALL" }, "limit": { "count": { diff --git a/tests/clickhouse-reference/00821_distributed_storage_with_join_on.sql.expected.formatted.sql b/tests/clickhouse-reference/00821_distributed_storage_with_join_on.sql.expected.formatted.sql index 9cec86b52..7e06510ed 100644 --- a/tests/clickhouse-reference/00821_distributed_storage_with_join_on.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00821_distributed_storage_with_join_on.sql.expected.formatted.sql @@ -13,14 +13,14 @@ ENGINE = Distributed('test_shard_localhost', `system`, tables); SELECT 1 FROM table1 AS T1 -INNER JOIN table2 AS T2 +ALL INNER JOIN table2 AS T2 ON T1.table = T2.name LIMIT 1; SELECT 1 FROM cluster('test_shard_localhost', `system`.`columns`) AS T1 -INNER JOIN cluster('test_shard_localhost', `system`.tables) AS T2 +ALL INNER JOIN cluster('test_shard_localhost', `system`.tables) AS T2 ON T1.table = T2.name LIMIT 1; @@ -30,7 +30,7 @@ FROM SELECT * FROM table1 ) AS T1 -INNER JOIN ( +ALL INNER JOIN ( SELECT * FROM table2 ) AS T2 diff --git a/tests/clickhouse-reference/00826_cross_to_inner_join.sql.expected.ast.json b/tests/clickhouse-reference/00826_cross_to_inner_join.sql.expected.ast.json index c4e994e3b..7dd390fcf 100644 --- a/tests/clickhouse-reference/00826_cross_to_inner_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00826_cross_to_inner_join.sql.expected.ast.json @@ -1199,6 +1199,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2_00826" @@ -1249,6 +1250,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2_00826" @@ -1299,6 +1301,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2_00826" @@ -1448,6 +1451,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2_00826" @@ -2433,6 +2437,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2_00826" @@ -2487,6 +2492,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2_00826" diff --git a/tests/clickhouse-reference/00826_cross_to_inner_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00826_cross_to_inner_join.sql.expected.formatted.sql index 0bc3448a4..bafd7288a 100644 --- a/tests/clickhouse-reference/00826_cross_to_inner_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00826_cross_to_inner_join.sql.expected.formatted.sql @@ -137,21 +137,21 @@ ORDER BY `ALL` ASC; SELECT * FROM t1_00826 -CROSS JOIN t2_00826 +, t2_00826 WHERE t1_00826.a = t2_00826.a ORDER BY `ALL` ASC; SELECT * FROM t1_00826 -CROSS JOIN t2_00826 +, t2_00826 WHERE t1_00826.b = t2_00826.b ORDER BY `ALL` ASC; SELECT * FROM t1_00826 -CROSS JOIN t2_00826 +, t2_00826 WHERE t1_00826.a = t2_00826.a AND ((isNull(t2_00826.b) OR t2_00826.b < 2)) @@ -169,7 +169,7 @@ EXPLAIN SYNTAX SELECT * FROM t1_00826 -CROSS JOIN t2_00826 +, t2_00826 WHERE t1_00826.a = t2_00826.a ORDER BY `all` ASC; @@ -272,7 +272,7 @@ EXPLAIN SYNTAX SELECT * FROM t1_00826 -CROSS JOIN t2_00826 +, t2_00826 WHERE t1_00826.b = t2_00826.b ORDER BY `all` ASC; @@ -280,7 +280,7 @@ EXPLAIN SYNTAX SELECT * FROM t1_00826 -CROSS JOIN t2_00826 +, t2_00826 WHERE t1_00826.a = t2_00826.a AND ((isNull(t2_00826.b) OR t2_00826.b < 2)) diff --git a/tests/clickhouse-reference/00829_bitmap64_function.sql.expected.ast.json b/tests/clickhouse-reference/00829_bitmap64_function.sql.expected.ast.json index 34cfc423a..ac74d44c0 100644 --- a/tests/clickhouse-reference/00829_bitmap64_function.sql.expected.ast.json +++ b/tests/clickhouse-reference/00829_bitmap64_function.sql.expected.ast.json @@ -815,7 +815,8 @@ "columns": [ "city_id" ] - } + }, + "strictness": "ALL" } }, { @@ -1120,7 +1121,8 @@ "columns": [ "city_id" ] - } + }, + "strictness": "ALL" } }, { diff --git a/tests/clickhouse-reference/00829_bitmap64_function.sql.expected.formatted.sql b/tests/clickhouse-reference/00829_bitmap64_function.sql.expected.formatted.sql index 646c822b7..2711e296b 100644 --- a/tests/clickhouse-reference/00829_bitmap64_function.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00829_bitmap64_function.sql.expected.formatted.sql @@ -85,7 +85,7 @@ FROM GROUP BY city_id ORDER BY city_id ASC ) AS js1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT city_id, groupBitmapState(uid) AS day_before @@ -113,7 +113,7 @@ FROM GROUP BY city_id ORDER BY city_id ASC ) AS js1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT city_id, groupBitmapState(uid) AS day_before diff --git a/tests/clickhouse-reference/00829_bitmap_function.sql.expected.ast.json b/tests/clickhouse-reference/00829_bitmap_function.sql.expected.ast.json index 96572b095..1190d7215 100644 --- a/tests/clickhouse-reference/00829_bitmap_function.sql.expected.ast.json +++ b/tests/clickhouse-reference/00829_bitmap_function.sql.expected.ast.json @@ -1349,7 +1349,8 @@ "columns": [ "city_id" ] - } + }, + "strictness": "ALL" } }, { @@ -1654,7 +1655,8 @@ "columns": [ "city_id" ] - } + }, + "strictness": "ALL" } }, { @@ -13146,7 +13148,8 @@ "columns": [ "city_id" ] - } + }, + "strictness": "ALL" }, "format": "Null" }, diff --git a/tests/clickhouse-reference/00829_bitmap_function.sql.expected.formatted.sql b/tests/clickhouse-reference/00829_bitmap_function.sql.expected.formatted.sql index 8254226f6..9a23f8650 100644 --- a/tests/clickhouse-reference/00829_bitmap_function.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00829_bitmap_function.sql.expected.formatted.sql @@ -78,7 +78,7 @@ FROM GROUP BY city_id ORDER BY city_id ASC ) AS js1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT city_id, groupBitmapState(uid) AS day_before @@ -106,7 +106,7 @@ FROM GROUP BY city_id ORDER BY city_id ASC ) AS js1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT city_id, groupBitmapState(uid) AS day_before @@ -566,7 +566,7 @@ FROM rand((rand((rand('') % nan) = NULL) % 7) % rand(NULL)), city_id ) AS js1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT city_id, groupBitmapState(uid) AS day_before diff --git a/tests/clickhouse-reference/00830_join_overwrite.sql.expected.ast.json b/tests/clickhouse-reference/00830_join_overwrite.sql.expected.ast.json index a47f2a42a..fef22241c 100644 --- a/tests/clickhouse-reference/00830_join_overwrite.sql.expected.ast.json +++ b/tests/clickhouse-reference/00830_join_overwrite.sql.expected.ast.json @@ -316,7 +316,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "settings": [ { @@ -369,7 +370,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "settings": [ { diff --git a/tests/clickhouse-reference/00830_join_overwrite.sql.expected.formatted.sql b/tests/clickhouse-reference/00830_join_overwrite.sql.expected.formatted.sql index c74627948..6d80b0c3f 100644 --- a/tests/clickhouse-reference/00830_join_overwrite.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00830_join_overwrite.sql.expected.formatted.sql @@ -45,7 +45,7 @@ FROM ( SELECT 1 AS k ) AS t1 -INNER JOIN t2 +ANY INNER JOIN t2 USING (k) SETTINGS join_any_take_last_row = 0; @@ -54,7 +54,7 @@ FROM ( SELECT 1 AS k ) AS t1 -INNER JOIN t2 +ANY INNER JOIN t2 USING (k) SETTINGS join_any_take_last_row = 1; diff --git a/tests/clickhouse-reference/00844_join_lightee2.sql.expected.ast.json b/tests/clickhouse-reference/00844_join_lightee2.sql.expected.ast.json index 8fa8a3c70..66bc9d8bb 100644 --- a/tests/clickhouse-reference/00844_join_lightee2.sql.expected.ast.json +++ b/tests/clickhouse-reference/00844_join_lightee2.sql.expected.ast.json @@ -160,7 +160,8 @@ ] } } - } + }, + "strictness": "ALL" }, "where": { "kind": "binaryExpr", diff --git a/tests/clickhouse-reference/00844_join_lightee2.sql.expected.formatted.sql b/tests/clickhouse-reference/00844_join_lightee2.sql.expected.formatted.sql index ce11b885a..1df1b27be 100644 --- a/tests/clickhouse-reference/00844_join_lightee2.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00844_join_lightee2.sql.expected.formatted.sql @@ -27,7 +27,7 @@ SELECT t2_00844.f3 FROM t1_00844 -INNER JOIN t2_00844 +ALL INNER JOIN t2_00844 ON t1_00844.f2 = t2_00844.f1 WHERE t2_00844.f1 = '1'; diff --git a/tests/clickhouse-reference/00846_join_using_tuple_crash.sql.expected.ast.json b/tests/clickhouse-reference/00846_join_using_tuple_crash.sql.expected.ast.json index 8da3bc798..cf6238489 100644 --- a/tests/clickhouse-reference/00846_join_using_tuple_crash.sql.expected.ast.json +++ b/tests/clickhouse-reference/00846_join_using_tuple_crash.sql.expected.ast.json @@ -271,7 +271,9 @@ "a", "tup" ] - } + }, + "strictness": "ANY", + "global": true } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/00846_join_using_tuple_crash.sql.expected.formatted.sql b/tests/clickhouse-reference/00846_join_using_tuple_crash.sql.expected.formatted.sql index 5d0d486fe..3f3ba61b7 100644 --- a/tests/clickhouse-reference/00846_join_using_tuple_crash.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00846_join_using_tuple_crash.sql.expected.formatted.sql @@ -24,7 +24,7 @@ FROM (toUInt8(0), toUInt8(0)) AS tup FROM `system`.one ) AS js1 -FULL JOIN ( +GLOBAL ANY FULL JOIN ( SELECT dummy AS a, (toUInt8(0), toUInt8(0)) AS tup diff --git a/tests/clickhouse-reference/00848_join_use_nulls_segfault.sql.expected.ast.json b/tests/clickhouse-reference/00848_join_use_nulls_segfault.sql.expected.ast.json index 927a9c18d..5fd217f85 100644 --- a/tests/clickhouse-reference/00848_join_use_nulls_segfault.sql.expected.ast.json +++ b/tests/clickhouse-reference/00848_join_use_nulls_segfault.sql.expected.ast.json @@ -234,7 +234,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -327,7 +328,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -420,7 +422,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -795,7 +798,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -969,7 +973,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1047,7 +1052,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1125,7 +1131,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1440,7 +1447,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1612,7 +1620,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1678,7 +1687,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1744,7 +1754,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -2011,7 +2022,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00848_join_use_nulls_segfault.sql.expected.formatted.sql b/tests/clickhouse-reference/00848_join_use_nulls_segfault.sql.expected.formatted.sql index 56c85c8b8..51bd7bb03 100644 --- a/tests/clickhouse-reference/00848_join_use_nulls_segfault.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00848_join_use_nulls_segfault.sql.expected.formatted.sql @@ -37,7 +37,7 @@ SELECT toTypeName(t3.id) FROM t1_00848 AS t1 -LEFT JOIN t3_00848 AS t3 +ANY LEFT JOIN t3_00848 AS t3 ON t1.id = t3.id ORDER BY t1.id ASC, @@ -49,7 +49,7 @@ SELECT toTypeName(t3.id) FROM t1_00848 AS t1 -FULL JOIN t3_00848 AS t3 +ANY FULL JOIN t3_00848 AS t3 ON t1.id = t3.id ORDER BY t1.id ASC, @@ -61,7 +61,7 @@ SELECT toTypeName(t3.id) FROM t2_00848 AS t2 -FULL JOIN t3_00848 AS t3 +ANY FULL JOIN t3_00848 AS t3 ON t2.id = t3.id ORDER BY t2.id ASC, @@ -108,7 +108,7 @@ SELECT t3.not_id = 'l' FROM t1_00848 AS t1 -LEFT JOIN t3_00848 AS t3 +ANY LEFT JOIN t3_00848 AS t3 ON t1.id = t3.id ORDER BY t1.id ASC, @@ -131,7 +131,7 @@ SELECT toTypeName(t3.id) FROM t1_00848 AS t1 -LEFT JOIN t3_00848 AS t3 +ANY LEFT JOIN t3_00848 AS t3 USING (id) ORDER BY t1.id ASC, @@ -143,7 +143,7 @@ SELECT toTypeName(t3.id) FROM t1_00848 AS t1 -FULL JOIN t3_00848 AS t3 +ANY FULL JOIN t3_00848 AS t3 USING (id) ORDER BY t1.id ASC, @@ -155,7 +155,7 @@ SELECT toTypeName(t3.id) FROM t2_00848 AS t2 -FULL JOIN t3_00848 AS t3 +ANY FULL JOIN t3_00848 AS t3 USING (id) ORDER BY t2.id ASC, @@ -202,7 +202,7 @@ SELECT t3.not_id = 'l' FROM t1_00848 AS t1 -LEFT JOIN t3_00848 AS t3 +ANY LEFT JOIN t3_00848 AS t3 USING (id) ORDER BY t1.id ASC, @@ -227,7 +227,7 @@ SELECT toTypeName(t3.id) FROM t1_00848 AS t1 -LEFT JOIN t3_00848 AS t3 +ANY LEFT JOIN t3_00848 AS t3 USING (id) ORDER BY id ASC; @@ -237,7 +237,7 @@ SELECT toTypeName(t3.id) FROM t1_00848 AS t1 -FULL JOIN t3_00848 AS t3 +ANY FULL JOIN t3_00848 AS t3 USING (id) ORDER BY id ASC; @@ -247,7 +247,7 @@ SELECT toTypeName(t3.id) FROM t2_00848 AS t2 -FULL JOIN t3_00848 AS t3 +ANY FULL JOIN t3_00848 AS t3 USING (id) ORDER BY id ASC; @@ -286,7 +286,7 @@ SELECT t3.not_id = 'l' FROM t1_00848 AS t1 -LEFT JOIN t3_00848 AS t3 +ANY LEFT JOIN t3_00848 AS t3 USING (id) ORDER BY id ASC; diff --git a/tests/clickhouse-reference/00849_multiple_comma_join_2.sql.expected.ast.json b/tests/clickhouse-reference/00849_multiple_comma_join_2.sql.expected.ast.json index ac64cd0a4..43e3f8123 100644 --- a/tests/clickhouse-reference/00849_multiple_comma_join_2.sql.expected.ast.json +++ b/tests/clickhouse-reference/00849_multiple_comma_join_2.sql.expected.ast.json @@ -319,6 +319,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -445,6 +446,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -569,6 +571,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -576,6 +579,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -724,6 +728,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -731,6 +736,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -880,6 +886,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -887,6 +894,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -894,6 +902,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -1061,6 +1070,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -1068,6 +1078,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -1075,6 +1086,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -1242,6 +1254,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -1249,6 +1262,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -1256,6 +1270,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -1423,6 +1438,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -1430,6 +1446,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -1437,6 +1454,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -1604,6 +1622,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -1611,6 +1630,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -1618,6 +1638,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -1785,6 +1806,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -1792,6 +1814,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -1799,6 +1822,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -1966,6 +1990,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -1973,6 +1998,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -1980,6 +2006,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -2207,6 +2234,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -2572,6 +2600,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -2709,6 +2738,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -2843,6 +2873,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -2850,6 +2881,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -3008,6 +3040,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -3015,6 +3048,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -3174,6 +3208,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -3181,6 +3216,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -3188,6 +3224,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -3365,6 +3402,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -3372,6 +3410,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -3379,6 +3418,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -3556,6 +3596,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -3563,6 +3604,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -3570,6 +3612,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -3747,6 +3790,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -3754,6 +3798,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -3761,6 +3806,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -3938,6 +3984,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -3945,6 +3992,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -3952,6 +4000,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -4129,6 +4178,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -4136,6 +4186,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -4143,6 +4194,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -4320,6 +4372,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -4327,6 +4380,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -4334,6 +4388,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -4581,6 +4636,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -4950,6 +5006,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -4994,6 +5051,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -5067,6 +5125,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -5124,6 +5183,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -5131,6 +5191,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -5236,6 +5297,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -5243,6 +5305,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -5332,6 +5395,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -5339,6 +5403,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -5346,6 +5411,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -5488,6 +5554,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -5495,6 +5562,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -5502,6 +5570,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -5609,6 +5678,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -5616,6 +5686,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -5623,6 +5694,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" diff --git a/tests/clickhouse-reference/00849_multiple_comma_join_2.sql.expected.formatted.sql b/tests/clickhouse-reference/00849_multiple_comma_join_2.sql.expected.formatted.sql index 40aeb3807..8383f5bbd 100644 --- a/tests/clickhouse-reference/00849_multiple_comma_join_2.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00849_multiple_comma_join_2.sql.expected.formatted.sql @@ -52,7 +52,7 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 + , t2 WHERE t1.a = t2.a ); @@ -65,7 +65,7 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 + , t2 WHERE t1.b = t2.b ); @@ -78,8 +78,8 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 - CROSS JOIN t3 + , t2 + , t3 WHERE t1.a = t2.a AND t1.a = t3.a ); @@ -93,8 +93,8 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 - CROSS JOIN t3 + , t2 + , t3 WHERE t1.b = t2.b AND t1.b = t3.b ); @@ -108,9 +108,9 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 - CROSS JOIN t3 - CROSS JOIN t4 + , t2 + , t3 + , t4 WHERE t1.a = t2.a AND t1.a = t3.a AND t1.a = t4.a @@ -125,9 +125,9 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 - CROSS JOIN t3 - CROSS JOIN t4 + , t2 + , t3 + , t4 WHERE t1.b = t2.b AND t1.b = t3.b AND t1.b = t4.b @@ -142,9 +142,9 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 - CROSS JOIN t3 - CROSS JOIN t4 + , t2 + , t3 + , t4 WHERE t2.a = t1.a AND t2.a = t3.a AND t2.a = t4.a @@ -159,9 +159,9 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 - CROSS JOIN t3 - CROSS JOIN t4 + , t2 + , t3 + , t4 WHERE t3.a = t1.a AND t3.a = t2.a AND t3.a = t4.a @@ -176,9 +176,9 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 - CROSS JOIN t3 - CROSS JOIN t4 + , t2 + , t3 + , t4 WHERE t4.a = t1.a AND t4.a = t2.a AND t4.a = t3.a @@ -193,9 +193,9 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 - CROSS JOIN t3 - CROSS JOIN t4 + , t2 + , t3 + , t4 WHERE t1.a = t2.a AND t2.a = t3.a AND t3.a = t4.a @@ -210,9 +210,9 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 - CROSS JOIN t3 - CROSS JOIN t4 + , t2 + , t3 + , t4 ); SELECT @@ -238,7 +238,7 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 + , t2 CROSS JOIN t3 ); @@ -281,7 +281,7 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 + , t2 WHERE t1.a = t2.a ) SETTINGS enable_analyzer = 1; @@ -295,7 +295,7 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 + , t2 WHERE t1.b = t2.b ) SETTINGS enable_analyzer = 1; @@ -309,8 +309,8 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 - CROSS JOIN t3 + , t2 + , t3 WHERE t1.a = t2.a AND t1.a = t3.a ) @@ -325,8 +325,8 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 - CROSS JOIN t3 + , t2 + , t3 WHERE t1.b = t2.b AND t1.b = t3.b ) @@ -341,9 +341,9 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 - CROSS JOIN t3 - CROSS JOIN t4 + , t2 + , t3 + , t4 WHERE t1.a = t2.a AND t1.a = t3.a AND t1.a = t4.a @@ -359,9 +359,9 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 - CROSS JOIN t3 - CROSS JOIN t4 + , t2 + , t3 + , t4 WHERE t1.b = t2.b AND t1.b = t3.b AND t1.b = t4.b @@ -377,9 +377,9 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 - CROSS JOIN t3 - CROSS JOIN t4 + , t2 + , t3 + , t4 WHERE t2.a = t1.a AND t2.a = t3.a AND t2.a = t4.a @@ -395,9 +395,9 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 - CROSS JOIN t3 - CROSS JOIN t4 + , t2 + , t3 + , t4 WHERE t3.a = t1.a AND t3.a = t2.a AND t3.a = t4.a @@ -413,9 +413,9 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 - CROSS JOIN t3 - CROSS JOIN t4 + , t2 + , t3 + , t4 WHERE t4.a = t1.a AND t4.a = t2.a AND t4.a = t3.a @@ -431,9 +431,9 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 - CROSS JOIN t3 - CROSS JOIN t4 + , t2 + , t3 + , t4 WHERE t1.a = t2.a AND t2.a = t3.a AND t3.a = t4.a @@ -449,9 +449,9 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 - CROSS JOIN t3 - CROSS JOIN t4 + , t2 + , t3 + , t4 ) SETTINGS enable_analyzer = 1; @@ -479,7 +479,7 @@ FROM ( SELECT t1.a FROM t1 - CROSS JOIN t2 + , t2 CROSS JOIN t3 ) SETTINGS enable_analyzer = 1; @@ -528,7 +528,7 @@ SET enable_analyzer = 1; SELECT * FROM t1 -CROSS JOIN t2 +, t2 ORDER BY t1.a ASC, t2.b ASC; @@ -536,7 +536,7 @@ ORDER BY SELECT * FROM t1 -CROSS JOIN t2 +, t2 WHERE t1.a = t2.a ORDER BY t1.a ASC, @@ -547,7 +547,7 @@ SELECT t2.b FROM t1 -CROSS JOIN t2 +, t2 WHERE t1.b = t2.b; SELECT @@ -556,8 +556,8 @@ SELECT t3.b FROM t1 -CROSS JOIN t2 -CROSS JOIN t3 +, t2 +, t3 WHERE t1.a = t2.a AND t1.a = t3.a ORDER BY @@ -570,8 +570,8 @@ SELECT t3.b FROM t1 -CROSS JOIN t2 -CROSS JOIN t3 +, t2 +, t3 WHERE t1.b = t2.b AND t1.b = t3.b; @@ -582,9 +582,9 @@ SELECT t4.b FROM t1 -CROSS JOIN t2 -CROSS JOIN t3 -CROSS JOIN t4 +, t2 +, t3 +, t4 WHERE t1.a = t2.a AND t1.a = t3.a AND t1.a = t4.a @@ -600,9 +600,9 @@ SELECT t4.b FROM t1 -CROSS JOIN t2 -CROSS JOIN t3 -CROSS JOIN t4 +, t2 +, t3 +, t4 WHERE t1.b = t2.b AND t1.b = t3.b AND t1.b = t4.b; @@ -614,9 +614,9 @@ SELECT t4.b FROM t1 -CROSS JOIN t2 -CROSS JOIN t3 -CROSS JOIN t4 +, t2 +, t3 +, t4 WHERE t1.a = t2.a AND t2.a = t3.a AND t3.a = t4.a diff --git a/tests/clickhouse-reference/00850_global_join_dups.sql.expected.ast.json b/tests/clickhouse-reference/00850_global_join_dups.sql.expected.ast.json index f5a74c59e..71f20cc79 100644 --- a/tests/clickhouse-reference/00850_global_join_dups.sql.expected.ast.json +++ b/tests/clickhouse-reference/00850_global_join_dups.sql.expected.ast.json @@ -215,7 +215,8 @@ "columns": [ "dummy" ] - } + }, + "global": true } }, { @@ -393,7 +394,8 @@ "columns": [ "dummy" ] - } + }, + "global": true }, "leadingComments": [ "-- query from fuzzer" @@ -577,7 +579,8 @@ "columns": [ "dummy" ] - } + }, + "global": true } } }, @@ -586,7 +589,8 @@ "columns": [ "dummy" ] - } + }, + "global": true } }, { @@ -706,7 +710,8 @@ "columns": [ "dummy" ] - } + }, + "global": true } } }, @@ -715,7 +720,8 @@ "columns": [ "dummy" ] - } + }, + "global": true } }, { @@ -832,7 +838,8 @@ "columns": [ "dummy" ] - } + }, + "global": true } }, { @@ -943,7 +950,8 @@ "columns": [ "dummy" ] - } + }, + "global": true } }, { @@ -1058,7 +1066,8 @@ "columns": [ "dummy" ] - } + }, + "global": true } } }, @@ -1067,7 +1076,8 @@ "columns": [ "dummy" ] - } + }, + "global": true } }, { @@ -1188,7 +1198,8 @@ "columns": [ "dummy" ] - } + }, + "global": true } } }, @@ -1197,7 +1208,8 @@ "columns": [ "dummy" ] - } + }, + "global": true } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/00850_global_join_dups.sql.expected.formatted.sql b/tests/clickhouse-reference/00850_global_join_dups.sql.expected.formatted.sql index b049e05ab..df5fa59f2 100644 --- a/tests/clickhouse-reference/00850_global_join_dups.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00850_global_join_dups.sql.expected.formatted.sql @@ -30,7 +30,7 @@ SET joined_subquery_requires_alias = 0; SELECT * FROM t1_00850 -INNER JOIN ( +GLOBAL INNER JOIN ( SELECT * FROM ( @@ -49,7 +49,7 @@ INNER JOIN ( SELECT toDateTime64(toString(toString('0000-00-00 00:00:000000-00-00 00:00:00', toDateTime64(toDateTime64('655.36', -2, NULL)))), NULL) FROM t1_00850 -INNER JOIN ( +GLOBAL INNER JOIN ( SELECT toDateTime64(toDateTime64('6553.6', '', NULL), NULL), * @@ -79,14 +79,14 @@ DROP TABLE t2_00850; SELECT * FROM remote('127.0.0.2', `system`.one) -INNER JOIN ( +GLOBAL INNER JOIN ( SELECT * FROM ( SELECT dummy FROM remote('127.0.0.2', `system`.one) ) AS t1_00850 - INNER JOIN ( + GLOBAL INNER JOIN ( SELECT dummy FROM remote('127.0.0.3', `system`.one) ) AS t2_00850 @@ -97,7 +97,7 @@ INNER JOIN ( SELECT * FROM remote('127.0.0.2', `system`.one) -INNER JOIN ( +GLOBAL INNER JOIN ( SELECT *, dummy @@ -106,7 +106,7 @@ INNER JOIN ( SELECT dummy FROM remote('127.0.0.2', `system`.one) ) AS t1_00850 - INNER JOIN ( + GLOBAL INNER JOIN ( SELECT dummy FROM remote('127.0.0.3', `system`.one) ) AS t2_00850 @@ -117,7 +117,7 @@ INNER JOIN ( SELECT * FROM remote('127.0.0.2', `system`.one) -INNER JOIN ( +GLOBAL INNER JOIN ( SELECT *, t1_00850.*, @@ -136,7 +136,7 @@ INNER JOIN ( SELECT * FROM remote('127.0.0.2', `system`.one) -INNER JOIN ( +GLOBAL INNER JOIN ( SELECT *, dummy @@ -154,7 +154,7 @@ INNER JOIN ( SELECT * FROM remote('127.0.0.2', `system`.one) -INNER JOIN ( +GLOBAL INNER JOIN ( SELECT *, dummy AS other @@ -163,7 +163,7 @@ INNER JOIN ( SELECT dummy FROM remote('127.0.0.3', `system`.one) ) AS t1_00850 - INNER JOIN ( + GLOBAL INNER JOIN ( SELECT toUInt8(0) AS dummy ) AS t2_00850 USING (dummy) @@ -173,7 +173,7 @@ INNER JOIN ( SELECT * FROM remote('127.0.0.2', `system`.one) -INNER JOIN ( +GLOBAL INNER JOIN ( SELECT *, dummy, @@ -182,7 +182,7 @@ INNER JOIN ( ( SELECT toUInt8(0) AS dummy ) AS t1_00850 - INNER JOIN ( + GLOBAL INNER JOIN ( SELECT dummy FROM remote('127.0.0.3', `system`.one) ) AS t2_00850 diff --git a/tests/clickhouse-reference/00852_any_join_nulls.sql.expected.ast.json b/tests/clickhouse-reference/00852_any_join_nulls.sql.expected.ast.json index 49e68313c..8c4b181d3 100644 --- a/tests/clickhouse-reference/00852_any_join_nulls.sql.expected.ast.json +++ b/tests/clickhouse-reference/00852_any_join_nulls.sql.expected.ast.json @@ -129,7 +129,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { diff --git a/tests/clickhouse-reference/00852_any_join_nulls.sql.expected.formatted.sql b/tests/clickhouse-reference/00852_any_join_nulls.sql.expected.formatted.sql index 65caec267..be27b5796 100644 --- a/tests/clickhouse-reference/00852_any_join_nulls.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00852_any_join_nulls.sql.expected.formatted.sql @@ -21,7 +21,7 @@ SELECT isNull(table2.parent_id) FROM table1 -LEFT JOIN table2 +ANY LEFT JOIN table2 ON table1.id = table2.parent_id; SET join_use_nulls = 1; diff --git a/tests/clickhouse-reference/00853_join_with_nulls_crash.sql.expected.ast.json b/tests/clickhouse-reference/00853_join_with_nulls_crash.sql.expected.ast.json index b8fb6e3ae..0c7bd36eb 100644 --- a/tests/clickhouse-reference/00853_join_with_nulls_crash.sql.expected.ast.json +++ b/tests/clickhouse-reference/00853_join_with_nulls_crash.sql.expected.ast.json @@ -296,7 +296,8 @@ ] } } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -490,7 +491,8 @@ ] } } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -683,7 +685,8 @@ ] } } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -868,7 +871,8 @@ ] } } - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00853_join_with_nulls_crash.sql.expected.formatted.sql b/tests/clickhouse-reference/00853_join_with_nulls_crash.sql.expected.formatted.sql index 89c800aab..686e2a70f 100644 --- a/tests/clickhouse-reference/00853_join_with_nulls_crash.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00853_join_with_nulls_crash.sql.expected.formatted.sql @@ -39,7 +39,7 @@ FROM FROM table_a GROUP BY other ) AS s1 -FULL JOIN ( +ALL FULL JOIN ( SELECT other, count() AS count_b @@ -67,7 +67,7 @@ FROM FROM table_a GROUP BY something ) AS s1 -FULL JOIN ( +ALL FULL JOIN ( SELECT something, count() AS count_b @@ -95,7 +95,7 @@ FROM FROM table_a GROUP BY something ) AS s1 -RIGHT JOIN ( +ALL RIGHT JOIN ( SELECT something, count() AS count_b @@ -123,7 +123,7 @@ FROM FROM table_a GROUP BY something ) AS s1 -FULL JOIN ( +ALL FULL JOIN ( SELECT something, count() AS count_b diff --git a/tests/clickhouse-reference/00857_global_joinsavel_table_alias.sql.expected.ast.json b/tests/clickhouse-reference/00857_global_joinsavel_table_alias.sql.expected.ast.json index 61d0ffc2d..ba5d62724 100644 --- a/tests/clickhouse-reference/00857_global_joinsavel_table_alias.sql.expected.ast.json +++ b/tests/clickhouse-reference/00857_global_joinsavel_table_alias.sql.expected.ast.json @@ -342,7 +342,8 @@ ] } } - } + }, + "global": true }, "orderBy": [ { @@ -419,7 +420,8 @@ ] } } - } + }, + "global": true }, "orderBy": [ { @@ -495,7 +497,8 @@ ] } } - } + }, + "global": true }, "orderBy": [ { @@ -572,7 +575,8 @@ ] } } - } + }, + "global": true }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00857_global_joinsavel_table_alias.sql.expected.formatted.sql b/tests/clickhouse-reference/00857_global_joinsavel_table_alias.sql.expected.formatted.sql index f1d90e0e0..d5c88df8d 100644 --- a/tests/clickhouse-reference/00857_global_joinsavel_table_alias.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00857_global_joinsavel_table_alias.sql.expected.formatted.sql @@ -42,28 +42,28 @@ ORDER BY t2.name ASC; SELECT t2.name FROM other_table AS t2 -RIGHT JOIN remote('127.0.0.2', currentDatabase(), 'local_table') AS t1 +GLOBAL RIGHT JOIN remote('127.0.0.2', currentDatabase(), 'local_table') AS t1 ON t1.oth_id = t2.id ORDER BY t2.name ASC; SELECT t2.name FROM remote('127.0.0.2', currentDatabase(), 'local_table') AS t1 -LEFT JOIN other_table AS t2 +GLOBAL LEFT JOIN other_table AS t2 ON t1.oth_id = t2.id ORDER BY t2.name ASC; SELECT other_table.name FROM remote('127.0.0.2', currentDatabase(), 'local_table') AS t1 -LEFT JOIN other_table +GLOBAL LEFT JOIN other_table ON t1.oth_id = other_table.id ORDER BY other_table.name ASC; SELECT other_table.name FROM remote('127.0.0.2', currentDatabase(), 'local_table') AS t1 -LEFT JOIN other_table AS t2 +GLOBAL LEFT JOIN other_table AS t2 ON t1.oth_id = other_table.id ORDER BY other_table.name ASC; diff --git a/tests/clickhouse-reference/00859_distinct_with_join.sql.expected.ast.json b/tests/clickhouse-reference/00859_distinct_with_join.sql.expected.ast.json index 57039effc..0b5870bfc 100644 --- a/tests/clickhouse-reference/00859_distinct_with_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00859_distinct_with_join.sql.expected.ast.json @@ -263,7 +263,8 @@ "columns": [ "a" ] - } + }, + "strictness": "SEMI" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00859_distinct_with_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00859_distinct_with_join.sql.expected.formatted.sql index 36de0f71e..ae002dd38 100644 --- a/tests/clickhouse-reference/00859_distinct_with_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00859_distinct_with_join.sql.expected.formatted.sql @@ -34,7 +34,7 @@ FROM numbers(2); SELECT DISTINCT a FROM fooL -LEFT JOIN fooR +SEMI LEFT JOIN fooR USING (a) ORDER BY a ASC; diff --git a/tests/clickhouse-reference/00860_unknown_identifier_bug.sql.expected.ast.json b/tests/clickhouse-reference/00860_unknown_identifier_bug.sql.expected.ast.json index 85ca5f053..792db1011 100644 --- a/tests/clickhouse-reference/00860_unknown_identifier_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/00860_unknown_identifier_bug.sql.expected.ast.json @@ -289,7 +289,8 @@ "columns": [ "_appointment_id" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", diff --git a/tests/clickhouse-reference/00860_unknown_identifier_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/00860_unknown_identifier_bug.sql.expected.formatted.sql index 0b1a7e30b..ae0f8cfc0 100644 --- a/tests/clickhouse-reference/00860_unknown_identifier_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00860_unknown_identifier_bug.sql.expected.formatted.sql @@ -32,7 +32,7 @@ SELECT A._job_requisition_id FROM appointment_events AS A -LEFT JOIN ( +ANY LEFT JOIN ( SELECT _appointment_id, MAX(_set_at) AS max_set_at diff --git a/tests/clickhouse-reference/00863_comma_join_in.sql.expected.ast.json b/tests/clickhouse-reference/00863_comma_join_in.sql.expected.ast.json index 7f1fbb137..325051d42 100644 --- a/tests/clickhouse-reference/00863_comma_join_in.sql.expected.ast.json +++ b/tests/clickhouse-reference/00863_comma_join_in.sql.expected.ast.json @@ -352,6 +352,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test2_00863" @@ -359,6 +360,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test3_00863" diff --git a/tests/clickhouse-reference/00863_comma_join_in.sql.expected.formatted.sql b/tests/clickhouse-reference/00863_comma_join_in.sql.expected.formatted.sql index e1d58d459..3dcf3afe8 100644 --- a/tests/clickhouse-reference/00863_comma_join_in.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00863_comma_join_in.sql.expected.formatted.sql @@ -51,8 +51,8 @@ SET max_memory_usage = 300000000; SELECT test2_00863.id FROM test1_00863 -CROSS JOIN test2_00863 -CROSS JOIN test3_00863 +, test2_00863 +, test3_00863 WHERE test1_00863.code IN ('1', '2', '3') AND test2_00863.test1_id = test1_00863.id AND test2_00863.test3_id = test3_00863.id diff --git a/tests/clickhouse-reference/00864_union_all_supertype.sql.expected.ast.json b/tests/clickhouse-reference/00864_union_all_supertype.sql.expected.ast.json index 9dfdc13dc..faf71b8f1 100644 --- a/tests/clickhouse-reference/00864_union_all_supertype.sql.expected.ast.json +++ b/tests/clickhouse-reference/00864_union_all_supertype.sql.expected.ast.json @@ -325,7 +325,8 @@ "c1", "c2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -470,7 +471,8 @@ "columns": [ "key" ] - } + }, + "strictness": "ALL" } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/00864_union_all_supertype.sql.expected.formatted.sql b/tests/clickhouse-reference/00864_union_all_supertype.sql.expected.formatted.sql index 7a827bd16..8152b4231 100644 --- a/tests/clickhouse-reference/00864_union_all_supertype.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00864_union_all_supertype.sql.expected.formatted.sql @@ -37,7 +37,7 @@ FROM 'v2' AS c1, '' AS c2 ) -FULL JOIN ( +ALL FULL JOIN ( SELECT 'v1' AS c1, 'w1' AS c2 @@ -57,7 +57,7 @@ FROM 'key1' AS key, 'value1' AS value ) AS s1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT 'key1' AS key, '' AS value diff --git a/tests/clickhouse-reference/00874_issue_3495.sql.expected.ast.json b/tests/clickhouse-reference/00874_issue_3495.sql.expected.ast.json index 55486f231..c7c6eb6b2 100644 --- a/tests/clickhouse-reference/00874_issue_3495.sql.expected.ast.json +++ b/tests/clickhouse-reference/00874_issue_3495.sql.expected.ast.json @@ -117,7 +117,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" } } }, diff --git a/tests/clickhouse-reference/00874_issue_3495.sql.expected.formatted.sql b/tests/clickhouse-reference/00874_issue_3495.sql.expected.formatted.sql index 0e51c3a25..387d29fe2 100644 --- a/tests/clickhouse-reference/00874_issue_3495.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00874_issue_3495.sql.expected.formatted.sql @@ -19,7 +19,7 @@ FROM ( t2.val AS val2 FROM t AS t1 - LEFT JOIN t AS t2 + ANY LEFT JOIN t AS t2 USING (a) ) ORDER BY val1 ASC; diff --git a/tests/clickhouse-reference/00875_join_right_nulls_ors.sql.expected.ast.json b/tests/clickhouse-reference/00875_join_right_nulls_ors.sql.expected.ast.json index f4d828e6f..3dfeb2d93 100644 --- a/tests/clickhouse-reference/00875_join_right_nulls_ors.sql.expected.ast.json +++ b/tests/clickhouse-reference/00875_join_right_nulls_ors.sql.expected.ast.json @@ -390,7 +390,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -870,7 +871,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00875_join_right_nulls_ors.sql.expected.formatted.sql b/tests/clickhouse-reference/00875_join_right_nulls_ors.sql.expected.formatted.sql index 7a83d8b6c..e58330d72 100644 --- a/tests/clickhouse-reference/00875_join_right_nulls_ors.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00875_join_right_nulls_ors.sql.expected.formatted.sql @@ -51,7 +51,7 @@ SELECT t2.x FROM nt AS t1 -RIGHT JOIN ntxy AS t2 +ANY RIGHT JOIN ntxy AS t2 ON t1.x = t2.x OR t1.x = t2.y ORDER BY t1.x ASC; @@ -106,7 +106,7 @@ SELECT t2.x FROM ntxy AS t1 -RIGHT JOIN t AS t2 +ANY RIGHT JOIN t AS t2 ON t1.x = t2.x OR t1.y = t2.x ORDER BY t1.x ASC; diff --git a/tests/clickhouse-reference/00914_join_bgranvea.sql.expected.ast.json b/tests/clickhouse-reference/00914_join_bgranvea.sql.expected.ast.json index eb81e9ab8..e3b0ceeff 100644 --- a/tests/clickhouse-reference/00914_join_bgranvea.sql.expected.ast.json +++ b/tests/clickhouse-reference/00914_join_bgranvea.sql.expected.ast.json @@ -215,7 +215,8 @@ ] } } - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00914_join_bgranvea.sql.expected.formatted.sql b/tests/clickhouse-reference/00914_join_bgranvea.sql.expected.formatted.sql index 9835a8192..6fe193edd 100644 --- a/tests/clickhouse-reference/00914_join_bgranvea.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00914_join_bgranvea.sql.expected.formatted.sql @@ -30,7 +30,7 @@ SELECT t2.B FROM table1 AS t1 -INNER JOIN table2 AS t2 +ALL INNER JOIN table2 AS t2 ON t1.B = t2.B ORDER BY t1.B ASC, diff --git a/tests/clickhouse-reference/00916_join_using_duplicate_columns.sql.expected.ast.json b/tests/clickhouse-reference/00916_join_using_duplicate_columns.sql.expected.ast.json index 683772d42..aa1a45903 100644 --- a/tests/clickhouse-reference/00916_join_using_duplicate_columns.sql.expected.ast.json +++ b/tests/clickhouse-reference/00916_join_using_duplicate_columns.sql.expected.ast.json @@ -74,7 +74,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ALL" } }, { @@ -126,7 +127,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ALL" } }, { @@ -180,7 +182,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ALL" } }, { @@ -234,7 +237,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ALL" } }, { @@ -303,7 +307,8 @@ ] } } - } + }, + "strictness": "ALL" } }, { @@ -372,7 +377,8 @@ ] } } - } + }, + "strictness": "ALL" } }, { @@ -447,7 +453,8 @@ ] } } - } + }, + "strictness": "ALL" } }, { @@ -522,7 +529,8 @@ ] } } - } + }, + "strictness": "ALL" } }, { @@ -591,7 +599,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -660,7 +669,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -735,7 +745,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -810,7 +821,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -879,7 +891,8 @@ ] } } - } + }, + "strictness": "ALL" } }, { @@ -948,7 +961,8 @@ ] } } - } + }, + "strictness": "ALL" } }, { @@ -1023,7 +1037,8 @@ ] } } - } + }, + "strictness": "ALL" } }, { @@ -1098,7 +1113,8 @@ ] } } - } + }, + "strictness": "ALL" } }, { @@ -1167,7 +1183,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -1236,7 +1253,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -1311,7 +1329,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -1386,7 +1405,8 @@ ] } } - } + }, + "strictness": "ANY" }, "trailingComments": [ "-- SET join_use_nulls = 1;", diff --git a/tests/clickhouse-reference/00916_join_using_duplicate_columns.sql.expected.formatted.sql b/tests/clickhouse-reference/00916_join_using_duplicate_columns.sql.expected.formatted.sql index 7ebde0cf6..b90b1373e 100644 --- a/tests/clickhouse-reference/00916_join_using_duplicate_columns.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00916_join_using_duplicate_columns.sql.expected.formatted.sql @@ -7,7 +7,7 @@ FROM ( SELECT 1 AS x ) -LEFT JOIN ( +ALL LEFT JOIN ( SELECT 1 AS x ) USING (x); @@ -17,7 +17,7 @@ FROM ( SELECT 1 AS x ) -LEFT JOIN ( +ALL LEFT JOIN ( SELECT 2 AS x ) USING (x); @@ -27,7 +27,7 @@ FROM ( SELECT 1 AS x ) AS t1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT 1 AS x ) AS t2 USING (x); @@ -37,7 +37,7 @@ FROM ( SELECT 1 AS x ) AS t1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT 2 AS x ) AS t2 USING (x); @@ -47,7 +47,7 @@ FROM ( SELECT 1 AS x ) AS t1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT 1 AS x ) AS t2 ON t1.x = t2.x; @@ -57,7 +57,7 @@ FROM ( SELECT 1 AS x ) AS t1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT 2 AS x ) AS t2 ON t1.x = t2.x; @@ -67,7 +67,7 @@ FROM ( SELECT materialize(1) AS x ) AS t1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT 2 AS x ) AS t2 ON t1.x = t2.x; @@ -77,7 +77,7 @@ FROM ( SELECT 1 AS x ) AS t1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT materialize(2) AS x ) AS t2 ON t1.x = t2.x; @@ -87,7 +87,7 @@ FROM ( SELECT 1 AS x ) AS t1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 1 AS x ) AS t2 ON t1.x = t2.x; @@ -97,7 +97,7 @@ FROM ( SELECT 1 AS x ) AS t1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 2 AS x ) AS t2 ON t1.x = t2.x; @@ -107,7 +107,7 @@ FROM ( SELECT materialize(1) AS x ) AS t1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 2 AS x ) AS t2 ON t1.x = t2.x; @@ -117,7 +117,7 @@ FROM ( SELECT 1 AS x ) AS t1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT materialize(2) AS x ) AS t2 ON t1.x = t2.x; @@ -127,7 +127,7 @@ FROM ( SELECT 1 AS x ) AS t1 -RIGHT JOIN ( +ALL RIGHT JOIN ( SELECT 1 AS x ) AS t2 ON t1.x = t2.x; @@ -137,7 +137,7 @@ FROM ( SELECT 1 AS x ) AS t1 -RIGHT JOIN ( +ALL RIGHT JOIN ( SELECT 2 AS x ) AS t2 ON t1.x = t2.x; @@ -147,7 +147,7 @@ FROM ( SELECT materialize(1) AS x ) AS t1 -RIGHT JOIN ( +ALL RIGHT JOIN ( SELECT 2 AS x ) AS t2 ON t1.x = t2.x; @@ -157,7 +157,7 @@ FROM ( SELECT 1 AS x ) AS t1 -RIGHT JOIN ( +ALL RIGHT JOIN ( SELECT materialize(2) AS x ) AS t2 ON t1.x = t2.x; @@ -167,7 +167,7 @@ FROM ( SELECT 1 AS x ) AS t1 -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT 1 AS x ) AS t2 ON t1.x = t2.x; @@ -177,7 +177,7 @@ FROM ( SELECT 1 AS x ) AS t1 -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT 2 AS x ) AS t2 ON t1.x = t2.x; @@ -187,7 +187,7 @@ FROM ( SELECT materialize(1) AS x ) AS t1 -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT 2 AS x ) AS t2 ON t1.x = t2.x; @@ -197,7 +197,7 @@ FROM ( SELECT 1 AS x ) AS t1 -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT materialize(2) AS x ) AS t2 ON t1.x = t2.x; -- SET join_use_nulls = 1; diff --git a/tests/clickhouse-reference/00927_asof_join_correct_bt.sql.expected.ast.json b/tests/clickhouse-reference/00927_asof_join_correct_bt.sql.expected.ast.json index c9a39da9f..866cba432 100644 --- a/tests/clickhouse-reference/00927_asof_join_correct_bt.sql.expected.ast.json +++ b/tests/clickhouse-reference/00927_asof_join_correct_bt.sql.expected.ast.json @@ -409,7 +409,8 @@ "k", "t" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -505,7 +506,8 @@ "k", "t" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -598,7 +600,8 @@ "k", "t" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00927_asof_join_correct_bt.sql.expected.formatted.sql b/tests/clickhouse-reference/00927_asof_join_correct_bt.sql.expected.formatted.sql index 7f6c8f96c..eb77b4d3d 100644 --- a/tests/clickhouse-reference/00927_asof_join_correct_bt.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00927_asof_join_correct_bt.sql.expected.formatted.sql @@ -56,7 +56,7 @@ SELECT B.k FROM A -LEFT JOIN B1 AS B +ASOF LEFT JOIN B1 AS B USING (k, t) ORDER BY (A.k, A.t) ASC; @@ -69,7 +69,7 @@ SELECT B.k FROM A -LEFT JOIN B2 AS B +ASOF LEFT JOIN B2 AS B USING (k, t) ORDER BY (A.k, A.t) ASC; @@ -82,7 +82,7 @@ SELECT B.k FROM A -LEFT JOIN B3 AS B +ASOF LEFT JOIN B3 AS B USING (k, t) ORDER BY (A.k, A.t) ASC; diff --git a/tests/clickhouse-reference/00927_asof_join_long.sql.expected.ast.json b/tests/clickhouse-reference/00927_asof_join_long.sql.expected.ast.json index c0dc7d567..4badcaeec 100644 --- a/tests/clickhouse-reference/00927_asof_join_long.sql.expected.ast.json +++ b/tests/clickhouse-reference/00927_asof_join_long.sql.expected.ast.json @@ -375,7 +375,8 @@ "k", "t" ] - } + }, + "strictness": "ASOF" } }, { @@ -545,7 +546,8 @@ "k", "t" ] - } + }, + "strictness": "ASOF" }, "settings": [ { diff --git a/tests/clickhouse-reference/00927_asof_join_long.sql.expected.formatted.sql b/tests/clickhouse-reference/00927_asof_join_long.sql.expected.formatted.sql index 62589c2ee..e93c14421 100644 --- a/tests/clickhouse-reference/00927_asof_join_long.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00927_asof_join_long.sql.expected.formatted.sql @@ -45,7 +45,7 @@ FROM ) AS trade_times SETTINGS join_algorithm = 'hash' ) AS trades -LEFT JOIN tvs +ASOF LEFT JOIN tvs USING (k, t); SELECT SUM(trades.price - tvs.tv) @@ -66,7 +66,7 @@ FROM ) AS trade_times SETTINGS join_algorithm = 'hash' ) AS trades -LEFT JOIN tvs +ASOF LEFT JOIN tvs USING (k, t) SETTINGS join_algorithm = 'full_sorting_merge'; diff --git a/tests/clickhouse-reference/00927_asof_join_noninclusive.sql.expected.ast.json b/tests/clickhouse-reference/00927_asof_join_noninclusive.sql.expected.ast.json index f705c8c85..6045ff38b 100644 --- a/tests/clickhouse-reference/00927_asof_join_noninclusive.sql.expected.ast.json +++ b/tests/clickhouse-reference/00927_asof_join_noninclusive.sql.expected.ast.json @@ -365,7 +365,8 @@ "k", "t" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -517,7 +518,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -631,7 +633,8 @@ "k", "t" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00927_asof_join_noninclusive.sql.expected.formatted.sql b/tests/clickhouse-reference/00927_asof_join_noninclusive.sql.expected.formatted.sql index 3a751764a..6f4d19d37 100644 --- a/tests/clickhouse-reference/00927_asof_join_noninclusive.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00927_asof_join_noninclusive.sql.expected.formatted.sql @@ -39,7 +39,7 @@ SELECT B.k FROM A -LEFT JOIN B +ASOF LEFT JOIN B USING (k, t) ORDER BY (A.k, A.t) ASC; @@ -52,7 +52,7 @@ SELECT B.k FROM A -INNER JOIN B +ASOF INNER JOIN B ON A.k == B.k AND A.t >= B.t ORDER BY (A.k, A.t) ASC; @@ -66,7 +66,7 @@ SELECT B.k FROM A -INNER JOIN B +ASOF INNER JOIN B USING (k, t) ORDER BY (A.k, A.t) ASC; diff --git a/tests/clickhouse-reference/00927_asof_joins.sql.expected.ast.json b/tests/clickhouse-reference/00927_asof_joins.sql.expected.ast.json index 58ff1dea1..ae8ff1914 100644 --- a/tests/clickhouse-reference/00927_asof_joins.sql.expected.ast.json +++ b/tests/clickhouse-reference/00927_asof_joins.sql.expected.ast.json @@ -327,7 +327,8 @@ "key", "t" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -423,7 +424,8 @@ "key", "t" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00927_asof_joins.sql.expected.formatted.sql b/tests/clickhouse-reference/00927_asof_joins.sql.expected.formatted.sql index c2e8da8cc..c5e309ad4 100644 --- a/tests/clickhouse-reference/00927_asof_joins.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00927_asof_joins.sql.expected.formatted.sql @@ -37,7 +37,7 @@ SELECT md.ask FROM tv -LEFT JOIN md +ASOF LEFT JOIN md USING (key, t) ORDER BY (tv.key, tv.t) ASC; @@ -49,7 +49,7 @@ SELECT md.ask FROM tv -LEFT JOIN md +ASOF LEFT JOIN md USING (key, t) ORDER BY (tv.key, tv.t) ASC SETTINGS join_algorithm = 'full_sorting_merge'; diff --git a/tests/clickhouse-reference/00940_order_by_read_in_order_query_plan.sql.expected.ast.json b/tests/clickhouse-reference/00940_order_by_read_in_order_query_plan.sql.expected.ast.json index 72708b32d..bf70abab4 100644 --- a/tests/clickhouse-reference/00940_order_by_read_in_order_query_plan.sql.expected.ast.json +++ b/tests/clickhouse-reference/00940_order_by_read_in_order_query_plan.sql.expected.ast.json @@ -740,7 +740,8 @@ } ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ] }, @@ -833,7 +834,8 @@ } ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ] } @@ -3213,7 +3215,8 @@ } ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ] } diff --git a/tests/clickhouse-reference/00940_order_by_read_in_order_query_plan.sql.expected.formatted.sql b/tests/clickhouse-reference/00940_order_by_read_in_order_query_plan.sql.expected.formatted.sql index e8db05485..e42554d0a 100644 --- a/tests/clickhouse-reference/00940_order_by_read_in_order_query_plan.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00940_order_by_read_in_order_query_plan.sql.expected.formatted.sql @@ -77,7 +77,7 @@ SELECT * FROM tab ORDER BY ((a + b)) * c DESC, - sin(a / b) DESC; + sin(a / b) DESC NULLS FIRST; SELECT * FROM ( @@ -86,7 +86,7 @@ FROM ( FROM tab ORDER BY ((a + b)) * c DESC, - sin(a / b) DESC + sin(a / b) DESC NULLS FIRST ) WHERE like(`explain`, '%sort description%'); @@ -292,7 +292,7 @@ FROM ( FROM tab ORDER BY ((a + b)) * c DESC, - intDiv(sin(a / b), 2) DESC + intDiv(sin(a / b), 2) DESC NULLS FIRST ) WHERE like(`explain`, '%sort description%'); diff --git a/tests/clickhouse-reference/00950_test_gorilla_codec.sql.expected.ast.json b/tests/clickhouse-reference/00950_test_gorilla_codec.sql.expected.ast.json index aae0220c4..ab3397f40 100644 --- a/tests/clickhouse-reference/00950_test_gorilla_codec.sql.expected.ast.json +++ b/tests/clickhouse-reference/00950_test_gorilla_codec.sql.expected.ast.json @@ -711,6 +711,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "codecTest", @@ -854,6 +855,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "codecTest", diff --git a/tests/clickhouse-reference/00950_test_gorilla_codec.sql.expected.formatted.sql b/tests/clickhouse-reference/00950_test_gorilla_codec.sql.expected.formatted.sql index 73ece10f0..301566145 100644 --- a/tests/clickhouse-reference/00950_test_gorilla_codec.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00950_test_gorilla_codec.sql.expected.formatted.sql @@ -69,7 +69,7 @@ SELECT c2.ref_valueF64 FROM codecTest AS c1 -CROSS JOIN codecTest AS c2 +, codecTest AS c2 WHERE dF64 != 0 AND c2.key = c1.key - 1 LIMIT 10; @@ -85,7 +85,7 @@ SELECT c2.ref_valueF32 FROM codecTest AS c1 -CROSS JOIN codecTest AS c2 +, codecTest AS c2 WHERE dF32 != 0 AND c2.key = c1.key - 1 LIMIT 10; \ No newline at end of file diff --git a/tests/clickhouse-reference/00956_join_use_nulls_with_array_column.sql.expected.ast.json b/tests/clickhouse-reference/00956_join_use_nulls_with_array_column.sql.expected.ast.json index b1e71130b..4bdb19d14 100644 --- a/tests/clickhouse-reference/00956_join_use_nulls_with_array_column.sql.expected.ast.json +++ b/tests/clickhouse-reference/00956_join_use_nulls_with_array_column.sql.expected.ast.json @@ -73,7 +73,8 @@ "columns": [ "number" ] - } + }, + "strictness": "SEMI" }, "limit": { "count": { @@ -144,7 +145,8 @@ "columns": [ "number" ] - } + }, + "strictness": "ANY" }, "limit": { "count": { diff --git a/tests/clickhouse-reference/00956_join_use_nulls_with_array_column.sql.expected.formatted.sql b/tests/clickhouse-reference/00956_join_use_nulls_with_array_column.sql.expected.formatted.sql index 89befcd26..4087aee03 100644 --- a/tests/clickhouse-reference/00956_join_use_nulls_with_array_column.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00956_join_use_nulls_with_array_column.sql.expected.formatted.sql @@ -3,7 +3,7 @@ SET join_use_nulls = 1; SELECT number FROM `system`.numbers -LEFT JOIN ( +SEMI LEFT JOIN ( SELECT number, ['test'] @@ -16,7 +16,7 @@ LIMIT 1; SELECT number FROM `system`.numbers -LEFT JOIN ( +ANY LEFT JOIN ( SELECT number, ['test'] diff --git a/tests/clickhouse-reference/00974_distributed_join_on.sql.expected.ast.json b/tests/clickhouse-reference/00974_distributed_join_on.sql.expected.ast.json index 910e9d477..43bc99f59 100644 --- a/tests/clickhouse-reference/00974_distributed_join_on.sql.expected.ast.json +++ b/tests/clickhouse-reference/00974_distributed_join_on.sql.expected.ast.json @@ -229,7 +229,8 @@ ] } } - } + }, + "global": true }, "limit": { "count": { @@ -281,7 +282,8 @@ ] } } - } + }, + "global": true }, "limit": { "count": { @@ -333,7 +335,8 @@ ] } } - } + }, + "global": true }, "limit": { "count": { @@ -480,7 +483,8 @@ ] } } - } + }, + "global": true }, "limit": { "count": { diff --git a/tests/clickhouse-reference/00974_distributed_join_on.sql.expected.formatted.sql b/tests/clickhouse-reference/00974_distributed_join_on.sql.expected.formatted.sql index 20825fcea..31d933a74 100644 --- a/tests/clickhouse-reference/00974_distributed_join_on.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00974_distributed_join_on.sql.expected.formatted.sql @@ -36,21 +36,21 @@ SET prefer_localhost_replica = 1; SELECT 1 FROM distributed_table1 AS t1 -INNER JOIN distributed_table2 AS t2 +GLOBAL INNER JOIN distributed_table2 AS t2 ON t1.a = t2.c LIMIT 1; SELECT 1 FROM distributed_table1 AS t1 -INNER JOIN distributed_table2 AS t2 +GLOBAL INNER JOIN distributed_table2 AS t2 ON t2.c = t1.a LIMIT 1; SELECT 1 FROM distributed_table1 AS t1 -INNER JOIN distributed_table1 AS t2 +GLOBAL INNER JOIN distributed_table1 AS t2 ON t1.a = t2.a LIMIT 1; @@ -70,7 +70,7 @@ SELECT t2.a AS t2_a FROM distributed_table1 AS t1 -INNER JOIN distributed_table1 AS t2 +GLOBAL INNER JOIN distributed_table1 AS t2 ON t1_a = t2_a LIMIT 1; diff --git a/tests/clickhouse-reference/00974_full_outer_join.sql.expected.ast.json b/tests/clickhouse-reference/00974_full_outer_join.sql.expected.ast.json index 7a1fbc670..90017eb63 100644 --- a/tests/clickhouse-reference/00974_full_outer_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/00974_full_outer_join.sql.expected.ast.json @@ -207,7 +207,8 @@ ] } } - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/00974_full_outer_join.sql.expected.formatted.sql b/tests/clickhouse-reference/00974_full_outer_join.sql.expected.formatted.sql index b61b78278..372fdcaca 100644 --- a/tests/clickhouse-reference/00974_full_outer_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00974_full_outer_join.sql.expected.formatted.sql @@ -10,7 +10,7 @@ FROM FROM numbers(2) GROUP BY dt ) AS q0 -FULL JOIN ( +ALL FULL JOIN ( SELECT toDate(addDays(toDate('2015-12-01'), number)) AS dt, sum(number) AS cnt2 diff --git a/tests/clickhouse-reference/00995_order_by_with_fill.sql.expected.ast.json b/tests/clickhouse-reference/00995_order_by_with_fill.sql.expected.ast.json index 913bc2cba..a375ab4e7 100644 --- a/tests/clickhouse-reference/00995_order_by_with_fill.sql.expected.ast.json +++ b/tests/clickhouse-reference/00995_order_by_with_fill.sql.expected.ast.json @@ -111,7 +111,8 @@ "date" ] }, - "direction": "ASC" + "direction": "ASC", + "withFill": true }, { "kind": "orderByItem", @@ -149,6 +150,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "functionCall", "name": "toDate", @@ -180,7 +182,8 @@ "val" ] }, - "direction": "ASC" + "direction": "ASC", + "withFill": true } ] }, @@ -204,7 +207,8 @@ "date" ] }, - "direction": "DESC" + "direction": "DESC", + "withFill": true }, { "kind": "orderByItem", @@ -215,6 +219,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -249,6 +254,7 @@ ] }, "direction": "DESC", + "withFill": true, "fillTo": { "kind": "functionCall", "name": "toDate", @@ -275,6 +281,7 @@ ] }, "direction": "DESC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -317,6 +324,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillTo": { "kind": "functionCall", "name": "toDate", @@ -343,6 +351,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "Int64", @@ -457,7 +466,8 @@ "a" ] }, - "direction": "ASC" + "direction": "ASC", + "withFill": true }, { "kind": "orderByItem", @@ -467,7 +477,8 @@ "b" ] }, - "direction": "ASC" + "direction": "ASC", + "withFill": true } ] }, @@ -491,7 +502,8 @@ "a" ] }, - "direction": "ASC" + "direction": "ASC", + "withFill": true }, { "kind": "orderByItem", @@ -502,6 +514,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillTo": { "kind": "literal", "type": "UInt64", @@ -536,6 +549,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "literal", "type": "Int64", @@ -568,6 +582,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -605,6 +620,7 @@ ] }, "direction": "DESC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -642,6 +658,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "Int64", diff --git a/tests/clickhouse-reference/00995_order_by_with_fill.sql.expected.formatted.sql b/tests/clickhouse-reference/00995_order_by_with_fill.sql.expected.formatted.sql index 7001e6d97..4d2866365 100644 --- a/tests/clickhouse-reference/00995_order_by_with_fill.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/00995_order_by_with_fill.sql.expected.formatted.sql @@ -22,19 +22,19 @@ ORDER BY SELECT * FROM `fill` ORDER BY - date ASC, + date ASC WITH FILL, val ASC; SELECT * FROM `fill` ORDER BY date ASC WITH FILL FROM toDate('2019-05-01') TO toDate('2019-05-31'), - val ASC; + val ASC WITH FILL; SELECT * FROM `fill` ORDER BY - date DESC, + date DESC WITH FILL, val ASC WITH FILL FROM 1 TO 6; -- Some weird cases @@ -71,13 +71,13 @@ ORDER BY SELECT * FROM `fill` ORDER BY - a ASC, - b ASC; + a ASC WITH FILL, + b ASC WITH FILL; SELECT * FROM `fill` ORDER BY - a ASC, + a ASC WITH FILL, b ASC WITH FILL TO 6 STEP 2; SELECT * diff --git a/tests/clickhouse-reference/01000_subquery_requires_alias.sql.expected.ast.json b/tests/clickhouse-reference/01000_subquery_requires_alias.sql.expected.ast.json index 3abb3cc34..dc17d8fb2 100644 --- a/tests/clickhouse-reference/01000_subquery_requires_alias.sql.expected.ast.json +++ b/tests/clickhouse-reference/01000_subquery_requires_alias.sql.expected.ast.json @@ -94,7 +94,8 @@ "columns": [ "B" ] - } + }, + "strictness": "ALL" } }, { @@ -165,7 +166,8 @@ "columns": [ "B" ] - } + }, + "strictness": "ALL" }, "trailingComments": [ "-- { serverError ALIAS_REQUIRED }" @@ -239,7 +241,8 @@ "columns": [ "B" ] - } + }, + "strictness": "ALL" }, "trailingComments": [ "-- { serverError ALIAS_REQUIRED }" diff --git a/tests/clickhouse-reference/01000_subquery_requires_alias.sql.expected.formatted.sql b/tests/clickhouse-reference/01000_subquery_requires_alias.sql.expected.formatted.sql index 2f23c045d..5369ea64a 100644 --- a/tests/clickhouse-reference/01000_subquery_requires_alias.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01000_subquery_requires_alias.sql.expected.formatted.sql @@ -9,7 +9,7 @@ FROM 1 AS A, 2 AS B ) AS X -LEFT JOIN ( +ALL LEFT JOIN ( SELECT 3 AS A, 2 AS B @@ -23,7 +23,7 @@ FROM 1 AS A, 2 AS B ) AS X -LEFT JOIN ( +ALL LEFT JOIN ( SELECT 3 AS A, 2 AS B @@ -37,7 +37,7 @@ FROM 1 AS A, 2 AS B ) -LEFT JOIN ( +ALL LEFT JOIN ( SELECT 3 AS A, 2 AS B diff --git a/tests/clickhouse-reference/01008_materialized_view_henyihanwobushi.sql.expected.ast.json b/tests/clickhouse-reference/01008_materialized_view_henyihanwobushi.sql.expected.ast.json index 58aebe841..e5bdf11e0 100644 --- a/tests/clickhouse-reference/01008_materialized_view_henyihanwobushi.sql.expected.ast.json +++ b/tests/clickhouse-reference/01008_materialized_view_henyihanwobushi.sql.expected.ast.json @@ -331,7 +331,8 @@ "columns": [ "foo_id" ] - } + }, + "strictness": "ANY" } } }, diff --git a/tests/clickhouse-reference/01008_materialized_view_henyihanwobushi.sql.expected.formatted.sql b/tests/clickhouse-reference/01008_materialized_view_henyihanwobushi.sql.expected.formatted.sql index 6fff5fd84..3e97d2c3c 100644 --- a/tests/clickhouse-reference/01008_materialized_view_henyihanwobushi.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01008_materialized_view_henyihanwobushi.sql.expected.formatted.sql @@ -43,7 +43,7 @@ FROM foo_id FROM bar ) AS js1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT id AS foo_id, n AS foo_n diff --git a/tests/clickhouse-reference/01009_insert_select_data_loss.sql.expected.ast.json b/tests/clickhouse-reference/01009_insert_select_data_loss.sql.expected.ast.json index 1ea512e82..de93f16d4 100644 --- a/tests/clickhouse-reference/01009_insert_select_data_loss.sql.expected.ast.json +++ b/tests/clickhouse-reference/01009_insert_select_data_loss.sql.expected.ast.json @@ -132,7 +132,8 @@ "columns": [ "n" ] - } + }, + "strictness": "SEMI" }, "settings": [ { diff --git a/tests/clickhouse-reference/01009_insert_select_data_loss.sql.expected.formatted.sql b/tests/clickhouse-reference/01009_insert_select_data_loss.sql.expected.formatted.sql index 59b75a5ca..1983cb34f 100644 --- a/tests/clickhouse-reference/01009_insert_select_data_loss.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01009_insert_select_data_loss.sql.expected.formatted.sql @@ -13,7 +13,7 @@ FROM SELECT number AS n FROM numbers(20) ) AS nums -LEFT JOIN ( +SEMI LEFT JOIN ( SELECT number * 10 AS n FROM numbers(2) ) AS js2 diff --git a/tests/clickhouse-reference/01009_insert_select_nicelulu.sql.expected.ast.json b/tests/clickhouse-reference/01009_insert_select_nicelulu.sql.expected.ast.json index 5ccd50d7a..0f95515dd 100644 --- a/tests/clickhouse-reference/01009_insert_select_nicelulu.sql.expected.ast.json +++ b/tests/clickhouse-reference/01009_insert_select_nicelulu.sql.expected.ast.json @@ -811,7 +811,9 @@ ] } } - } + }, + "strictness": "SEMI", + "global": true } } }, diff --git a/tests/clickhouse-reference/01009_insert_select_nicelulu.sql.expected.formatted.sql b/tests/clickhouse-reference/01009_insert_select_nicelulu.sql.expected.formatted.sql index e8f2d774d..c1e76973e 100644 --- a/tests/clickhouse-reference/01009_insert_select_nicelulu.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01009_insert_select_nicelulu.sql.expected.formatted.sql @@ -104,7 +104,7 @@ FROM FROM test_insert_t1 WHERE dt = '2019-09-01' ) AS t1 -LEFT JOIN ( +GLOBAL SEMI LEFT JOIN ( SELECT uid FROM test_insert_t2 WHERE dt = '2019-09-01' diff --git a/tests/clickhouse-reference/01010_partial_merge_join.sql.expected.ast.json b/tests/clickhouse-reference/01010_partial_merge_join.sql.expected.ast.json index 908a57ab9..493a9974e 100644 --- a/tests/clickhouse-reference/01010_partial_merge_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/01010_partial_merge_join.sql.expected.ast.json @@ -231,7 +231,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -307,7 +308,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -398,7 +400,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -504,7 +507,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -595,7 +599,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" } }, { @@ -647,7 +652,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" } }, { @@ -714,7 +720,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -796,7 +803,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -995,7 +1003,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1044,7 +1053,8 @@ "x", "y" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1541,7 +1551,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1590,7 +1601,8 @@ "x", "y" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01010_partial_merge_join.sql.expected.formatted.sql b/tests/clickhouse-reference/01010_partial_merge_join.sql.expected.formatted.sql index 5ccd885c0..14a0c3899 100644 --- a/tests/clickhouse-reference/01010_partial_merge_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01010_partial_merge_join.sql.expected.formatted.sql @@ -37,7 +37,7 @@ SET any_join_distinct_right_table_keys = 1; SELECT * FROM t1 -LEFT JOIN t0 +ANY LEFT JOIN t0 USING (x) ORDER BY x ASC; @@ -51,7 +51,7 @@ ORDER BY x ASC; SELECT * FROM t1 -INNER JOIN t0 +ANY INNER JOIN t0 USING (x) ORDER BY x ASC; @@ -65,7 +65,7 @@ ORDER BY x ASC; SELECT * FROM t1 -LEFT JOIN t0 +ANY LEFT JOIN t0 ON t1.x = t0.x ORDER BY x ASC; @@ -79,7 +79,7 @@ ORDER BY x ASC; SELECT * FROM t1 -INNER JOIN t0 +ANY INNER JOIN t0 ON t1.x = t0.x ORDER BY x ASC; @@ -93,7 +93,7 @@ ORDER BY x ASC; SELECT * FROM t0 -LEFT JOIN t1 +ANY LEFT JOIN t1 USING (x); SELECT * @@ -105,7 +105,7 @@ LEFT JOIN t1 SELECT * FROM t0 -INNER JOIN t1 +ANY INNER JOIN t1 USING (x); SELECT * @@ -117,7 +117,7 @@ INNER JOIN t1 SELECT * FROM t0 -LEFT JOIN t1 +ANY LEFT JOIN t1 ON t1.x = t0.x; SELECT * @@ -129,7 +129,7 @@ LEFT JOIN t1 SELECT * FROM t0 -INNER JOIN t1 +ANY INNER JOIN t1 ON t1.x = t0.x; SELECT * @@ -155,7 +155,7 @@ SELECT t2.x FROM t1 -LEFT JOIN t2 +ANY LEFT JOIN t2 USING (x) ORDER BY x ASC; @@ -164,7 +164,7 @@ SELECT t2.x FROM t1 -LEFT JOIN t2 +ANY LEFT JOIN t2 USING (x, y) ORDER BY x ASC; @@ -227,7 +227,7 @@ SELECT t2.x FROM t1 -INNER JOIN t2 +ANY INNER JOIN t2 USING (x) ORDER BY x ASC; @@ -236,7 +236,7 @@ SELECT t2.x FROM t1 -INNER JOIN t2 +ANY INNER JOIN t2 USING (x, y) ORDER BY x ASC; diff --git a/tests/clickhouse-reference/01010_partial_merge_join_negative.sql.expected.ast.json b/tests/clickhouse-reference/01010_partial_merge_join_negative.sql.expected.ast.json index 893f20097..bbb019e59 100644 --- a/tests/clickhouse-reference/01010_partial_merge_join_negative.sql.expected.ast.json +++ b/tests/clickhouse-reference/01010_partial_merge_join_negative.sql.expected.ast.json @@ -424,7 +424,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -465,7 +466,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -506,7 +508,8 @@ ] } } - } + }, + "strictness": "ANY" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" @@ -550,7 +553,8 @@ ] } } - } + }, + "strictness": "ANY" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" @@ -579,7 +583,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" } }, { @@ -605,7 +610,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" } }, { @@ -631,7 +637,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" @@ -660,7 +667,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" @@ -704,7 +712,8 @@ ] } } - } + }, + "strictness": "SEMI" } }, { @@ -745,7 +754,8 @@ ] } } - } + }, + "strictness": "SEMI" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" @@ -774,7 +784,8 @@ "columns": [ "x" ] - } + }, + "strictness": "SEMI" } }, { @@ -800,7 +811,8 @@ "columns": [ "x" ] - } + }, + "strictness": "SEMI" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" @@ -844,7 +856,8 @@ ] } } - } + }, + "strictness": "ANTI" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" @@ -888,7 +901,8 @@ ] } } - } + }, + "strictness": "ANTI" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" @@ -917,7 +931,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANTI" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" @@ -946,7 +961,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANTI" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" @@ -1014,7 +1030,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" @@ -1044,7 +1061,8 @@ "x", "y" ] - } + }, + "strictness": "ASOF" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" diff --git a/tests/clickhouse-reference/01010_partial_merge_join_negative.sql.expected.formatted.sql b/tests/clickhouse-reference/01010_partial_merge_join_negative.sql.expected.formatted.sql index bba1c605e..c514a87ea 100644 --- a/tests/clickhouse-reference/01010_partial_merge_join_negative.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01010_partial_merge_join_negative.sql.expected.formatted.sql @@ -71,110 +71,110 @@ FULL JOIN t1 SELECT * FROM t0 -LEFT JOIN t1 +ANY LEFT JOIN t1 ON t1.x = t0.x; SELECT * FROM t0 -INNER JOIN t1 +ANY INNER JOIN t1 ON t1.x = t0.x; SELECT * FROM t0 -RIGHT JOIN t1 +ANY RIGHT JOIN t1 ON t1.x = t0.x; -- { serverError NOT_IMPLEMENTED } SELECT * FROM t0 -FULL JOIN t1 +ANY FULL JOIN t1 ON t1.x = t0.x; -- { serverError NOT_IMPLEMENTED } SELECT * FROM t0 -LEFT JOIN t1 +ANY LEFT JOIN t1 USING (x); SELECT * FROM t0 -INNER JOIN t1 +ANY INNER JOIN t1 USING (x); SELECT * FROM t0 -RIGHT JOIN t1 +ANY RIGHT JOIN t1 USING (x); -- { serverError NOT_IMPLEMENTED } SELECT * FROM t0 -FULL JOIN t1 +ANY FULL JOIN t1 USING (x); -- { serverError NOT_IMPLEMENTED } SELECT * FROM t0 -LEFT JOIN t1 +SEMI LEFT JOIN t1 ON t1.x = t0.x; SELECT * FROM t0 -RIGHT JOIN t1 +SEMI RIGHT JOIN t1 ON t1.x = t0.x; -- { serverError NOT_IMPLEMENTED } SELECT * FROM t0 -LEFT JOIN t1 +SEMI LEFT JOIN t1 USING (x); SELECT * FROM t0 -RIGHT JOIN t1 +SEMI RIGHT JOIN t1 USING (x); -- { serverError NOT_IMPLEMENTED } SELECT * FROM t0 -LEFT JOIN t1 +ANTI LEFT JOIN t1 ON t1.x = t0.x; -- { serverError NOT_IMPLEMENTED } SELECT * FROM t0 -RIGHT JOIN t1 +ANTI RIGHT JOIN t1 ON t1.x = t0.x; -- { serverError NOT_IMPLEMENTED } SELECT * FROM t0 -LEFT JOIN t1 +ANTI LEFT JOIN t1 USING (x); -- { serverError NOT_IMPLEMENTED } SELECT * FROM t0 -RIGHT JOIN t1 +ANTI RIGHT JOIN t1 USING (x); -- { serverError NOT_IMPLEMENTED } SELECT * FROM t0 -LEFT JOIN t1 +ASOF LEFT JOIN t1 ON t1.x = t0.x AND t0.y > t1.y; -- { serverError NOT_IMPLEMENTED } SELECT * FROM t0 -LEFT JOIN t1 +ASOF LEFT JOIN t1 USING (x, y); -- { serverError NOT_IMPLEMENTED } DROP TABLE t0; diff --git a/tests/clickhouse-reference/01010_pm_join_all_join_bug.sql.expected.ast.json b/tests/clickhouse-reference/01010_pm_join_all_join_bug.sql.expected.ast.json index ed7a0d59c..76b904bc2 100644 --- a/tests/clickhouse-reference/01010_pm_join_all_join_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/01010_pm_join_all_join_bug.sql.expected.ast.json @@ -274,7 +274,8 @@ "columns": [ "s" ] - } + }, + "strictness": "ALL" }, "trailingComments": [ "-- { serverError NOT_FOUND_COLUMN_IN_BLOCK, UNKNOWN_IDENTIFIER }" diff --git a/tests/clickhouse-reference/01010_pm_join_all_join_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/01010_pm_join_all_join_bug.sql.expected.formatted.sql index e8ef3711b..98b5b8a2f 100644 --- a/tests/clickhouse-reference/01010_pm_join_all_join_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01010_pm_join_all_join_bug.sql.expected.formatted.sql @@ -39,7 +39,7 @@ FROM [1], count(1) ) AS t1 -RIGHT JOIN ( +ALL RIGHT JOIN ( SELECT number AS s FROM numbers(2) ) AS t2 diff --git a/tests/clickhouse-reference/01010_pmj_on_disk.sql.expected.ast.json b/tests/clickhouse-reference/01010_pmj_on_disk.sql.expected.ast.json index 3cc2a0852..0257a89cf 100644 --- a/tests/clickhouse-reference/01010_pmj_on_disk.sql.expected.ast.json +++ b/tests/clickhouse-reference/01010_pmj_on_disk.sql.expected.ast.json @@ -137,7 +137,8 @@ "columns": [ "n" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01010_pmj_on_disk.sql.expected.formatted.sql b/tests/clickhouse-reference/01010_pmj_on_disk.sql.expected.formatted.sql index a5da2ab43..279f11a87 100644 --- a/tests/clickhouse-reference/01010_pmj_on_disk.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01010_pmj_on_disk.sql.expected.formatted.sql @@ -10,7 +10,7 @@ FROM SELECT number AS n FROM numbers(4) ) AS nums -LEFT JOIN ( +ANY LEFT JOIN ( SELECT number * 2 AS n, number + 10 AS j diff --git a/tests/clickhouse-reference/01010_pmj_one_row_blocks.sql.expected.ast.json b/tests/clickhouse-reference/01010_pmj_one_row_blocks.sql.expected.ast.json index f14c89718..ff8600e16 100644 --- a/tests/clickhouse-reference/01010_pmj_one_row_blocks.sql.expected.ast.json +++ b/tests/clickhouse-reference/01010_pmj_one_row_blocks.sql.expected.ast.json @@ -363,7 +363,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -412,7 +413,8 @@ "x", "y" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -909,7 +911,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -958,7 +961,8 @@ "x", "y" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01010_pmj_one_row_blocks.sql.expected.formatted.sql b/tests/clickhouse-reference/01010_pmj_one_row_blocks.sql.expected.formatted.sql index 8303c4a4c..c94a4c870 100644 --- a/tests/clickhouse-reference/01010_pmj_one_row_blocks.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01010_pmj_one_row_blocks.sql.expected.formatted.sql @@ -51,7 +51,7 @@ SELECT t2.x FROM t1 -LEFT JOIN t2 +ANY LEFT JOIN t2 USING (x) ORDER BY x ASC; @@ -60,7 +60,7 @@ SELECT t2.x FROM t1 -LEFT JOIN t2 +ANY LEFT JOIN t2 USING (x, y) ORDER BY x ASC; @@ -123,7 +123,7 @@ SELECT t2.x FROM t1 -INNER JOIN t2 +ANY INNER JOIN t2 USING (x) ORDER BY x ASC; @@ -132,7 +132,7 @@ SELECT t2.x FROM t1 -INNER JOIN t2 +ANY INNER JOIN t2 USING (x, y) ORDER BY x ASC; diff --git a/tests/clickhouse-reference/01010_pmj_right_table_memory_limits.sql.expected.ast.json b/tests/clickhouse-reference/01010_pmj_right_table_memory_limits.sql.expected.ast.json index 6cbf7b258..37b3b60da 100644 --- a/tests/clickhouse-reference/01010_pmj_right_table_memory_limits.sql.expected.ast.json +++ b/tests/clickhouse-reference/01010_pmj_right_table_memory_limits.sql.expected.ast.json @@ -166,7 +166,8 @@ "columns": [ "n" ] - } + }, + "strictness": "ANY" }, "trailingComments": [ "-- { serverError MEMORY_LIMIT_EXCEEDED }" @@ -310,7 +311,8 @@ "columns": [ "n" ] - } + }, + "strictness": "ANY" }, "settings": [ { @@ -438,7 +440,8 @@ "columns": [ "n" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01010_pmj_right_table_memory_limits.sql.expected.formatted.sql b/tests/clickhouse-reference/01010_pmj_right_table_memory_limits.sql.expected.formatted.sql index e80abe904..b897703e3 100644 --- a/tests/clickhouse-reference/01010_pmj_right_table_memory_limits.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01010_pmj_right_table_memory_limits.sql.expected.formatted.sql @@ -15,7 +15,7 @@ FROM SELECT number * 200000 AS n FROM numbers(5) ) AS nums -LEFT JOIN ( +ANY LEFT JOIN ( SELECT number * 2 AS n, number AS j @@ -35,7 +35,7 @@ FROM SELECT number * 200000 AS n FROM numbers(5) ) AS nums -LEFT JOIN ( +ANY LEFT JOIN ( SELECT number * 2 AS n, number AS j @@ -52,7 +52,7 @@ FROM SELECT number * 200000 AS n FROM numbers(5) ) AS nums -LEFT JOIN ( +ANY LEFT JOIN ( SELECT number * 2 AS n, number AS j diff --git a/tests/clickhouse-reference/01010_pmj_skip_blocks.sql.expected.ast.json b/tests/clickhouse-reference/01010_pmj_skip_blocks.sql.expected.ast.json index ceee89d65..06c262ec9 100644 --- a/tests/clickhouse-reference/01010_pmj_skip_blocks.sql.expected.ast.json +++ b/tests/clickhouse-reference/01010_pmj_skip_blocks.sql.expected.ast.json @@ -363,7 +363,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -412,7 +413,8 @@ "x", "y" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -909,7 +911,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -958,7 +961,8 @@ "x", "y" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01010_pmj_skip_blocks.sql.expected.formatted.sql b/tests/clickhouse-reference/01010_pmj_skip_blocks.sql.expected.formatted.sql index 38bd5196a..05a3cd7e2 100644 --- a/tests/clickhouse-reference/01010_pmj_skip_blocks.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01010_pmj_skip_blocks.sql.expected.formatted.sql @@ -51,7 +51,7 @@ SELECT t2.x FROM t1 -LEFT JOIN t2 +ANY LEFT JOIN t2 USING (x) ORDER BY x ASC; @@ -60,7 +60,7 @@ SELECT t2.x FROM t1 -LEFT JOIN t2 +ANY LEFT JOIN t2 USING (x, y) ORDER BY x ASC; @@ -123,7 +123,7 @@ SELECT t2.x FROM t1 -INNER JOIN t2 +ANY INNER JOIN t2 USING (x) ORDER BY x ASC; @@ -132,7 +132,7 @@ SELECT t2.x FROM t1 -INNER JOIN t2 +ANY INNER JOIN t2 USING (x, y) ORDER BY x ASC; diff --git a/tests/clickhouse-reference/01031_pmj_new_any_semi_join.sql.expected.ast.json b/tests/clickhouse-reference/01031_pmj_new_any_semi_join.sql.expected.ast.json index c0bcfe41f..62c6950f5 100644 --- a/tests/clickhouse-reference/01031_pmj_new_any_semi_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/01031_pmj_new_any_semi_join.sql.expected.ast.json @@ -206,7 +206,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -265,7 +266,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -324,7 +326,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -383,7 +386,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -442,7 +446,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -501,7 +506,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -560,7 +566,8 @@ "columns": [ "x" ] - } + }, + "strictness": "SEMI" }, "orderBy": [ { @@ -619,7 +626,8 @@ "columns": [ "x" ] - } + }, + "strictness": "SEMI" }, "orderBy": [ { @@ -678,7 +686,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANTI" }, "orderBy": [ { @@ -737,7 +746,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANTI" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01031_pmj_new_any_semi_join.sql.expected.formatted.sql b/tests/clickhouse-reference/01031_pmj_new_any_semi_join.sql.expected.formatted.sql index 2614df73c..7a89e7da1 100644 --- a/tests/clickhouse-reference/01031_pmj_new_any_semi_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01031_pmj_new_any_semi_join.sql.expected.formatted.sql @@ -33,7 +33,7 @@ SELECT t2.* FROM t1 -LEFT JOIN t2 +ANY LEFT JOIN t2 USING (x) ORDER BY t1.x ASC, @@ -44,7 +44,7 @@ SELECT t2.* FROM t2 -LEFT JOIN t1 +ANY LEFT JOIN t1 USING (x) ORDER BY t1.x ASC, @@ -55,7 +55,7 @@ SELECT t2.* FROM t1 -INNER JOIN t2 +ANY INNER JOIN t2 USING (x) ORDER BY t1.x ASC, @@ -66,7 +66,7 @@ SELECT t2.* FROM t2 -INNER JOIN t1 +ANY INNER JOIN t1 USING (x) ORDER BY t1.x ASC, @@ -77,7 +77,7 @@ SELECT t2.* FROM t1 -RIGHT JOIN t2 +ANY RIGHT JOIN t2 USING (x) ORDER BY t1.x ASC, @@ -88,7 +88,7 @@ SELECT t2.* FROM t2 -RIGHT JOIN t1 +ANY RIGHT JOIN t1 USING (x) ORDER BY t1.x ASC, @@ -99,7 +99,7 @@ SELECT t2.* FROM t1 -LEFT JOIN t2 +SEMI LEFT JOIN t2 USING (x) ORDER BY t1.x ASC, @@ -110,7 +110,7 @@ SELECT t2.* FROM t1 -RIGHT JOIN t2 +SEMI RIGHT JOIN t2 USING (x) ORDER BY t1.x ASC, @@ -121,7 +121,7 @@ SELECT t2.* FROM t1 -LEFT JOIN t2 +ANTI LEFT JOIN t2 USING (x) ORDER BY t1.x ASC, @@ -132,7 +132,7 @@ SELECT t2.* FROM t1 -RIGHT JOIN t2 +ANTI RIGHT JOIN t2 USING (x) ORDER BY t1.x ASC, diff --git a/tests/clickhouse-reference/01031_semi_anti_join.sql.expected.ast.json b/tests/clickhouse-reference/01031_semi_anti_join.sql.expected.ast.json index e1d039ae2..82db9451e 100644 --- a/tests/clickhouse-reference/01031_semi_anti_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/01031_semi_anti_join.sql.expected.ast.json @@ -180,7 +180,8 @@ "columns": [ "x" ] - } + }, + "strictness": "SEMI" }, "orderBy": [ { @@ -261,7 +262,8 @@ "columns": [ "x" ] - } + }, + "strictness": "SEMI" }, "orderBy": [ { @@ -342,7 +344,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANTI" }, "orderBy": [ { @@ -423,7 +426,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANTI" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01031_semi_anti_join.sql.expected.formatted.sql b/tests/clickhouse-reference/01031_semi_anti_join.sql.expected.formatted.sql index e925018a7..28deaca60 100644 --- a/tests/clickhouse-reference/01031_semi_anti_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01031_semi_anti_join.sql.expected.formatted.sql @@ -29,7 +29,7 @@ SELECT t2.* FROM t1 -LEFT JOIN t2 +SEMI LEFT JOIN t2 USING (x) ORDER BY t1.x ASC, @@ -42,7 +42,7 @@ SELECT t2.* FROM t1 -RIGHT JOIN t2 +SEMI RIGHT JOIN t2 USING (x) ORDER BY t1.x ASC, @@ -55,7 +55,7 @@ SELECT t2.* FROM t1 -LEFT JOIN t2 +ANTI LEFT JOIN t2 USING (x) ORDER BY t1.x ASC, @@ -68,7 +68,7 @@ SELECT t2.* FROM t1 -RIGHT JOIN t2 +ANTI RIGHT JOIN t2 USING (x) ORDER BY t1.x ASC, diff --git a/tests/clickhouse-reference/01034_with_fill_and_push_down_predicate.sql.expected.ast.json b/tests/clickhouse-reference/01034_with_fill_and_push_down_predicate.sql.expected.ast.json index f20d5e312..e893a7949 100644 --- a/tests/clickhouse-reference/01034_with_fill_and_push_down_predicate.sql.expected.ast.json +++ b/tests/clickhouse-reference/01034_with_fill_and_push_down_predicate.sql.expected.ast.json @@ -76,6 +76,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "literal", "type": "UInt64", diff --git a/tests/clickhouse-reference/01050_engine_join_crash.sql.expected.ast.json b/tests/clickhouse-reference/01050_engine_join_crash.sql.expected.ast.json index ff8eb3b8f..b93de223b 100644 --- a/tests/clickhouse-reference/01050_engine_join_crash.sql.expected.ast.json +++ b/tests/clickhouse-reference/01050_engine_join_crash.sql.expected.ast.json @@ -259,7 +259,8 @@ "columns": [ "number" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -502,7 +503,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -674,7 +676,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -714,7 +717,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01050_engine_join_crash.sql.expected.formatted.sql b/tests/clickhouse-reference/01050_engine_join_crash.sql.expected.formatted.sql index 8c5ad385b..483f2c41e 100644 --- a/tests/clickhouse-reference/01050_engine_join_crash.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01050_engine_join_crash.sql.expected.formatted.sql @@ -42,7 +42,7 @@ FROM SELECT * FROM numbers(10) ) AS js1 -INNER JOIN testJoinTable +ANY INNER JOIN testJoinTable USING (number) ORDER BY number ASC; @@ -83,7 +83,7 @@ SELECT m.name FROM transaction AS tx -LEFT JOIN master AS m +ANY LEFT JOIN master AS m ON m.id = tx.master_id ORDER BY tx.id ASC; @@ -115,14 +115,14 @@ SETTINGS any_join_distinct_right_table_keys = 1; SELECT * FROM tbl AS t -LEFT JOIN some_join +ANY LEFT JOIN some_join USING (id) ORDER BY id ASC; SELECT * FROM tbl AS t -LEFT JOIN some_join AS d +ANY LEFT JOIN some_join AS d USING (id) ORDER BY id ASC; diff --git a/tests/clickhouse-reference/01050_engine_join_view_crash.sql.expected.ast.json b/tests/clickhouse-reference/01050_engine_join_view_crash.sql.expected.ast.json index 0ea4d7812..aa209f10d 100644 --- a/tests/clickhouse-reference/01050_engine_join_view_crash.sql.expected.ast.json +++ b/tests/clickhouse-reference/01050_engine_join_view_crash.sql.expected.ast.json @@ -223,7 +223,8 @@ "columns": [ "id1" ] - } + }, + "strictness": "ANY" } }, "alias": "js1" @@ -239,7 +240,8 @@ "columns": [ "id2" ] - } + }, + "strictness": "ANY" } }, { @@ -281,7 +283,8 @@ "columns": [ "id1" ] - } + }, + "strictness": "ANY" } }, "alias": "js1" @@ -297,7 +300,8 @@ "columns": [ "id2" ] - } + }, + "strictness": "ANY" }, "parenthesized": true } diff --git a/tests/clickhouse-reference/01050_engine_join_view_crash.sql.expected.formatted.sql b/tests/clickhouse-reference/01050_engine_join_view_crash.sql.expected.formatted.sql index 081eaa2a6..4781084f1 100644 --- a/tests/clickhouse-reference/01050_engine_join_view_crash.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01050_engine_join_view_crash.sql.expected.formatted.sql @@ -40,10 +40,10 @@ FROM SELECT * FROM a - LEFT JOIN id1 + ANY LEFT JOIN id1 USING (id1) ) AS js1 -LEFT JOIN id2 +ANY LEFT JOIN id2 USING (id2); CREATE VIEW b @@ -54,10 +54,10 @@ FROM SELECT * FROM a - LEFT JOIN id1 + ANY LEFT JOIN id1 USING (id1) ) AS js1 -LEFT JOIN id2 +ANY LEFT JOIN id2 USING (id2)); SELECT * diff --git a/tests/clickhouse-reference/01051_new_any_join_engine.sql.expected.ast.json b/tests/clickhouse-reference/01051_new_any_join_engine.sql.expected.ast.json index 2755e1b82..75f661b82 100644 --- a/tests/clickhouse-reference/01051_new_any_join_engine.sql.expected.ast.json +++ b/tests/clickhouse-reference/01051_new_any_join_engine.sql.expected.ast.json @@ -692,7 +692,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -751,7 +752,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -810,7 +812,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -869,7 +872,8 @@ "columns": [ "x" ] - } + }, + "strictness": "SEMI" }, "orderBy": [ { @@ -928,7 +932,8 @@ "columns": [ "x" ] - } + }, + "strictness": "SEMI" }, "orderBy": [ { @@ -987,7 +992,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANTI" }, "orderBy": [ { @@ -1046,7 +1052,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANTI" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01051_new_any_join_engine.sql.expected.formatted.sql b/tests/clickhouse-reference/01051_new_any_join_engine.sql.expected.formatted.sql index 07adf25df..bd955cd4d 100644 --- a/tests/clickhouse-reference/01051_new_any_join_engine.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01051_new_any_join_engine.sql.expected.formatted.sql @@ -98,7 +98,7 @@ SET parallel_replicas_local_plan = 1; SELECT * FROM t1 -LEFT JOIN any_left_join AS j +ANY LEFT JOIN any_left_join AS j USING (x) ORDER BY x ASC, @@ -108,7 +108,7 @@ ORDER BY SELECT * FROM t1 -INNER JOIN any_inner_join AS j +ANY INNER JOIN any_inner_join AS j USING (x) ORDER BY x ASC, @@ -118,7 +118,7 @@ ORDER BY SELECT * FROM t1 -RIGHT JOIN any_right_join AS j +ANY RIGHT JOIN any_right_join AS j USING (x) ORDER BY x ASC, @@ -128,7 +128,7 @@ ORDER BY SELECT * FROM t1 -LEFT JOIN semi_left_join AS j +SEMI LEFT JOIN semi_left_join AS j USING (x) ORDER BY x ASC, @@ -138,7 +138,7 @@ ORDER BY SELECT * FROM t1 -RIGHT JOIN semi_right_join AS j +SEMI RIGHT JOIN semi_right_join AS j USING (x) ORDER BY x ASC, @@ -148,7 +148,7 @@ ORDER BY SELECT * FROM t1 -LEFT JOIN anti_left_join AS j +ANTI LEFT JOIN anti_left_join AS j USING (x) ORDER BY x ASC, @@ -158,7 +158,7 @@ ORDER BY SELECT * FROM t1 -RIGHT JOIN anti_right_join AS j +ANTI RIGHT JOIN anti_right_join AS j USING (x) ORDER BY x ASC, diff --git a/tests/clickhouse-reference/01053_if_chain_check.sql.expected.ast.json b/tests/clickhouse-reference/01053_if_chain_check.sql.expected.ast.json index 6d2f2bc96..3962adc0b 100644 --- a/tests/clickhouse-reference/01053_if_chain_check.sql.expected.ast.json +++ b/tests/clickhouse-reference/01053_if_chain_check.sql.expected.ast.json @@ -1111,7 +1111,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -1854,7 +1855,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] } diff --git a/tests/clickhouse-reference/01053_if_chain_check.sql.expected.formatted.sql b/tests/clickhouse-reference/01053_if_chain_check.sql.expected.formatted.sql index 370ea5df9..8954d4b6b 100644 --- a/tests/clickhouse-reference/01053_if_chain_check.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01053_if_chain_check.sql.expected.formatted.sql @@ -6,7 +6,7 @@ FROM ( FROM `system`.numbers LIMIT 1001 ) -ORDER BY x ASC; +ORDER BY x ASC NULLS FIRST; SELECT x FROM ( @@ -14,4 +14,4 @@ FROM ( FROM `system`.numbers LIMIT 1001 ) -ORDER BY x ASC; \ No newline at end of file +ORDER BY x ASC NULLS FIRST; \ No newline at end of file diff --git a/tests/clickhouse-reference/01056_predicate_optimizer_bugs.sql.expected.ast.json b/tests/clickhouse-reference/01056_predicate_optimizer_bugs.sql.expected.ast.json index 370c08a01..f1e2066b9 100644 --- a/tests/clickhouse-reference/01056_predicate_optimizer_bugs.sql.expected.ast.json +++ b/tests/clickhouse-reference/01056_predicate_optimizer_bugs.sql.expected.ast.json @@ -1052,7 +1052,8 @@ "columns": [ "name" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -1130,7 +1131,8 @@ "columns": [ "name" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -1613,7 +1615,8 @@ "columns": [ "ccc" ] - } + }, + "strictness": "ANY" } } ] @@ -1717,7 +1720,8 @@ "columns": [ "ccc" ] - } + }, + "strictness": "ANY" } } ] @@ -1992,7 +1996,8 @@ ] } } - } + }, + "strictness": "ALL" }, "where": { "kind": "binaryExpr", @@ -2144,7 +2149,8 @@ ] } } - } + }, + "strictness": "ALL" }, "where": { "kind": "binaryExpr", diff --git a/tests/clickhouse-reference/01056_predicate_optimizer_bugs.sql.expected.formatted.sql b/tests/clickhouse-reference/01056_predicate_optimizer_bugs.sql.expected.formatted.sql index 97b390534..354b59b18 100644 --- a/tests/clickhouse-reference/01056_predicate_optimizer_bugs.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01056_predicate_optimizer_bugs.sql.expected.formatted.sql @@ -99,7 +99,7 @@ FROM SELECT name FROM `system`.`settings` ) -INNER JOIN ( +ANY INNER JOIN ( SELECT name FROM `system`.`settings` ) @@ -112,7 +112,7 @@ FROM SELECT name FROM `system`.`settings` ) -INNER JOIN ( +ANY INNER JOIN ( SELECT name FROM `system`.`settings` ) @@ -188,7 +188,7 @@ FROM ( ( SELECT 2 AS ccc ) - INNER JOIN ( + ANY INNER JOIN ( SELECT 2 AS ccc ) USING (ccc) @@ -204,7 +204,7 @@ FROM ( ( SELECT 2 AS ccc ) - INNER JOIN ( + ANY INNER JOIN ( SELECT 2 AS ccc ) USING (ccc) @@ -254,7 +254,7 @@ FROM id_b FROM A ) AS a -LEFT JOIN B AS b +ALL LEFT JOIN B AS b ON b.id = a.id_b WHERE a.ts <= toDateTime('1970-01-01 03:00:00'); @@ -274,7 +274,7 @@ FROM id_b FROM A ) AS a -LEFT JOIN B AS b +ALL LEFT JOIN B AS b ON `--b.id` = `--a.id_b` WHERE `--a.ts` <= toDateTime('1970-01-01 03:00:00'); diff --git a/tests/clickhouse-reference/01063_create_column_set.sql.expected.ast.json b/tests/clickhouse-reference/01063_create_column_set.sql.expected.ast.json index 7eabfc4e0..4bcf070d6 100644 --- a/tests/clickhouse-reference/01063_create_column_set.sql.expected.ast.json +++ b/tests/clickhouse-reference/01063_create_column_set.sql.expected.ast.json @@ -83,7 +83,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "prewhere": { "kind": "inExpr", diff --git a/tests/clickhouse-reference/01063_create_column_set.sql.expected.formatted.sql b/tests/clickhouse-reference/01063_create_column_set.sql.expected.formatted.sql index 371327d06..259bcc377 100644 --- a/tests/clickhouse-reference/01063_create_column_set.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01063_create_column_set.sql.expected.formatted.sql @@ -11,7 +11,7 @@ ORDER BY x; SELECT count() FROM mt -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 1 AS x ) AS js2 USING (x) diff --git a/tests/clickhouse-reference/01067_join_null.sql.expected.ast.json b/tests/clickhouse-reference/01067_join_null.sql.expected.ast.json index ba4fa5160..e2fc7a20e 100644 --- a/tests/clickhouse-reference/01067_join_null.sql.expected.ast.json +++ b/tests/clickhouse-reference/01067_join_null.sql.expected.ast.json @@ -103,7 +103,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01067_join_null.sql.expected.formatted.sql b/tests/clickhouse-reference/01067_join_null.sql.expected.formatted.sql index f6a6c6896..cb0394440 100644 --- a/tests/clickhouse-reference/01067_join_null.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01067_join_null.sql.expected.formatted.sql @@ -7,7 +7,7 @@ FROM UNION ALL SELECT NULL ) AS js1 -FULL JOIN ( +ALL FULL JOIN ( SELECT 1 AS id UNION ALL SELECT NULL diff --git a/tests/clickhouse-reference/01083_cross_to_inner_with_in_bug.sql.expected.ast.json b/tests/clickhouse-reference/01083_cross_to_inner_with_in_bug.sql.expected.ast.json index a3ca20ab0..a03891746 100644 --- a/tests/clickhouse-reference/01083_cross_to_inner_with_in_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/01083_cross_to_inner_with_in_bug.sql.expected.ast.json @@ -96,6 +96,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "ax" diff --git a/tests/clickhouse-reference/01083_cross_to_inner_with_in_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/01083_cross_to_inner_with_in_bug.sql.expected.formatted.sql index 886ae9f3f..5657b11d5 100644 --- a/tests/clickhouse-reference/01083_cross_to_inner_with_in_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01083_cross_to_inner_with_in_bug.sql.expected.formatted.sql @@ -22,7 +22,7 @@ INSERT INTO bx; SELECT * FROM bx -CROSS JOIN ax +, ax WHERE ax.A = bx.A AND ax.B IN (1, 2); diff --git a/tests/clickhouse-reference/01083_cross_to_inner_with_like.sql.expected.ast.json b/tests/clickhouse-reference/01083_cross_to_inner_with_like.sql.expected.ast.json index 96bc3627b..10ab60047 100644 --- a/tests/clickhouse-reference/01083_cross_to_inner_with_like.sql.expected.ast.json +++ b/tests/clickhouse-reference/01083_cross_to_inner_with_like.sql.expected.ast.json @@ -105,6 +105,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "r" @@ -169,6 +170,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "r" @@ -235,6 +237,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "r" diff --git a/tests/clickhouse-reference/01083_cross_to_inner_with_like.sql.expected.formatted.sql b/tests/clickhouse-reference/01083_cross_to_inner_with_like.sql.expected.formatted.sql index 5f212b57c..c402bbf2f 100644 --- a/tests/clickhouse-reference/01083_cross_to_inner_with_like.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01083_cross_to_inner_with_like.sql.expected.formatted.sql @@ -23,7 +23,7 @@ EXPLAIN SYNTAX SELECT * FROM n -CROSS JOIN r +, r WHERE n.k = r.k AND r.name = 'A'; @@ -31,7 +31,7 @@ EXPLAIN SYNTAX SELECT * FROM n -CROSS JOIN r +, r WHERE n.k = r.k AND like(r.name, 'A%'); @@ -39,7 +39,7 @@ EXPLAIN SYNTAX SELECT * FROM n -CROSS JOIN r +, r WHERE n.k = r.k AND notLike(r.name, 'A%'); diff --git a/tests/clickhouse-reference/01095_tpch_like_smoke.sql.expected.ast.json b/tests/clickhouse-reference/01095_tpch_like_smoke.sql.expected.ast.json index aec2c0a47..dfc459e3b 100644 --- a/tests/clickhouse-reference/01095_tpch_like_smoke.sql.expected.ast.json +++ b/tests/clickhouse-reference/01095_tpch_like_smoke.sql.expected.ast.json @@ -1586,6 +1586,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "supplier" @@ -1593,6 +1594,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "partsupp" @@ -1600,6 +1602,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation" @@ -1607,6 +1610,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "region" @@ -1763,6 +1767,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "supplier" @@ -1770,6 +1775,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation" @@ -1777,6 +1783,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "region" @@ -1998,6 +2005,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "orders" @@ -2005,6 +2013,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "lineitem" @@ -2408,6 +2417,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "orders" @@ -2415,6 +2425,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "lineitem" @@ -2422,6 +2433,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "supplier" @@ -2429,6 +2441,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation" @@ -2436,6 +2449,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "region" @@ -2997,6 +3011,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "lineitem" @@ -3004,6 +3019,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "orders" @@ -3011,6 +3027,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "customer" @@ -3018,6 +3035,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation", @@ -3026,6 +3044,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation", @@ -3470,6 +3489,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "supplier" @@ -3477,6 +3497,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "lineitem" @@ -3484,6 +3505,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "orders" @@ -3491,6 +3513,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "customer" @@ -3498,6 +3521,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation", @@ -3506,6 +3530,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation", @@ -3514,6 +3539,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "region" @@ -3884,6 +3910,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "supplier" @@ -3891,6 +3918,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "lineitem" @@ -3898,6 +3926,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "partsupp" @@ -3905,6 +3934,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "orders" @@ -3912,6 +3942,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation" @@ -4180,6 +4211,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "orders" @@ -4187,6 +4219,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "lineitem" @@ -4194,6 +4227,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation" @@ -4449,6 +4483,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "supplier" @@ -4456,6 +4491,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation" @@ -4606,6 +4642,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "supplier" @@ -4613,6 +4650,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation" @@ -4843,6 +4881,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "lineitem" @@ -5319,6 +5358,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "part" @@ -5563,6 +5603,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "revenue_view" @@ -5692,6 +5733,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "part" @@ -5960,6 +6002,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "part" @@ -6141,6 +6184,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "orders" @@ -6148,6 +6192,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "lineitem" @@ -6373,6 +6418,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "part" @@ -6976,6 +7022,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation" @@ -7290,6 +7337,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "lineitem", @@ -7298,6 +7346,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "orders" @@ -7305,6 +7354,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation" diff --git a/tests/clickhouse-reference/01095_tpch_like_smoke.sql.expected.formatted.sql b/tests/clickhouse-reference/01095_tpch_like_smoke.sql.expected.formatted.sql index f3d1b477d..e1d643fdb 100644 --- a/tests/clickhouse-reference/01095_tpch_like_smoke.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01095_tpch_like_smoke.sql.expected.formatted.sql @@ -177,10 +177,10 @@ SELECT s_comment FROM part -CROSS JOIN supplier -CROSS JOIN partsupp -CROSS JOIN nation -CROSS JOIN region +, supplier +, partsupp +, nation +, region WHERE p_partkey = ps_partkey AND s_suppkey = ps_suppkey AND p_size = 15 @@ -192,9 +192,9 @@ WHERE p_partkey = ps_partkey SELECT min(ps_supplycost) FROM partsupp - CROSS JOIN supplier - CROSS JOIN nation - CROSS JOIN region + , supplier + , nation + , region WHERE p_partkey = ps_partkey AND s_suppkey = ps_suppkey AND s_nationkey = n_nationkey @@ -217,8 +217,8 @@ SELECT o_shippriority FROM customer -CROSS JOIN orders -CROSS JOIN lineitem +, orders +, lineitem WHERE c_mktsegment = 'BUILDING' AND c_custkey = o_custkey AND l_orderkey = o_orderkey @@ -257,11 +257,11 @@ SELECT sum(l_extendedprice * ((1 - l_discount))) AS revenue FROM customer -CROSS JOIN orders -CROSS JOIN lineitem -CROSS JOIN supplier -CROSS JOIN nation -CROSS JOIN region +, orders +, lineitem +, supplier +, nation +, region WHERE c_custkey = o_custkey AND l_orderkey = o_orderkey AND l_suppkey = s_suppkey @@ -298,11 +298,11 @@ FROM ( l_extendedprice * ((1 - l_discount)) AS volume FROM supplier - CROSS JOIN lineitem - CROSS JOIN orders - CROSS JOIN customer - CROSS JOIN nation AS n1 - CROSS JOIN nation AS n2 + , lineitem + , orders + , customer + , nation AS n1 + , nation AS n2 WHERE s_suppkey = l_suppkey AND o_orderkey = l_orderkey AND c_custkey = o_custkey @@ -335,13 +335,13 @@ FROM ( n2.n_name AS nation FROM part - CROSS JOIN supplier - CROSS JOIN lineitem - CROSS JOIN orders - CROSS JOIN customer - CROSS JOIN nation AS n1 - CROSS JOIN nation AS n2 - CROSS JOIN region + , supplier + , lineitem + , orders + , customer + , nation AS n1 + , nation AS n2 + , region WHERE p_partkey = l_partkey AND s_suppkey = l_suppkey AND l_orderkey = o_orderkey @@ -369,11 +369,11 @@ FROM ( l_extendedprice * ((1 - l_discount)) - ps_supplycost * l_quantity AS amount FROM part - CROSS JOIN supplier - CROSS JOIN lineitem - CROSS JOIN partsupp - CROSS JOIN orders - CROSS JOIN nation + , supplier + , lineitem + , partsupp + , orders + , nation WHERE s_suppkey = l_suppkey AND ps_suppkey = l_suppkey AND ps_partkey = l_partkey @@ -402,9 +402,9 @@ SELECT c_comment FROM customer -CROSS JOIN orders -CROSS JOIN lineitem -CROSS JOIN nation +, orders +, lineitem +, nation WHERE c_custkey = o_custkey AND l_orderkey = o_orderkey AND o_orderdate >= toDate('1993-10-01') @@ -429,8 +429,8 @@ SELECT sum(ps_supplycost * ps_availqty) AS value FROM partsupp -CROSS JOIN supplier -CROSS JOIN nation +, supplier +, nation WHERE ps_suppkey = s_suppkey AND s_nationkey = n_nationkey AND n_name = 'GERMANY' @@ -442,8 +442,8 @@ HAVING sum(ps_supplycost * ps_availqty) > ( -- to the scale factor (SF): constant = 0.0001 / SF. FROM partsupp - CROSS JOIN supplier - CROSS JOIN nation + , supplier + , nation WHERE ps_suppkey = s_suppkey AND s_nationkey = n_nationkey AND n_name = 'GERMANY' @@ -460,7 +460,7 @@ SELECT AND o_orderpriority <> '2-HIGH', 1, 0)) AS low_line_count FROM orders -CROSS JOIN lineitem +, lineitem WHERE o_orderkey = l_orderkey AND l_shipmode IN ('MAIL', 'SHIP') AND l_commitdate < l_receiptdate @@ -496,7 +496,7 @@ SELECT 14; SELECT toDecimal32(100.00, 2) * sum(multiIf(like(p_type, 'PROMO%'), l_extendedprice * ((1 - l_discount)), 0)) / ((1 + sum(l_extendedprice * ((1 - l_discount))))) AS promo_revenue FROM lineitem -CROSS JOIN part +, part WHERE l_partkey = p_partkey AND l_shipdate >= toDate('1995-09-01') AND l_shipdate < toDate('1995-09-01') + toIntervalMonth('1'); @@ -521,7 +521,7 @@ SELECT total_revenue FROM supplier -CROSS JOIN revenue_view +, revenue_view WHERE s_suppkey = supplier_no AND total_revenue = ( SELECT max(total_revenue) @@ -538,7 +538,7 @@ SELECT countDistinct(ps_suppkey) AS supplier_cnt FROM partsupp -CROSS JOIN part +, part WHERE p_partkey = ps_partkey AND p_brand <> 'Brand#45' AND notLike(p_type, 'MEDIUM POLISHED%') @@ -563,7 +563,7 @@ SELECT 17; SELECT sum(l_extendedprice) / 7.0 AS avg_yearly FROM lineitem -CROSS JOIN part +, part WHERE p_partkey = l_partkey AND p_brand = 'Brand#23' AND p_container = 'MED BOX' @@ -584,8 +584,8 @@ SELECT sum(l_quantity) FROM customer -CROSS JOIN orders -CROSS JOIN lineitem +, orders +, lineitem WHERE o_orderkey IN ( SELECT l_orderkey FROM lineitem @@ -610,7 +610,7 @@ SELECT 19; SELECT sum(l_extendedprice * ((1 - l_discount))) AS revenue FROM lineitem -CROSS JOIN part +, part WHERE (p_partkey = l_partkey AND p_brand = 'Brand#12' AND p_container IN ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG') @@ -643,7 +643,7 @@ SELECT s_address FROM supplier -CROSS JOIN nation +, nation WHERE s_suppkey IN ( SELECT ps_suppkey FROM partsupp @@ -672,9 +672,9 @@ SELECT count(*) AS numwait FROM supplier -CROSS JOIN lineitem AS l1 -CROSS JOIN orders -CROSS JOIN nation +, lineitem AS l1 +, orders +, nation WHERE s_suppkey = l1.l_suppkey AND o_orderkey = l1.l_orderkey AND o_orderstatus = 'F' diff --git a/tests/clickhouse-reference/01115_join_with_dictionary.sql.expected.ast.json b/tests/clickhouse-reference/01115_join_with_dictionary.sql.expected.ast.json index c82919095..68815a1b0 100644 --- a/tests/clickhouse-reference/01115_join_with_dictionary.sql.expected.ast.json +++ b/tests/clickhouse-reference/01115_join_with_dictionary.sql.expected.ast.json @@ -631,7 +631,8 @@ "columns": [ "key" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -696,7 +697,8 @@ "columns": [ "key" ] - } + }, + "strictness": "SEMI" }, "orderBy": [ { @@ -761,7 +763,8 @@ "columns": [ "key" ] - } + }, + "strictness": "ANTI" }, "orderBy": [ { @@ -1116,7 +1119,8 @@ "columns": [ "key" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1181,7 +1185,8 @@ "columns": [ "key" ] - } + }, + "strictness": "SEMI" }, "orderBy": [ { @@ -1246,7 +1251,8 @@ "columns": [ "key" ] - } + }, + "strictness": "ANTI" }, "orderBy": [ { @@ -1612,7 +1618,8 @@ "columns": [ "key" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -2000,7 +2007,8 @@ "columns": [ "key" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -2066,7 +2074,8 @@ "columns": [ "key" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -2131,7 +2140,8 @@ "columns": [ "key" ] - } + }, + "strictness": "SEMI" }, "orderBy": [ { @@ -2197,7 +2207,8 @@ "columns": [ "key" ] - } + }, + "strictness": "ANTI" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01115_join_with_dictionary.sql.expected.formatted.sql b/tests/clickhouse-reference/01115_join_with_dictionary.sql.expected.formatted.sql index 9484ea438..553196e08 100644 --- a/tests/clickhouse-reference/01115_join_with_dictionary.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01115_join_with_dictionary.sql.expected.formatted.sql @@ -89,7 +89,7 @@ FROM SELECT number AS key FROM numbers(5) ) AS s1 -LEFT JOIN dict_flat AS d +ANY LEFT JOIN dict_flat AS d USING (key) ORDER BY key ASC; @@ -99,7 +99,7 @@ FROM SELECT number AS key FROM numbers(5) ) AS s1 -INNER JOIN dict_flat AS d +SEMI INNER JOIN dict_flat AS d USING (key) ORDER BY key ASC; @@ -109,7 +109,7 @@ FROM SELECT number AS key FROM numbers(5) ) AS s1 -INNER JOIN dict_flat AS d +ANTI INNER JOIN dict_flat AS d USING (key) ORDER BY key ASC; @@ -160,7 +160,7 @@ FROM SELECT number AS key FROM numbers(5) ) AS s1 -LEFT JOIN dict_hashed AS d +ANY LEFT JOIN dict_hashed AS d USING (key) ORDER BY key ASC; @@ -170,7 +170,7 @@ FROM SELECT number AS key FROM numbers(5) ) AS s1 -INNER JOIN dict_hashed AS d +SEMI INNER JOIN dict_hashed AS d USING (key) ORDER BY key ASC; @@ -180,7 +180,7 @@ FROM SELECT number AS key FROM numbers(5) ) AS s1 -INNER JOIN dict_hashed AS d +ANTI INNER JOIN dict_hashed AS d USING (key) ORDER BY key ASC; @@ -223,7 +223,7 @@ FROM SELECT number AS key FROM numbers(5) ) AS s1 -LEFT JOIN dict_flat AS d +ANY LEFT JOIN dict_flat AS d USING (key) ORDER BY key ASC SETTINGS any_join_distinct_right_table_keys = '1'; @@ -276,7 +276,7 @@ FROM SELECT number AS key FROM numbers(2) ) AS s1 -INNER JOIN dict_flat AS d +ANY INNER JOIN dict_flat AS d USING (key) ORDER BY s1.key ASC; @@ -286,7 +286,7 @@ FROM SELECT number AS key FROM numbers(2) ) AS s1 -RIGHT JOIN dict_flat AS d +ANY RIGHT JOIN dict_flat AS d USING (key) ORDER BY key ASC; @@ -296,7 +296,7 @@ FROM SELECT number AS key FROM numbers(2) ) AS s1 -RIGHT JOIN dict_flat AS d +SEMI RIGHT JOIN dict_flat AS d USING (key) ORDER BY s1.key ASC; @@ -306,7 +306,7 @@ FROM SELECT number AS key FROM numbers(2) ) AS s1 -RIGHT JOIN dict_flat AS d +ANTI RIGHT JOIN dict_flat AS d USING (key) ORDER BY key ASC; diff --git a/tests/clickhouse-reference/01116_asof_join_dolbyzerr.sql.expected.ast.json b/tests/clickhouse-reference/01116_asof_join_dolbyzerr.sql.expected.ast.json index e31d2a825..db66e621d 100644 --- a/tests/clickhouse-reference/01116_asof_join_dolbyzerr.sql.expected.ast.json +++ b/tests/clickhouse-reference/01116_asof_join_dolbyzerr.sql.expected.ast.json @@ -166,7 +166,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "groupBy": { "kind": "expressions", @@ -293,7 +294,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "groupBy": { "kind": "expressions", diff --git a/tests/clickhouse-reference/01116_asof_join_dolbyzerr.sql.expected.formatted.sql b/tests/clickhouse-reference/01116_asof_join_dolbyzerr.sql.expected.formatted.sql index 6c5d66e1d..2642e46d6 100644 --- a/tests/clickhouse-reference/01116_asof_join_dolbyzerr.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01116_asof_join_dolbyzerr.sql.expected.formatted.sql @@ -22,7 +22,7 @@ SELECT groupUniqArray(sessionId) FROM sessions -INNER JOIN orders +ASOF INNER JOIN orders ON (sessions.visitorId = orders.visitorId) AND (sessions.date <= orders.date) GROUP BY @@ -38,7 +38,7 @@ SELECT groupUniqArray(sessionId) FROM sessions -INNER JOIN orders +ASOF INNER JOIN orders ON (sessions.visitorId = orders.visitorId) AND (sessions.date <= orders.date) GROUP BY diff --git a/tests/clickhouse-reference/01116_cross_count_asterisks.sql.expected.ast.json b/tests/clickhouse-reference/01116_cross_count_asterisks.sql.expected.ast.json index e6a7bb264..6d4c5b459 100644 --- a/tests/clickhouse-reference/01116_cross_count_asterisks.sql.expected.ast.json +++ b/tests/clickhouse-reference/01116_cross_count_asterisks.sql.expected.ast.json @@ -28,6 +28,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -43,6 +44,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -162,6 +164,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -177,6 +180,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", diff --git a/tests/clickhouse-reference/01116_cross_count_asterisks.sql.expected.formatted.sql b/tests/clickhouse-reference/01116_cross_count_asterisks.sql.expected.formatted.sql index 5fafb93a2..0ebdd7958 100644 --- a/tests/clickhouse-reference/01116_cross_count_asterisks.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01116_cross_count_asterisks.sql.expected.formatted.sql @@ -1,8 +1,8 @@ SELECT count(*) FROM numbers(2) AS n1 -CROSS JOIN numbers(3) AS n2 -CROSS JOIN numbers(4) AS n3 +, numbers(3) AS n2 +, numbers(4) AS n3 WHERE (n1.number = n2.number) AND (n2.number = n3.number); @@ -13,8 +13,8 @@ FROM ( count(*) AS c FROM numbers(2) AS n1 - CROSS JOIN numbers(3) AS n2 - CROSS JOIN numbers(4) AS n3 + , numbers(3) AS n2 + , numbers(4) AS n3 WHERE (n1.number = n2.number) AND (n2.number = n3.number) AND ( diff --git a/tests/clickhouse-reference/01117_comma_and_others_join_mix.sql.expected.ast.json b/tests/clickhouse-reference/01117_comma_and_others_join_mix.sql.expected.ast.json index 8d9549efa..d9df08e0e 100644 --- a/tests/clickhouse-reference/01117_comma_and_others_join_mix.sql.expected.ast.json +++ b/tests/clickhouse-reference/01117_comma_and_others_join_mix.sql.expected.ast.json @@ -71,6 +71,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -143,6 +144,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -251,6 +253,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", diff --git a/tests/clickhouse-reference/01117_comma_and_others_join_mix.sql.expected.formatted.sql b/tests/clickhouse-reference/01117_comma_and_others_join_mix.sql.expected.formatted.sql index 8e91e88d3..7a748e6d1 100644 --- a/tests/clickhouse-reference/01117_comma_and_others_join_mix.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01117_comma_and_others_join_mix.sql.expected.formatted.sql @@ -5,7 +5,7 @@ FROM numbers(2) AS n1 INNER JOIN numbers(3) AS n2 ON n1.number = n2.number -CROSS JOIN numbers(4) AS n3 +, numbers(4) AS n3 ORDER BY n1.number ASC, n2.number ASC, @@ -14,7 +14,7 @@ ORDER BY SELECT * FROM numbers(3) AS n1 -CROSS JOIN numbers(2) AS n2 +, numbers(2) AS n2 LEFT JOIN numbers(2) AS n3 ON n1.number = n3.number ORDER BY @@ -25,7 +25,7 @@ ORDER BY SELECT * FROM numbers(2) AS n1 -CROSS JOIN numbers(3) AS n2 +, numbers(3) AS n2 RIGHT JOIN numbers(4) AS n3 ON n2.number = n3.number ORDER BY diff --git a/tests/clickhouse-reference/01139_asof_join_types.sql.expected.ast.json b/tests/clickhouse-reference/01139_asof_join_types.sql.expected.ast.json index 9bdb9b7e4..a44608e1f 100644 --- a/tests/clickhouse-reference/01139_asof_join_types.sql.expected.ast.json +++ b/tests/clickhouse-reference/01139_asof_join_types.sql.expected.ast.json @@ -81,7 +81,8 @@ "k", "v" ] - } + }, + "strictness": "ASOF" } }, { @@ -166,7 +167,8 @@ "k", "v" ] - } + }, + "strictness": "ASOF" } }, { @@ -251,7 +253,8 @@ "k", "v" ] - } + }, + "strictness": "ASOF" } }, { @@ -336,7 +339,8 @@ "k", "v" ] - } + }, + "strictness": "ASOF" } }, { @@ -421,7 +425,8 @@ "k", "v" ] - } + }, + "strictness": "ASOF" } }, { @@ -506,7 +511,8 @@ "k", "v" ] - } + }, + "strictness": "ASOF" } }, { @@ -591,7 +597,8 @@ "k", "v" ] - } + }, + "strictness": "ASOF" } }, { @@ -676,7 +683,8 @@ "k", "v" ] - } + }, + "strictness": "ASOF" } }, { @@ -771,7 +779,8 @@ "k", "v" ] - } + }, + "strictness": "ASOF" } }, { @@ -866,7 +875,8 @@ "k", "v" ] - } + }, + "strictness": "ASOF" } }, { @@ -961,7 +971,8 @@ "k", "v" ] - } + }, + "strictness": "ASOF" } }, { @@ -1046,7 +1057,8 @@ "k", "v" ] - } + }, + "strictness": "ASOF" } }, { @@ -1141,7 +1153,8 @@ "k", "v" ] - } + }, + "strictness": "ASOF" } }, { @@ -1214,7 +1227,8 @@ "k", "v" ] - } + }, + "strictness": "ASOF" }, "trailingComments": [ "-- { serverError BAD_TYPE_OF_FIELD }" diff --git a/tests/clickhouse-reference/01139_asof_join_types.sql.expected.formatted.sql b/tests/clickhouse-reference/01139_asof_join_types.sql.expected.formatted.sql index 2a77b5fd8..c83c33152 100644 --- a/tests/clickhouse-reference/01139_asof_join_types.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01139_asof_join_types.sql.expected.formatted.sql @@ -5,7 +5,7 @@ FROM 0 AS k, toInt8(1) AS v ) AS t1 -INNER JOIN ( +ASOF INNER JOIN ( SELECT 0 AS k, toInt8(0) AS v @@ -19,7 +19,7 @@ FROM 0 AS k, toInt16(1) AS v ) AS t1 -INNER JOIN ( +ASOF INNER JOIN ( SELECT 0 AS k, toInt16(0) AS v @@ -33,7 +33,7 @@ FROM 0 AS k, toInt32(1) AS v ) AS t1 -INNER JOIN ( +ASOF INNER JOIN ( SELECT 0 AS k, toInt32(0) AS v @@ -47,7 +47,7 @@ FROM 0 AS k, toInt64(1) AS v ) AS t1 -INNER JOIN ( +ASOF INNER JOIN ( SELECT 0 AS k, toInt64(0) AS v @@ -61,7 +61,7 @@ FROM 0 AS k, toUInt8(1) AS v ) AS t1 -INNER JOIN ( +ASOF INNER JOIN ( SELECT 0 AS k, toUInt8(0) AS v @@ -75,7 +75,7 @@ FROM 0 AS k, toUInt16(1) AS v ) AS t1 -INNER JOIN ( +ASOF INNER JOIN ( SELECT 0 AS k, toUInt16(0) AS v @@ -89,7 +89,7 @@ FROM 0 AS k, toUInt32(1) AS v ) AS t1 -INNER JOIN ( +ASOF INNER JOIN ( SELECT 0 AS k, toUInt32(0) AS v @@ -103,7 +103,7 @@ FROM 0 AS k, toUInt64(1) AS v ) AS t1 -INNER JOIN ( +ASOF INNER JOIN ( SELECT 0 AS k, toUInt64(0) AS v @@ -117,7 +117,7 @@ FROM 0 AS k, toDecimal32(1, 0) AS v ) AS t1 -INNER JOIN ( +ASOF INNER JOIN ( SELECT 0 AS k, toDecimal32(0, 0) AS v @@ -131,7 +131,7 @@ FROM 0 AS k, toDecimal64(1, 0) AS v ) AS t1 -INNER JOIN ( +ASOF INNER JOIN ( SELECT 0 AS k, toDecimal64(0, 0) AS v @@ -145,7 +145,7 @@ FROM 0 AS k, toDecimal128(1, 0) AS v ) AS t1 -INNER JOIN ( +ASOF INNER JOIN ( SELECT 0 AS k, toDecimal128(0, 0) AS v @@ -159,7 +159,7 @@ FROM 0 AS k, toDate(0) AS v ) AS t1 -INNER JOIN ( +ASOF INNER JOIN ( SELECT 0 AS k, toDate(0) AS v @@ -173,7 +173,7 @@ FROM 0 AS k, toDateTime(0, 'UTC') AS v ) AS t1 -INNER JOIN ( +ASOF INNER JOIN ( SELECT 0 AS k, toDateTime(0, 'UTC') AS v @@ -187,7 +187,7 @@ FROM 0 AS k, 'x' AS v ) AS t1 -INNER JOIN ( +ASOF INNER JOIN ( SELECT 0 AS k, 'x' AS v diff --git a/tests/clickhouse-reference/01143_trivial_count_with_join.sql.expected.ast.json b/tests/clickhouse-reference/01143_trivial_count_with_join.sql.expected.ast.json index 3c33f9cec..f15b2353f 100644 --- a/tests/clickhouse-reference/01143_trivial_count_with_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/01143_trivial_count_with_join.sql.expected.ast.json @@ -57,6 +57,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", diff --git a/tests/clickhouse-reference/01143_trivial_count_with_join.sql.expected.formatted.sql b/tests/clickhouse-reference/01143_trivial_count_with_join.sql.expected.formatted.sql index 880f01269..47915d785 100644 --- a/tests/clickhouse-reference/01143_trivial_count_with_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01143_trivial_count_with_join.sql.expected.formatted.sql @@ -8,7 +8,7 @@ FROM numbers(2); SELECT count(*) FROM t -CROSS JOIN numbers(2) AS r; +, numbers(2) AS r; SELECT count(*) FROM diff --git a/tests/clickhouse-reference/01144_multiple_joins_rewriter_v2_and_lambdas.sql.expected.ast.json b/tests/clickhouse-reference/01144_multiple_joins_rewriter_v2_and_lambdas.sql.expected.ast.json index 6a707a4fc..61f05f2cf 100644 --- a/tests/clickhouse-reference/01144_multiple_joins_rewriter_v2_and_lambdas.sql.expected.ast.json +++ b/tests/clickhouse-reference/01144_multiple_joins_rewriter_v2_and_lambdas.sql.expected.ast.json @@ -111,6 +111,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -138,6 +139,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -168,6 +170,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -396,6 +399,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -450,6 +454,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -480,6 +485,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -1069,6 +1075,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -1153,6 +1160,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -1233,6 +1241,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -1281,6 +1290,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { diff --git a/tests/clickhouse-reference/01144_multiple_joins_rewriter_v2_and_lambdas.sql.expected.formatted.sql b/tests/clickhouse-reference/01144_multiple_joins_rewriter_v2_and_lambdas.sql.expected.formatted.sql index cb196f481..d49e59af9 100644 --- a/tests/clickhouse-reference/01144_multiple_joins_rewriter_v2_and_lambdas.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01144_multiple_joins_rewriter_v2_and_lambdas.sql.expected.formatted.sql @@ -6,15 +6,15 @@ FROM ( SELECT [1] AS l ) AS s1 -CROSS JOIN ( +, ( SELECT [2] AS r ) AS s2 -CROSS JOIN ( +, ( SELECT 'test' AS test, 'query' AS query ) AS any_query -CROSS JOIN ( +, ( SELECT 1 ) AS check_single_query; @@ -28,15 +28,15 @@ FROM ( SELECT 1 ) AS rd -CROSS JOIN ( +, ( SELECT [[1,2], [3,4]] AS medians_by_version ) AS original_medians_array -CROSS JOIN ( +, ( SELECT 'test' AS test, 'query' AS query ) AS any_query -CROSS JOIN ( +, ( SELECT 1 AS A ) AS check_single_query; @@ -87,7 +87,7 @@ FROM version FROM table ) AS no_query - CROSS JOIN numbers(1, 100000) AS nn + , numbers(1, 100000) AS nn ORDER BY virtual_run ASC, rand() ASC @@ -100,7 +100,7 @@ FROM GROUP BY virtual_run ) AS virtual_medians_array ) AS rd -CROSS JOIN ( +, ( SELECT groupArrayInsertAt(median_metrics, version) AS medians_by_version FROM ( SELECT @@ -110,13 +110,13 @@ CROSS JOIN ( GROUP BY version ) AS original_medians ) AS original_medians_array -CROSS JOIN ( +, ( SELECT any(test) AS test, any(query) AS query FROM table ) AS any_query -CROSS JOIN ( +, ( SELECT throwIf(uniq((test, query))) FROM table ) AS check_single_query; diff --git a/tests/clickhouse-reference/01145_with_fill_const.sql.expected.ast.json b/tests/clickhouse-reference/01145_with_fill_const.sql.expected.ast.json index fbae4b72e..f1ac1f85c 100644 --- a/tests/clickhouse-reference/01145_with_fill_const.sql.expected.ast.json +++ b/tests/clickhouse-reference/01145_with_fill_const.sql.expected.ast.json @@ -36,6 +36,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "functionCall", "name": "toDateTime", diff --git a/tests/clickhouse-reference/01147_partial_merge_full_join.sql.expected.ast.json b/tests/clickhouse-reference/01147_partial_merge_full_join.sql.expected.ast.json index 3ec11243e..6db747ab8 100644 --- a/tests/clickhouse-reference/01147_partial_merge_full_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/01147_partial_merge_full_join.sql.expected.ast.json @@ -218,7 +218,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -259,7 +260,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -391,7 +393,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -447,7 +450,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -594,7 +598,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" @@ -623,7 +628,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" @@ -719,7 +725,8 @@ ] } } - } + }, + "strictness": "ANY" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" @@ -763,7 +770,8 @@ ] } } - } + }, + "strictness": "ANY" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" diff --git a/tests/clickhouse-reference/01147_partial_merge_full_join.sql.expected.formatted.sql b/tests/clickhouse-reference/01147_partial_merge_full_join.sql.expected.formatted.sql index a366fe821..762d6156b 100644 --- a/tests/clickhouse-reference/01147_partial_merge_full_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01147_partial_merge_full_join.sql.expected.formatted.sql @@ -35,14 +35,14 @@ SET join_algorithm = 'partial_merge'; SELECT * FROM t1 -RIGHT JOIN t0 +ANY RIGHT JOIN t0 USING (x) ORDER BY x ASC; -- { serverError NOT_IMPLEMENTED } SELECT * FROM t1 -FULL JOIN t0 +ANY FULL JOIN t0 USING (x) ORDER BY x ASC; -- { serverError NOT_IMPLEMENTED } @@ -63,14 +63,14 @@ ORDER BY x ASC; SELECT * FROM t1 -RIGHT JOIN t0 +ANY RIGHT JOIN t0 ON t1.x = t0.x ORDER BY x ASC; -- { serverError NOT_IMPLEMENTED } SELECT * FROM t1 -FULL JOIN t0 +ANY FULL JOIN t0 ON t1.x = t0.x ORDER BY x ASC; -- { serverError NOT_IMPLEMENTED } @@ -91,13 +91,13 @@ ORDER BY x ASC; SELECT * FROM t0 -RIGHT JOIN t1 +ANY RIGHT JOIN t1 USING (x); -- { serverError NOT_IMPLEMENTED } SELECT * FROM t0 -FULL JOIN t1 +ANY FULL JOIN t1 USING (x); -- { serverError NOT_IMPLEMENTED } SELECT * @@ -115,13 +115,13 @@ FULL JOIN t1 SELECT * FROM t0 -RIGHT JOIN t1 +ANY RIGHT JOIN t1 ON t1.x = t0.x; -- { serverError NOT_IMPLEMENTED } SELECT * FROM t0 -FULL JOIN t1 +ANY FULL JOIN t1 ON t1.x = t0.x; -- { serverError NOT_IMPLEMENTED } SELECT * diff --git a/tests/clickhouse-reference/01157_replace_table.sql.expected.ast.json b/tests/clickhouse-reference/01157_replace_table.sql.expected.ast.json index 5839915ec..9a666a415 100644 --- a/tests/clickhouse-reference/01157_replace_table.sql.expected.ast.json +++ b/tests/clickhouse-reference/01157_replace_table.sql.expected.ast.json @@ -713,7 +713,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01157_replace_table.sql.expected.formatted.sql b/tests/clickhouse-reference/01157_replace_table.sql.expected.formatted.sql index 70e184b77..62df62830 100644 --- a/tests/clickhouse-reference/01157_replace_table.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01157_replace_table.sql.expected.formatted.sql @@ -97,7 +97,7 @@ FROM t; SELECT * FROM numbers(10) AS t -INNER JOIN `join` +ANY INNER JOIN `join` ON t.number = `join`.n ORDER BY n ASC; diff --git a/tests/clickhouse-reference/01236_graphite_mt.sql.expected.ast.json b/tests/clickhouse-reference/01236_graphite_mt.sql.expected.ast.json index 466642a50..38e55fbf1 100644 --- a/tests/clickhouse-reference/01236_graphite_mt.sql.expected.ast.json +++ b/tests/clickhouse-reference/01236_graphite_mt.sql.expected.ast.json @@ -275,6 +275,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -360,6 +361,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -445,6 +447,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -530,6 +533,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -615,6 +619,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -700,6 +705,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -785,6 +791,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -870,6 +877,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -963,6 +971,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -1051,6 +1060,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -1136,6 +1146,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -1221,6 +1232,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -1306,6 +1318,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -1391,6 +1404,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -1476,6 +1490,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -1561,6 +1576,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", diff --git a/tests/clickhouse-reference/01236_graphite_mt.sql.expected.formatted.sql b/tests/clickhouse-reference/01236_graphite_mt.sql.expected.formatted.sql index e83400f99..c2c58fdc4 100644 --- a/tests/clickhouse-reference/01236_graphite_mt.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01236_graphite_mt.sql.expected.formatted.sql @@ -32,7 +32,7 @@ SELECT number FROM dates -CROSS JOIN numbers(300) +, numbers(300) UNION ALL SELECT 2, @@ -43,7 +43,7 @@ SELECT number FROM dates -CROSS JOIN numbers(300) +, numbers(300) UNION ALL SELECT 1, @@ -54,7 +54,7 @@ SELECT number FROM dates -CROSS JOIN numbers(300) +, numbers(300) UNION ALL SELECT 2, @@ -65,7 +65,7 @@ SELECT number FROM dates -CROSS JOIN numbers(300) +, numbers(300) UNION ALL SELECT 1, @@ -76,7 +76,7 @@ SELECT number FROM dates -CROSS JOIN numbers(300) +, numbers(300) UNION ALL SELECT 2, @@ -87,7 +87,7 @@ SELECT number FROM dates -CROSS JOIN numbers(300) +, numbers(300) UNION ALL SELECT 1, @@ -98,7 +98,7 @@ SELECT number FROM dates -CROSS JOIN numbers(300) +, numbers(300) UNION ALL SELECT 2, @@ -109,7 +109,7 @@ SELECT number FROM dates -CROSS JOIN numbers(300) +, numbers(300) UNION ALL -- Older than 2 days use 6000 second windows SELECT @@ -121,7 +121,7 @@ SELECT number FROM dates -CROSS JOIN numbers(1200) +, numbers(1200) UNION ALL SELECT 2, @@ -132,7 +132,7 @@ SELECT number FROM dates -CROSS JOIN numbers(1200) +, numbers(1200) UNION ALL SELECT 1, @@ -143,7 +143,7 @@ SELECT number FROM dates -CROSS JOIN numbers(1200) +, numbers(1200) UNION ALL SELECT 2, @@ -154,7 +154,7 @@ SELECT number FROM dates -CROSS JOIN numbers(1200) +, numbers(1200) UNION ALL SELECT 1, @@ -165,7 +165,7 @@ SELECT number FROM dates -CROSS JOIN numbers(1200) +, numbers(1200) UNION ALL SELECT 2, @@ -176,7 +176,7 @@ SELECT number FROM dates -CROSS JOIN numbers(1200) +, numbers(1200) UNION ALL SELECT 1, @@ -187,7 +187,7 @@ SELECT number FROM dates -CROSS JOIN numbers(1200) +, numbers(1200) UNION ALL SELECT 2, @@ -198,7 +198,7 @@ SELECT number FROM dates -CROSS JOIN numbers(1200); +, numbers(1200); SELECT key, diff --git a/tests/clickhouse-reference/01247_some_msan_crashs_from_22517.sql.expected.ast.json b/tests/clickhouse-reference/01247_some_msan_crashs_from_22517.sql.expected.ast.json index f1b6b3f8f..27ae01036 100644 --- a/tests/clickhouse-reference/01247_some_msan_crashs_from_22517.sql.expected.ast.json +++ b/tests/clickhouse-reference/01247_some_msan_crashs_from_22517.sql.expected.ast.json @@ -248,7 +248,8 @@ } ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ] } diff --git a/tests/clickhouse-reference/01247_some_msan_crashs_from_22517.sql.expected.formatted.sql b/tests/clickhouse-reference/01247_some_msan_crashs_from_22517.sql.expected.formatted.sql index d58e7ca37..55706cb2e 100644 --- a/tests/clickhouse-reference/01247_some_msan_crashs_from_22517.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01247_some_msan_crashs_from_22517.sql.expected.formatted.sql @@ -19,6 +19,6 @@ FROM ( ) > NULL)))), dummy, 65535) AS dummy ORDER BY ignore(-2) ASC, - identity(x) DESC + identity(x) DESC NULLS FIRST ) FORMAT Null; -- { serverError UNKNOWN_IDENTIFIER } \ No newline at end of file diff --git a/tests/clickhouse-reference/01272_totals_and_filter_bug.sql.expected.ast.json b/tests/clickhouse-reference/01272_totals_and_filter_bug.sql.expected.ast.json index bd16fde63..774ebbc4f 100644 --- a/tests/clickhouse-reference/01272_totals_and_filter_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/01272_totals_and_filter_bug.sql.expected.ast.json @@ -330,7 +330,8 @@ "columns": [ "dimension_1" ] - } + }, + "strictness": "ALL" }, "where": { "kind": "binaryExpr", diff --git a/tests/clickhouse-reference/01272_totals_and_filter_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/01272_totals_and_filter_bug.sql.expected.formatted.sql index a789671e5..2fd89517b 100644 --- a/tests/clickhouse-reference/01272_totals_and_filter_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01272_totals_and_filter_bug.sql.expected.formatted.sql @@ -47,7 +47,7 @@ FROM GROUP BY dimension_1 WITH TOTALS ) AS subquery_1 -FULL JOIN ( +ALL FULL JOIN ( SELECT dimension_1, sum(metric_2) AS sum_metric_2 diff --git a/tests/clickhouse-reference/01332_join_type_syntax_position.sql.expected.ast.json b/tests/clickhouse-reference/01332_join_type_syntax_position.sql.expected.ast.json index 4ba6eab9e..7ae140670 100644 --- a/tests/clickhouse-reference/01332_join_type_syntax_position.sql.expected.ast.json +++ b/tests/clickhouse-reference/01332_join_type_syntax_position.sql.expected.ast.json @@ -122,7 +122,8 @@ "columns": [ "number" ] - } + }, + "strictness": "ANY" } }, { @@ -164,7 +165,8 @@ "columns": [ "number" ] - } + }, + "strictness": "ANY" } }, { @@ -206,7 +208,8 @@ "columns": [ "number" ] - } + }, + "strictness": "SEMI" } }, { @@ -248,7 +251,8 @@ "columns": [ "number" ] - } + }, + "strictness": "SEMI" } }, { @@ -290,7 +294,8 @@ "columns": [ "number" ] - } + }, + "strictness": "ANTI" } }, { @@ -332,7 +337,8 @@ "columns": [ "number" ] - } + }, + "strictness": "ANTI" } }, { @@ -374,7 +380,8 @@ "columns": [ "number" ] - } + }, + "strictness": "ASOF" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" @@ -419,7 +426,8 @@ "columns": [ "number" ] - } + }, + "strictness": "ASOF" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" @@ -464,7 +472,8 @@ "columns": [ "number" ] - } + }, + "strictness": "ALL" }, "leadingComments": [ "-- legacy" @@ -509,7 +518,8 @@ "columns": [ "number" ] - } + }, + "strictness": "ALL" } }, { @@ -551,7 +561,8 @@ "columns": [ "number" ] - } + }, + "strictness": "ANY" } }, { @@ -593,7 +604,8 @@ "columns": [ "number" ] - } + }, + "strictness": "ANY" } }, { @@ -635,7 +647,8 @@ "columns": [ "number" ] - } + }, + "strictness": "SEMI" } }, { @@ -677,7 +690,8 @@ "columns": [ "number" ] - } + }, + "strictness": "SEMI" } }, { @@ -719,7 +733,8 @@ "columns": [ "number" ] - } + }, + "strictness": "ANTI" } }, { @@ -761,7 +776,8 @@ "columns": [ "number" ] - } + }, + "strictness": "ANTI" } }, { @@ -803,7 +819,8 @@ "columns": [ "number" ] - } + }, + "strictness": "ASOF" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" diff --git a/tests/clickhouse-reference/01332_join_type_syntax_position.sql.expected.formatted.sql b/tests/clickhouse-reference/01332_join_type_syntax_position.sql.expected.formatted.sql index d7fe9d363..e88b9ddf4 100644 --- a/tests/clickhouse-reference/01332_join_type_syntax_position.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01332_join_type_syntax_position.sql.expected.formatted.sql @@ -13,102 +13,102 @@ RIGHT JOIN numbers(1) AS t2 SELECT * FROM numbers(1) AS t1 -LEFT JOIN numbers(1) AS t2 +ANY LEFT JOIN numbers(1) AS t2 USING (number); SELECT * FROM numbers(1) AS t1 -RIGHT JOIN numbers(1) AS t2 +ANY RIGHT JOIN numbers(1) AS t2 USING (number); SELECT * FROM numbers(1) AS t1 -LEFT JOIN numbers(1) AS t2 +SEMI LEFT JOIN numbers(1) AS t2 USING (number); SELECT * FROM numbers(1) AS t1 -RIGHT JOIN numbers(1) AS t2 +SEMI RIGHT JOIN numbers(1) AS t2 USING (number); SELECT * FROM numbers(1) AS t1 -LEFT JOIN numbers(1) AS t2 +ANTI LEFT JOIN numbers(1) AS t2 USING (number); SELECT * FROM numbers(1) AS t1 -RIGHT JOIN numbers(1) AS t2 +ANTI RIGHT JOIN numbers(1) AS t2 USING (number); SELECT * FROM numbers(1) AS t1 -INNER JOIN numbers(1) AS t2 +ASOF INNER JOIN numbers(1) AS t2 USING (number); -- { serverError NOT_IMPLEMENTED } SELECT * FROM numbers(1) AS t1 -LEFT JOIN numbers(1) AS t2 +ASOF LEFT JOIN numbers(1) AS t2 USING (number); -- { serverError NOT_IMPLEMENTED } -- legacy SELECT * FROM numbers(1) AS t1 -LEFT JOIN numbers(1) AS t2 +ALL LEFT JOIN numbers(1) AS t2 USING (number); SELECT * FROM numbers(1) AS t1 -RIGHT JOIN numbers(1) AS t2 +ALL RIGHT JOIN numbers(1) AS t2 USING (number); SELECT * FROM numbers(1) AS t1 -LEFT JOIN numbers(1) AS t2 +ANY LEFT JOIN numbers(1) AS t2 USING (number); SELECT * FROM numbers(1) AS t1 -RIGHT JOIN numbers(1) AS t2 +ANY RIGHT JOIN numbers(1) AS t2 USING (number); SELECT * FROM numbers(1) AS t1 -LEFT JOIN numbers(1) AS t2 +SEMI LEFT JOIN numbers(1) AS t2 USING (number); SELECT * FROM numbers(1) AS t1 -RIGHT JOIN numbers(1) AS t2 +SEMI RIGHT JOIN numbers(1) AS t2 USING (number); SELECT * FROM numbers(1) AS t1 -LEFT JOIN numbers(1) AS t2 +ANTI LEFT JOIN numbers(1) AS t2 USING (number); SELECT * FROM numbers(1) AS t1 -RIGHT JOIN numbers(1) AS t2 +ANTI RIGHT JOIN numbers(1) AS t2 USING (number); SELECT * FROM numbers(1) AS t1 -LEFT JOIN numbers(1) AS t2 +ASOF LEFT JOIN numbers(1) AS t2 USING (number); -- { serverError NOT_IMPLEMENTED } \ No newline at end of file diff --git a/tests/clickhouse-reference/01379_with_fill_several_columns.sql.expected.ast.json b/tests/clickhouse-reference/01379_with_fill_several_columns.sql.expected.ast.json index d87ea62ee..9167b1d2a 100644 --- a/tests/clickhouse-reference/01379_with_fill_several_columns.sql.expected.ast.json +++ b/tests/clickhouse-reference/01379_with_fill_several_columns.sql.expected.ast.json @@ -139,7 +139,8 @@ "d2" ] }, - "direction": "ASC" + "direction": "ASC", + "withFill": true }, { "kind": "orderByItem", @@ -150,6 +151,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "literal", "type": "UInt64", @@ -299,6 +301,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "literal", "type": "UInt64", @@ -313,7 +316,8 @@ "d2" ] }, - "direction": "ASC" + "direction": "ASC", + "withFill": true } ] } diff --git a/tests/clickhouse-reference/01379_with_fill_several_columns.sql.expected.formatted.sql b/tests/clickhouse-reference/01379_with_fill_several_columns.sql.expected.formatted.sql index 34121b657..86e0a7286 100644 --- a/tests/clickhouse-reference/01379_with_fill_several_columns.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01379_with_fill_several_columns.sql.expected.formatted.sql @@ -5,7 +5,7 @@ SELECT FROM numbers(10) WHERE (number % 3) = 1 ORDER BY - d2 ASC, + d2 ASC WITH FILL, d1 ASC WITH FILL STEP 5; SELECT @@ -16,4 +16,4 @@ FROM numbers(10) WHERE (number % 3) = 1 ORDER BY d1 ASC WITH FILL STEP 5, - d2 ASC; \ No newline at end of file + d2 ASC WITH FILL; \ No newline at end of file diff --git a/tests/clickhouse-reference/01428_nullable_asof_join.sql.expected.ast.json b/tests/clickhouse-reference/01428_nullable_asof_join.sql.expected.ast.json index 730663d6c..642562cf8 100644 --- a/tests/clickhouse-reference/01428_nullable_asof_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/01428_nullable_asof_join.sql.expected.ast.json @@ -205,7 +205,8 @@ "pk", "dt" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -420,7 +421,8 @@ "pk", "dt" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -635,7 +637,8 @@ "pk", "dt" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -860,7 +863,8 @@ "pk", "dt" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -1091,7 +1095,8 @@ "pk", "dt" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -1338,7 +1343,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -1591,7 +1597,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -1844,7 +1851,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -2103,7 +2111,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -2312,7 +2321,8 @@ "pk", "dt" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -2527,7 +2537,8 @@ "pk", "dt" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -2752,7 +2763,8 @@ "pk", "dt" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -2977,7 +2989,8 @@ "pk", "dt" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -3202,7 +3215,8 @@ "pk", "dt" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -3433,7 +3447,8 @@ "pk", "dt" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -3680,7 +3695,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -3933,7 +3949,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -4186,7 +4203,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -4445,7 +4463,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -4704,7 +4723,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -4856,7 +4876,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "format": "Null" } diff --git a/tests/clickhouse-reference/01428_nullable_asof_join.sql.expected.formatted.sql b/tests/clickhouse-reference/01428_nullable_asof_join.sql.expected.formatted.sql index 15bd32bf3..11176da08 100644 --- a/tests/clickhouse-reference/01428_nullable_asof_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01428_nullable_asof_join.sql.expected.formatted.sql @@ -16,7 +16,7 @@ FROM toUInt8(number) AS dt FROM numbers(3) ) AS a -LEFT JOIN ( +ASOF LEFT JOIN ( SELECT 1 AS pk, 2 AS dt @@ -40,7 +40,7 @@ FROM toNullable(toUInt8(number)) AS dt FROM numbers(3) ) AS a -LEFT JOIN ( +ASOF LEFT JOIN ( SELECT 1 AS pk, 2 AS dt @@ -64,7 +64,7 @@ FROM toUInt8(number) AS dt FROM numbers(3) ) AS a -LEFT JOIN ( +ASOF LEFT JOIN ( SELECT 1 AS pk, toNullable(0) AS dt @@ -89,7 +89,7 @@ FROM toUInt8(number) AS dt FROM numbers(3) ) AS a -LEFT JOIN ( +ASOF LEFT JOIN ( SELECT 1 AS pk, toNullable(0) AS dt @@ -114,7 +114,7 @@ FROM toNullable(toUInt8(number)) AS dt FROM numbers(3) ) AS a -LEFT JOIN ( +ASOF LEFT JOIN ( SELECT 1 AS pk, toNullable(0) AS dt @@ -138,7 +138,7 @@ FROM toUInt8(number) AS dt FROM numbers(3) ) AS a -LEFT JOIN ( +ASOF LEFT JOIN ( SELECT 1 AS pk, 2 AS dt @@ -163,7 +163,7 @@ FROM toNullable(toUInt8(number)) AS dt FROM numbers(3) ) AS a -LEFT JOIN ( +ASOF LEFT JOIN ( SELECT 1 AS pk, 2 AS dt @@ -188,7 +188,7 @@ FROM toUInt8(number) AS dt FROM numbers(3) ) AS a -LEFT JOIN ( +ASOF LEFT JOIN ( SELECT 1 AS pk, toNullable(0) AS dt @@ -213,7 +213,7 @@ FROM toNullable(toUInt8(number)) AS dt FROM numbers(3) ) AS a -LEFT JOIN ( +ASOF LEFT JOIN ( SELECT 1 AS pk, toNullable(0) AS dt @@ -238,7 +238,7 @@ FROM toUInt8(number) AS dt FROM numbers(3) ) AS a -INNER JOIN ( +ASOF INNER JOIN ( SELECT 1 AS pk, 2 AS dt @@ -262,7 +262,7 @@ FROM toNullable(toUInt8(number)) AS dt FROM numbers(3) ) AS a -INNER JOIN ( +ASOF INNER JOIN ( SELECT 1 AS pk, 2 AS dt @@ -287,7 +287,7 @@ FROM toNullable(toUInt8(number)) AS dt FROM numbers(3) ) AS a -INNER JOIN ( +ASOF INNER JOIN ( SELECT 1 AS pk, 2 AS dt @@ -312,7 +312,7 @@ FROM toUInt8(number) AS dt FROM numbers(3) ) AS a -INNER JOIN ( +ASOF INNER JOIN ( SELECT 1 AS pk, toNullable(0) AS dt @@ -337,7 +337,7 @@ FROM toUInt8(number) AS dt FROM numbers(3) ) AS a -INNER JOIN ( +ASOF INNER JOIN ( SELECT 1 AS pk, toNullable(0) AS dt @@ -362,7 +362,7 @@ FROM toNullable(toUInt8(number)) AS dt FROM numbers(3) ) AS a -INNER JOIN ( +ASOF INNER JOIN ( SELECT 1 AS pk, toNullable(0) AS dt @@ -386,7 +386,7 @@ FROM toUInt8(number) AS dt FROM numbers(3) ) AS a -INNER JOIN ( +ASOF INNER JOIN ( SELECT 1 AS pk, 2 AS dt @@ -411,7 +411,7 @@ FROM toNullable(toUInt8(number)) AS dt FROM numbers(3) ) AS a -INNER JOIN ( +ASOF INNER JOIN ( SELECT 1 AS pk, 2 AS dt @@ -436,7 +436,7 @@ FROM toUInt8(number) AS dt FROM numbers(3) ) AS a -INNER JOIN ( +ASOF INNER JOIN ( SELECT 1 AS pk, toNullable(0) AS dt @@ -461,7 +461,7 @@ FROM toNullable(toUInt8(number)) AS dt FROM numbers(3) ) AS a -INNER JOIN ( +ASOF INNER JOIN ( SELECT 1 AS pk, toNullable(0) AS dt @@ -486,7 +486,7 @@ FROM toNullable(toUInt8(number)) AS dt FROM numbers(3) ) AS a -INNER JOIN ( +ASOF INNER JOIN ( SELECT 1 AS pk, toNullable(0) AS dt @@ -503,7 +503,7 @@ FROM 1 AS x, '2020-01-01 10:10:10'::DateTime64 AS t ) AS t1 -LEFT JOIN ( +ASOF LEFT JOIN ( SELECT NULL AS y, 1 AS x, diff --git a/tests/clickhouse-reference/01457_order_by_limit.sql.expected.ast.json b/tests/clickhouse-reference/01457_order_by_limit.sql.expected.ast.json index 0c1503531..f82eabecf 100644 --- a/tests/clickhouse-reference/01457_order_by_limit.sql.expected.ast.json +++ b/tests/clickhouse-reference/01457_order_by_limit.sql.expected.ast.json @@ -90,7 +90,8 @@ "a" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -140,7 +141,8 @@ "a" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -190,7 +192,8 @@ "a" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -240,7 +243,8 @@ "a" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -290,7 +294,8 @@ "a" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -340,7 +345,8 @@ "a" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -390,7 +396,8 @@ "a" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -440,7 +447,8 @@ "a" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", diff --git a/tests/clickhouse-reference/01457_order_by_limit.sql.expected.formatted.sql b/tests/clickhouse-reference/01457_order_by_limit.sql.expected.formatted.sql index 01ec2705b..e93bd195a 100644 --- a/tests/clickhouse-reference/01457_order_by_limit.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01457_order_by_limit.sql.expected.formatted.sql @@ -15,7 +15,7 @@ SELECT b FROM order_by_another ORDER BY - a ASC, + a ASC NULLS LAST, b ASC LIMIT 4; @@ -24,7 +24,7 @@ SELECT b FROM order_by_another ORDER BY - a ASC, + a ASC NULLS FIRST, b ASC LIMIT 4; @@ -33,7 +33,7 @@ SELECT b FROM order_by_another ORDER BY - a DESC, + a DESC NULLS LAST, b ASC LIMIT 4; @@ -42,7 +42,7 @@ SELECT b FROM order_by_another ORDER BY - a DESC, + a DESC NULLS FIRST, b ASC LIMIT 4; @@ -51,7 +51,7 @@ SELECT b FROM order_by_another ORDER BY - a ASC, + a ASC NULLS LAST, b DESC LIMIT 4; @@ -60,7 +60,7 @@ SELECT b FROM order_by_another ORDER BY - a ASC, + a ASC NULLS FIRST, b DESC LIMIT 4; @@ -69,7 +69,7 @@ SELECT b FROM order_by_another ORDER BY - a DESC, + a DESC NULLS LAST, b DESC LIMIT 4; @@ -78,6 +78,6 @@ SELECT b FROM order_by_another ORDER BY - a DESC, + a DESC NULLS FIRST, b DESC LIMIT 4; \ No newline at end of file diff --git a/tests/clickhouse-reference/01457_order_by_nulls_first.sql.expected.ast.json b/tests/clickhouse-reference/01457_order_by_nulls_first.sql.expected.ast.json index c406b5264..5e6c5aaa1 100644 --- a/tests/clickhouse-reference/01457_order_by_nulls_first.sql.expected.ast.json +++ b/tests/clickhouse-reference/01457_order_by_nulls_first.sql.expected.ast.json @@ -90,7 +90,8 @@ "diff" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -156,7 +157,8 @@ "diff" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -199,7 +201,8 @@ "diff" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -242,7 +245,8 @@ "diff" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -285,7 +289,8 @@ "diff" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -328,7 +333,8 @@ "diff" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -371,7 +377,8 @@ "diff" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -414,7 +421,8 @@ "diff" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -457,7 +465,8 @@ "diff" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", diff --git a/tests/clickhouse-reference/01457_order_by_nulls_first.sql.expected.formatted.sql b/tests/clickhouse-reference/01457_order_by_nulls_first.sql.expected.formatted.sql index 15edd7495..5f805d2ce 100644 --- a/tests/clickhouse-reference/01457_order_by_nulls_first.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01457_order_by_nulls_first.sql.expected.formatted.sql @@ -15,7 +15,7 @@ SELECT traf FROM order_by_nulls_first ORDER BY - diff DESC, + diff DESC NULLS FIRST, traf ASC LIMIT 1, 4; @@ -26,7 +26,7 @@ SELECT traf FROM order_by_nulls_first ORDER BY - diff DESC, + diff DESC NULLS FIRST, traf ASC; SELECT @@ -34,7 +34,7 @@ SELECT traf FROM order_by_nulls_first ORDER BY - diff DESC, + diff DESC NULLS LAST, traf ASC; SELECT @@ -42,7 +42,7 @@ SELECT traf FROM order_by_nulls_first ORDER BY - diff ASC, + diff ASC NULLS FIRST, traf ASC; SELECT @@ -50,7 +50,7 @@ SELECT traf FROM order_by_nulls_first ORDER BY - diff ASC, + diff ASC NULLS LAST, traf ASC; SELECT @@ -58,7 +58,7 @@ SELECT traf FROM order_by_nulls_first ORDER BY - diff DESC, + diff DESC NULLS FIRST, traf DESC; SELECT @@ -66,7 +66,7 @@ SELECT traf FROM order_by_nulls_first ORDER BY - diff DESC, + diff DESC NULLS LAST, traf DESC; SELECT @@ -74,7 +74,7 @@ SELECT traf FROM order_by_nulls_first ORDER BY - diff ASC, + diff ASC NULLS FIRST, traf DESC; SELECT @@ -82,5 +82,5 @@ SELECT traf FROM order_by_nulls_first ORDER BY - diff ASC, + diff ASC NULLS LAST, traf DESC; \ No newline at end of file diff --git a/tests/clickhouse-reference/01474_bad_global_join.sql.expected.ast.json b/tests/clickhouse-reference/01474_bad_global_join.sql.expected.ast.json index 0285202d2..8d9a17436 100644 --- a/tests/clickhouse-reference/01474_bad_global_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/01474_bad_global_join.sql.expected.ast.json @@ -172,7 +172,8 @@ "columns": [ "id" ] - } + }, + "global": true }, "trailingComments": [ "-- { serverError UNKNOWN_IDENTIFIER, 284 }" @@ -213,7 +214,8 @@ "columns": [ "id" ] - } + }, + "global": true } }, { diff --git a/tests/clickhouse-reference/01474_bad_global_join.sql.expected.formatted.sql b/tests/clickhouse-reference/01474_bad_global_join.sql.expected.formatted.sql index a72b58c89..d66bc2630 100644 --- a/tests/clickhouse-reference/01474_bad_global_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01474_bad_global_join.sql.expected.formatted.sql @@ -21,13 +21,13 @@ ENGINE = Distributed('test_cluster_two_shards_localhost', currentDatabase(), loc SELECT uniq(d.val) FROM dist_table AS d -LEFT JOIN numbers(100) AS t +GLOBAL LEFT JOIN numbers(100) AS t USING (id); -- { serverError UNKNOWN_IDENTIFIER, 284 } SELECT uniq(d.val) FROM dist_table AS d -LEFT JOIN local_table AS t +GLOBAL LEFT JOIN local_table AS t USING (id); DROP TABLE local_table; diff --git a/tests/clickhouse-reference/01479_cross_join_9855.sql.expected.ast.json b/tests/clickhouse-reference/01479_cross_join_9855.sql.expected.ast.json index e4d9ae9e1..07a6b0448 100644 --- a/tests/clickhouse-reference/01479_cross_join_9855.sql.expected.ast.json +++ b/tests/clickhouse-reference/01479_cross_join_9855.sql.expected.ast.json @@ -36,6 +36,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -129,6 +130,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -144,6 +146,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", diff --git a/tests/clickhouse-reference/01479_cross_join_9855.sql.expected.formatted.sql b/tests/clickhouse-reference/01479_cross_join_9855.sql.expected.formatted.sql index f54d13c61..b96d5df31 100644 --- a/tests/clickhouse-reference/01479_cross_join_9855.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01479_cross_join_9855.sql.expected.formatted.sql @@ -3,7 +3,7 @@ SET cross_to_inner_join_rewrite = 1; SELECT count() FROM numbers(4) AS n1 -CROSS JOIN numbers(3) AS n2 +, numbers(3) AS n2 WHERE n1.number > ( SELECT avg(n.number) FROM numbers(3) AS n @@ -13,8 +13,8 @@ SETTINGS enable_analyzer = 0; SELECT count() FROM numbers(4) AS n1 -CROSS JOIN numbers(3) AS n2 -CROSS JOIN numbers(6) AS n3 +, numbers(3) AS n2 +, numbers(6) AS n3 WHERE n1.number > ( SELECT avg(n.number) FROM numbers(3) AS n diff --git a/tests/clickhouse-reference/01495_subqueries_in_with_statement.sql.expected.ast.json b/tests/clickhouse-reference/01495_subqueries_in_with_statement.sql.expected.ast.json index 15826c614..72d842091 100644 --- a/tests/clickhouse-reference/01495_subqueries_in_with_statement.sql.expected.ast.json +++ b/tests/clickhouse-reference/01495_subqueries_in_with_statement.sql.expected.ast.json @@ -293,7 +293,8 @@ }, "parenthesized": true } - } + }, + "strictness": "ANY" } }, { diff --git a/tests/clickhouse-reference/01495_subqueries_in_with_statement.sql.expected.formatted.sql b/tests/clickhouse-reference/01495_subqueries_in_with_statement.sql.expected.formatted.sql index 5cd64b6dd..fea6a6bf6 100644 --- a/tests/clickhouse-reference/01495_subqueries_in_with_statement.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01495_subqueries_in_with_statement.sql.expected.formatted.sql @@ -51,7 +51,7 @@ FROM SELECT * FROM test1 ) AS l -INNER JOIN test1 AS r +ANY INNER JOIN test1 AS r ON (l.i == r.i); WITH test1 AS ( diff --git a/tests/clickhouse-reference/01504_rocksdb.sql.expected.ast.json b/tests/clickhouse-reference/01504_rocksdb.sql.expected.ast.json index b55763cf9..26de83123 100644 --- a/tests/clickhouse-reference/01504_rocksdb.sql.expected.ast.json +++ b/tests/clickhouse-reference/01504_rocksdb.sql.expected.ast.json @@ -1091,7 +1091,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01504_rocksdb.sql.expected.formatted.sql b/tests/clickhouse-reference/01504_rocksdb.sql.expected.formatted.sql index 28e29b116..105caa3f0 100644 --- a/tests/clickhouse-reference/01504_rocksdb.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01504_rocksdb.sql.expected.formatted.sql @@ -117,7 +117,7 @@ FROM SUM(dummy.1) AS e FROM `01504_test` ) AS A -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 0 AS a, groupBitmapMerge(bm) AS b, diff --git a/tests/clickhouse-reference/01533_distinct_depends_on_max_threads.sql.expected.ast.json b/tests/clickhouse-reference/01533_distinct_depends_on_max_threads.sql.expected.ast.json index f19b4efe6..42c455c6a 100644 --- a/tests/clickhouse-reference/01533_distinct_depends_on_max_threads.sql.expected.ast.json +++ b/tests/clickhouse-reference/01533_distinct_depends_on_max_threads.sql.expected.ast.json @@ -123,6 +123,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", diff --git a/tests/clickhouse-reference/01533_distinct_depends_on_max_threads.sql.expected.formatted.sql b/tests/clickhouse-reference/01533_distinct_depends_on_max_threads.sql.expected.formatted.sql index 842a243dc..2f87fce85 100644 --- a/tests/clickhouse-reference/01533_distinct_depends_on_max_threads.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01533_distinct_depends_on_max_threads.sql.expected.formatted.sql @@ -16,7 +16,7 @@ SET max_threads = 5; SELECT DISTINCT 1 FROM bug_13492 -CROSS JOIN numbers(1) AS n; +, numbers(1) AS n; SET max_threads = 2; diff --git a/tests/clickhouse-reference/01552_impl_aggfunc_cloneresize.sql.expected.ast.json b/tests/clickhouse-reference/01552_impl_aggfunc_cloneresize.sql.expected.ast.json index 9638c6edd..596e1fee7 100644 --- a/tests/clickhouse-reference/01552_impl_aggfunc_cloneresize.sql.expected.ast.json +++ b/tests/clickhouse-reference/01552_impl_aggfunc_cloneresize.sql.expected.ast.json @@ -344,7 +344,8 @@ "columns": [ "dim" ] - } + }, + "strictness": "ALL" } }, "alias": "C" diff --git a/tests/clickhouse-reference/01552_impl_aggfunc_cloneresize.sql.expected.formatted.sql b/tests/clickhouse-reference/01552_impl_aggfunc_cloneresize.sql.expected.formatted.sql index e00d7cad0..0dc1c8655 100644 --- a/tests/clickhouse-reference/01552_impl_aggfunc_cloneresize.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01552_impl_aggfunc_cloneresize.sql.expected.formatted.sql @@ -40,7 +40,7 @@ RIGHT JOIN ( WHERE dim > 2 GROUP BY dim ) AS A - RIGHT JOIN ( + ALL RIGHT JOIN ( SELECT dim, groupBitmapState(toUInt64(id)) AS ids2 diff --git a/tests/clickhouse-reference/01560_merge_distributed_join.sql.expected.ast.json b/tests/clickhouse-reference/01560_merge_distributed_join.sql.expected.ast.json index e736cf71a..86473d392 100644 --- a/tests/clickhouse-reference/01560_merge_distributed_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/01560_merge_distributed_join.sql.expected.ast.json @@ -213,7 +213,8 @@ "columns": [ "categoryId" ] - } + }, + "global": true } }, { diff --git a/tests/clickhouse-reference/01560_merge_distributed_join.sql.expected.formatted.sql b/tests/clickhouse-reference/01560_merge_distributed_join.sql.expected.formatted.sql index 228b0b25e..b0721e7a2 100644 --- a/tests/clickhouse-reference/01560_merge_distributed_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01560_merge_distributed_join.sql.expected.formatted.sql @@ -38,7 +38,7 @@ LEFT JOIN cat_hist AS c SELECT * FROM products AS p -LEFT JOIN cat_hist AS c +GLOBAL LEFT JOIN cat_hist AS c USING (categoryId); DROP TABLE cat_hist; diff --git a/tests/clickhouse-reference/01568_window_functions_distributed.sql.expected.ast.json b/tests/clickhouse-reference/01568_window_functions_distributed.sql.expected.ast.json index 8f20c747a..080b49cf3 100644 --- a/tests/clickhouse-reference/01568_window_functions_distributed.sql.expected.ast.json +++ b/tests/clickhouse-reference/01568_window_functions_distributed.sql.expected.ast.json @@ -310,7 +310,8 @@ "number" ] } - ] + ], + "windowName": "w" }, "alias": "x" }, @@ -326,7 +327,8 @@ "number" ] } - ] + ], + "windowName": "w" }, "alias": "y" } @@ -386,7 +388,8 @@ "number" ] } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -398,7 +401,8 @@ "number" ] } - ] + ], + "windowName": "w" } ], "from": { @@ -448,7 +452,8 @@ "number" ] } - ] + ], + "windowName": "w" }, "alias": "x" }, @@ -464,7 +469,8 @@ "number" ] } - ] + ], + "windowName": "w" }, "alias": "y" } @@ -544,7 +550,8 @@ "number" ] } - ] + ], + "windowName": "w" }, "alias": "x" }, @@ -560,7 +567,8 @@ "number" ] } - ] + ], + "windowName": "w" }, "alias": "y" } @@ -653,7 +661,8 @@ "number" ] } - ] + ], + "windowName": "w" }, "alias": "x" }, @@ -669,7 +678,8 @@ "number" ] } - ] + ], + "windowName": "w" }, "alias": "y" } diff --git a/tests/clickhouse-reference/01568_window_functions_distributed.sql.expected.formatted.sql b/tests/clickhouse-reference/01568_window_functions_distributed.sql.expected.formatted.sql index 0680b020e..446aa63cc 100644 --- a/tests/clickhouse-reference/01568_window_functions_distributed.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01568_window_functions_distributed.sql.expected.formatted.sql @@ -26,8 +26,8 @@ SELECT FROM numbers(9); SELECT - sum(number) AS x, - max(number) AS y + sum(number) OVER w AS x, + max(number) OVER w AS y FROM t_01568 ORDER BY x ASC, @@ -35,15 +35,15 @@ ORDER BY WINDOW w AS (PARTITION BY p); SELECT - sum(number), - max(number) + sum(number) OVER w, + max(number) OVER w FROM t_01568 ORDER BY p ASC WINDOW w AS (PARTITION BY p); SELECT - sum(number) AS x, - max(number) AS y + sum(number) OVER w AS x, + max(number) OVER w AS y FROM remote('127.0.0.{1,2}', '', t_01568) ORDER BY x ASC, @@ -51,8 +51,8 @@ ORDER BY WINDOW w AS (PARTITION BY p); SELECT - sum(number) AS x, - max(number) AS y + sum(number) OVER w AS x, + max(number) OVER w AS y FROM remote('127.0.0.{1,2}', '', t_01568) ORDER BY x ASC, @@ -61,8 +61,8 @@ WINDOW w AS (PARTITION BY p) SETTINGS max_threads = 1; SELECT DISTINCT - sum(number) AS x, - max(number) AS y + sum(number) OVER w AS x, + max(number) OVER w AS y FROM remote('127.0.0.{1,2}', '', t_01568) ORDER BY x ASC, diff --git a/tests/clickhouse-reference/01571_window_functions.sql.expected.ast.json b/tests/clickhouse-reference/01571_window_functions.sql.expected.ast.json index 0defcb1f4..856a07d3e 100644 --- a/tests/clickhouse-reference/01571_window_functions.sql.expected.ast.json +++ b/tests/clickhouse-reference/01571_window_functions.sql.expected.ast.json @@ -408,7 +408,8 @@ "type": "NULL", "value": "NULL" } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -430,7 +431,8 @@ "type": "UInt64", "value": "1" } - ] + ], + "windowName": "w" } ], "from": { diff --git a/tests/clickhouse-reference/01571_window_functions.sql.expected.formatted.sql b/tests/clickhouse-reference/01571_window_functions.sql.expected.formatted.sql index 07f2aaca6..bc7a478ee 100644 --- a/tests/clickhouse-reference/01571_window_functions.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01571_window_functions.sql.expected.formatted.sql @@ -42,8 +42,8 @@ FROM numbers(10); -- { serverError BAD_ARGUMENTS } -- default arguments of lagInFrame can be a subtype of the argument SELECT number, - lagInFrame(toNullable(number), 2, NULL), - lagInFrame(number, 2, 1) + lagInFrame(toNullable(number), 2, NULL) OVER w, + lagInFrame(number, 2, 1) OVER w FROM numbers(10) WINDOW w AS (ORDER BY number ASC); diff --git a/tests/clickhouse-reference/01582_any_join_supertype.sql.expected.ast.json b/tests/clickhouse-reference/01582_any_join_supertype.sql.expected.ast.json index 3a9f81f51..82c807002 100644 --- a/tests/clickhouse-reference/01582_any_join_supertype.sql.expected.ast.json +++ b/tests/clickhouse-reference/01582_any_join_supertype.sql.expected.ast.json @@ -199,7 +199,8 @@ "columns": [ "dimension_1" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "naryExpr", @@ -291,7 +292,8 @@ "columns": [ "dimension_1" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -365,7 +367,8 @@ "columns": [ "dimension_1" ] - } + }, + "strictness": "SEMI" }, "where": { "kind": "binaryExpr", diff --git a/tests/clickhouse-reference/01582_any_join_supertype.sql.expected.formatted.sql b/tests/clickhouse-reference/01582_any_join_supertype.sql.expected.formatted.sql index 81efae035..4acbf3739 100644 --- a/tests/clickhouse-reference/01582_any_join_supertype.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01582_any_join_supertype.sql.expected.formatted.sql @@ -32,7 +32,7 @@ SET any_join_distinct_right_table_keys = 0; SELECT count() FROM foo -INNER JOIN bar +ANY INNER JOIN bar USING (dimension_1) WHERE (foo.server_date <= '2020-11-07') AND (toDate(foo.server_time, 'Asia/Yekaterinburg') <= '2020-11-07'); @@ -40,14 +40,14 @@ WHERE (foo.server_date <= '2020-11-07') SELECT toDateTime(foo.server_time, 'UTC') FROM foo -INNER JOIN bar +ANY INNER JOIN bar USING (dimension_1) WHERE toDate(foo.server_time, 'UTC') <= toDate('2020-04-30'); SELECT toDateTime(foo.server_time, 'UTC') FROM foo -INNER JOIN bar +SEMI INNER JOIN bar USING (dimension_1) WHERE toDate(foo.server_time, 'UTC') <= toDate('2020-04-30'); diff --git a/tests/clickhouse-reference/01591_window_functions.sql.expected.ast.json b/tests/clickhouse-reference/01591_window_functions.sql.expected.ast.json index 55b8dcbeb..d3f2ec83d 100644 --- a/tests/clickhouse-reference/01591_window_functions.sql.expected.ast.json +++ b/tests/clickhouse-reference/01591_window_functions.sql.expected.ast.json @@ -1908,7 +1908,8 @@ "number" ] } - ] + ], + "windowName": "w1" }, { "kind": "functionCall", @@ -1920,7 +1921,8 @@ "number" ] } - ] + ], + "windowName": "w2" } ], "from": { @@ -2007,7 +2009,8 @@ "number" ] } - ] + ], + "windowName": "w1" }, { "kind": "functionCall", @@ -2209,7 +2212,8 @@ "number" ] } - ] + ], + "windowName": "w" }, "alias": "c" } @@ -2359,7 +2363,8 @@ "number" ] } - ] + ], + "windowName": "w" }, "alias": "c" } @@ -2504,7 +2509,8 @@ "number" ] } - ] + ], + "windowName": "w" }, "alias": "c" } @@ -2649,7 +2655,8 @@ "number" ] } - ] + ], + "windowName": "w" }, "alias": "c" } @@ -2794,7 +2801,8 @@ "number" ] } - ] + ], + "windowName": "w" }, "alias": "c" } @@ -2939,7 +2947,8 @@ "number" ] } - ] + ], + "windowName": "w" }, "alias": "c" } @@ -3101,7 +3110,8 @@ "number" ] } - ] + ], + "windowName": "wa" }, { "kind": "functionCall", @@ -3113,7 +3123,8 @@ "number" ] } - ] + ], + "windowName": "wo" }, { "kind": "functionCall", @@ -3125,7 +3136,8 @@ "number" ] } - ] + ], + "windowName": "wa" }, { "kind": "functionCall", @@ -3137,7 +3149,8 @@ "number" ] } - ] + ], + "windowName": "wo" } ], "from": { @@ -3856,7 +3869,8 @@ "number" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ], "frame": { @@ -4161,7 +4175,8 @@ "x" ] } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -4173,7 +4188,8 @@ "x" ] } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -4185,7 +4201,8 @@ "x" ] } - ] + ], + "windowName": "w" } ], "from": { @@ -4297,7 +4314,8 @@ "x" ] } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -4309,7 +4327,8 @@ "x" ] } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -4321,7 +4340,8 @@ "x" ] } - ] + ], + "windowName": "w" } ], "from": { @@ -4504,7 +4524,8 @@ "x" ] } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -4516,7 +4537,8 @@ "x" ] } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -4528,7 +4550,8 @@ "x" ] } - ] + ], + "windowName": "w" } ], "from": { @@ -4775,7 +4798,8 @@ "x" ] } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -4787,7 +4811,8 @@ "x" ] } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -4799,7 +4824,8 @@ "x" ] } - ] + ], + "windowName": "w" } ], "from": { @@ -4984,7 +5010,8 @@ "x" ] } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -4996,7 +5023,8 @@ "x" ] } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -5008,7 +5036,8 @@ "x" ] } - ] + ], + "windowName": "w" } ], "from": { @@ -5130,7 +5159,8 @@ "x" ] } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -5142,7 +5172,8 @@ "x" ] } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -5154,7 +5185,8 @@ "x" ] } - ] + ], + "windowName": "w" } ], "from": { @@ -5268,7 +5300,8 @@ "x" ] } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -5280,7 +5313,8 @@ "x" ] } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -5292,7 +5326,8 @@ "x" ] } - ] + ], + "windowName": "w" } ], "from": { @@ -5406,7 +5441,8 @@ "x" ] } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -5418,7 +5454,8 @@ "x" ] } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -5430,7 +5467,8 @@ "x" ] } - ] + ], + "windowName": "w" } ], "from": { @@ -6239,7 +6277,8 @@ "number" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ] } @@ -6265,7 +6304,8 @@ "number" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] } @@ -6524,22 +6564,26 @@ { "kind": "asterisk" } - ] + ], + "windowName": "w" }, { "kind": "functionCall", "name": "rank", - "args": [] + "args": [], + "windowName": "w" }, { "kind": "functionCall", "name": "dense_rank", - "args": [] + "args": [], + "windowName": "w" }, { "kind": "functionCall", "name": "row_number", - "args": [] + "args": [], + "windowName": "w" } ], "from": { @@ -6857,7 +6901,8 @@ "number" ] } - ] + ], + "windowName": "w" }, "alias": "lag1" }, @@ -6889,7 +6934,8 @@ ] } } - ] + ], + "windowName": "w" }, "alias": "lag2" }, @@ -6936,7 +6982,8 @@ "value": "11" } } - ] + ], + "windowName": "w" }, "alias": "lag" }, @@ -6983,7 +7030,8 @@ "value": "11" } } - ] + ], + "windowName": "w" }, "alias": "lead" } @@ -7247,7 +7295,8 @@ "type": "UInt64", "value": "1" } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -7270,7 +7319,8 @@ "type": "UInt64", "value": "2" } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -7287,7 +7337,8 @@ "type": "UInt64", "value": "1" } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -7304,7 +7355,8 @@ "type": "UInt64", "value": "2" } - ] + ], + "windowName": "w" } ], "from": { @@ -7361,7 +7413,8 @@ "number" ] } - ] + ], + "windowName": "w" }, { "kind": "functionCall", @@ -7373,7 +7426,8 @@ "number" ] } - ] + ], + "windowName": "w" } ], "from": { @@ -7467,7 +7521,8 @@ "type": "UInt64", "value": "1" } - ] + ], + "windowName": "w" }, "alias": "firstValue" }, @@ -7488,7 +7543,8 @@ "type": "UInt64", "value": "2" } - ] + ], + "windowName": "w" }, "alias": "secondValue" }, @@ -7509,7 +7565,8 @@ "type": "UInt64", "value": "3" } - ] + ], + "windowName": "w" }, "alias": "thirdValue" }, @@ -7530,7 +7587,8 @@ "type": "UInt64", "value": "4" } - ] + ], + "windowName": "w" }, "alias": "fourthValue" } @@ -7607,7 +7665,8 @@ "type": "UInt64", "value": "1" } - ] + ], + "windowName": "w" }, "alias": "firstValue" }, @@ -7628,7 +7687,8 @@ "type": "UInt64", "value": "2" } - ] + ], + "windowName": "w" }, "alias": "secondValue" }, @@ -7649,7 +7709,8 @@ "type": "UInt64", "value": "3" } - ] + ], + "windowName": "w" }, "alias": "thirdValue" }, @@ -7670,7 +7731,8 @@ "type": "UInt64", "value": "4" } - ] + ], + "windowName": "w" }, "alias": "fourthValue" } @@ -7772,7 +7834,8 @@ "type": "UInt64", "value": "1" } - ] + ], + "windowName": "w" }, "alias": "firstValue" }, @@ -7799,7 +7862,8 @@ "type": "UInt64", "value": "3" } - ] + ], + "windowName": "w" }, "alias": "thridValue" } @@ -9226,7 +9290,8 @@ "start": { "kind": "unbounded" } - } + }, + "baseWindow": "w1" } } ], @@ -9365,7 +9430,8 @@ "number" ] } - ] + ], + "baseWindow": "w" } } ], @@ -9432,7 +9498,8 @@ }, "direction": "ASC" } - ] + ], + "baseWindow": "w" } } ], @@ -9516,7 +9583,8 @@ "start": { "kind": "unbounded" } - } + }, + "baseWindow": "w" } } ], @@ -9600,7 +9668,9 @@ "kind": "functionCall", "name": "count", "args": [], - "window": {} + "window": { + "baseWindow": "w" + } } ], "from": { @@ -9637,7 +9707,8 @@ "start": { "kind": "unbounded" } - } + }, + "baseWindow": "w2" } } ], diff --git a/tests/clickhouse-reference/01591_window_functions.sql.expected.formatted.sql b/tests/clickhouse-reference/01591_window_functions.sql.expected.formatted.sql index 7bd6d39f2..f2f1d9653 100644 --- a/tests/clickhouse-reference/01591_window_functions.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01591_window_functions.sql.expected.formatted.sql @@ -177,8 +177,8 @@ SELECT 1 WINDOW w1 AS (); SELECT - sum(number), - sum(number) + sum(number) OVER w1, + sum(number) OVER w2 FROM numbers(10) WINDOW w1 AS (ROWS UNBOUNDED PRECEDING), @@ -187,7 +187,7 @@ WINDOW -- FIXME both functions should use the same window, but they don't. Add an -- EXPLAIN test for this. SELECT - sum(number), + sum(number) OVER w1, sum(number) OVER (PARTITION BY intDiv(number, 3) AS value ORDER BY number ASC ROWS UNBOUNDED PRECEDING) FROM numbers(10) WINDOW w1 AS (PARTITION BY intDiv(number, 3) ROWS UNBOUNDED PRECEDING); @@ -204,7 +204,7 @@ SELECT number, intDiv(number, 3) AS p, mod(number, 2) AS o, - count(number) AS c + count(number) OVER w AS c FROM numbers(31) ORDER BY number ASC WINDOW w AS (PARTITION BY p ORDER BY o ASC, number ASC RANGE UNBOUNDED PRECEDING) @@ -214,7 +214,7 @@ SELECT number, intDiv(number, 5) AS p, mod(number, 3) AS o, - count(number) AS c + count(number) OVER w AS c FROM numbers(31) ORDER BY number ASC WINDOW w AS (PARTITION BY p ORDER BY o ASC, number ASC RANGE UNBOUNDED PRECEDING) @@ -224,7 +224,7 @@ SELECT number, intDiv(number, 5) AS p, mod(number, 2) AS o, - count(number) AS c + count(number) OVER w AS c FROM numbers(31) ORDER BY number ASC WINDOW w AS (PARTITION BY p ORDER BY o ASC, number ASC RANGE UNBOUNDED PRECEDING) @@ -234,7 +234,7 @@ SELECT number, intDiv(number, 3) AS p, mod(number, 5) AS o, - count(number) AS c + count(number) OVER w AS c FROM numbers(31) ORDER BY number ASC WINDOW w AS (PARTITION BY p ORDER BY o ASC, number ASC RANGE UNBOUNDED PRECEDING) @@ -244,7 +244,7 @@ SELECT number, intDiv(number, 2) AS p, mod(number, 5) AS o, - count(number) AS c + count(number) OVER w AS c FROM numbers(31) ORDER BY number ASC WINDOW w AS (PARTITION BY p ORDER BY o ASC, number ASC RANGE UNBOUNDED PRECEDING) @@ -254,7 +254,7 @@ SELECT number, intDiv(number, 2) AS p, mod(number, 3) AS o, - count(number) AS c + count(number) OVER w AS c FROM numbers(31) ORDER BY number ASC WINDOW w AS (PARTITION BY p ORDER BY o ASC RANGE UNBOUNDED PRECEDING) @@ -272,10 +272,10 @@ FROM ( -- UNBOUNDED FOLLOWING frame end SELECT - min(number), - min(number), - max(number), - max(number) + min(number) OVER wa, + min(number) OVER wo, + max(number) OVER wa, + max(number) OVER wo FROM ( SELECT number, @@ -334,7 +334,7 @@ FROM numbers(10); -- seen a use-after-free under MSan in this query once SELECT number, - max(number) OVER (PARTITION BY intDiv(number, 7) ORDER BY number ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) + max(number) OVER (PARTITION BY intDiv(number, 7) ORDER BY number ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM numbers(1024) SETTINGS max_block_size = 2 FORMAT Null; @@ -370,9 +370,9 @@ FROM numbers(3); -- a basic RANGE OFFSET frame SELECT x, - min(x), - max(x), - count(x) + min(x) OVER w, + max(x) OVER w, + count(x) OVER w FROM ( SELECT toUInt8(number) AS x FROM numbers(11) @@ -383,9 +383,9 @@ WINDOW w AS (ORDER BY x ASC RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING); -- overflow conditions SELECT x, - min(x), - max(x), - count(x) + min(x) OVER w, + max(x) OVER w, + count(x) OVER w FROM ( SELECT toUInt8(if(mod(number, 2), toInt64(255 - intDiv(number, 2)), toInt64(intDiv(number, 2)))) AS x FROM numbers(10) @@ -395,9 +395,9 @@ WINDOW w AS (ORDER BY x ASC RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING); SELECT x, - min(x), - max(x), - count(x) + min(x) OVER w, + max(x) OVER w, + count(x) OVER w FROM ( SELECT toInt8(multiIf(mod(number, 3) == 0, toInt64(intDiv(number, 3)), mod(number, 3) == 1, toInt64(127 - intDiv(number, 3)), toInt64(-128 + intDiv(number, 3)))) AS x FROM numbers(15) @@ -410,9 +410,9 @@ WINDOW w AS (ORDER BY x ASC RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING); -- after that. The frame from this query is equivalent to the entire partition. SELECT x, - min(x), - max(x), - count(x) + min(x) OVER w, + max(x) OVER w, + count(x) OVER w FROM ( SELECT toUInt8(if(mod(number, 2), toInt64(255 - intDiv(number, 2)), toInt64(intDiv(number, 2)))) AS x FROM numbers(10) @@ -423,9 +423,9 @@ WINDOW w AS (ORDER BY x ASC RANGE BETWEEN 255 PRECEDING AND 255 FOLLOWING); -- RANGE OFFSET ORDER BY DESC SELECT x, - min(x), - max(x), - count(x) + min(x) OVER w, + max(x) OVER w, + count(x) OVER w FROM ( SELECT toUInt8(number) AS x FROM numbers(11) @@ -436,9 +436,9 @@ SETTINGS max_block_size = 1; SELECT x, - min(x), - max(x), - count(x) + min(x) OVER w, + max(x) OVER w, + count(x) OVER w FROM ( SELECT toUInt8(number) AS x FROM numbers(11) @@ -449,9 +449,9 @@ SETTINGS max_block_size = 2; SELECT x, - min(x), - max(x), - count(x) + min(x) OVER w, + max(x) OVER w, + count(x) OVER w FROM ( SELECT toUInt8(number) AS x FROM numbers(11) @@ -462,9 +462,9 @@ SETTINGS max_block_size = 3; SELECT x, - min(x), - max(x), - count(x) + min(x) OVER w, + max(x) OVER w, + count(x) OVER w FROM ( SELECT toUInt8(number) AS x FROM numbers(11) @@ -527,8 +527,8 @@ FROM ( -- A test case for the sort comparator found by fuzzer. SELECT - max(number) OVER (ORDER BY number DESC), - max(number) OVER (ORDER BY number ASC) + max(number) OVER (ORDER BY number DESC NULLS FIRST), + max(number) OVER (ORDER BY number ASC NULLS FIRST) FROM numbers(2); -- optimize_read_in_order conflicts with sorting for window functions, check that @@ -566,10 +566,10 @@ SELECT number, p, o, - count(*), - rank(), - dense_rank(), - row_number() + count(*) OVER w, + rank() OVER w, + dense_rank() OVER w, + row_number() OVER w FROM ( SELECT number, @@ -598,10 +598,10 @@ SELECT number, p, pp, - lagInFrame(number) AS lag1, - lagInFrame(number, number - pp) AS lag2, - lagInFrame(number, number - pp, number * 11) AS lag, - leadInFrame(number, number - pp, number * 11) AS lead + lagInFrame(number) OVER w AS lag1, + lagInFrame(number, number - pp) OVER w AS lag2, + lagInFrame(number, number - pp, number * 11) OVER w AS lag, + leadInFrame(number, number - pp, number * 11) OVER w AS lead FROM ( SELECT number, @@ -630,18 +630,18 @@ SELECT -- Nullable; otherwise, it returns default values. SELECT number, - lagInFrame(toNullable(number), 1), - lagInFrame(toNullable(number), 2), - lagInFrame(number, 1), - lagInFrame(number, 2) + lagInFrame(toNullable(number), 1) OVER w, + lagInFrame(toNullable(number), 2) OVER w, + lagInFrame(number, 1) OVER w, + lagInFrame(number, 2) OVER w FROM numbers(4) WINDOW w AS (ORDER BY number ASC); -- case-insensitive SQL-standard synonyms for any and anyLast SELECT number, - fIrSt_VaLue(number), - lAsT_vAlUe(number) + fIrSt_VaLue(number) OVER w, + lAsT_vAlUe(number) OVER w FROM numbers(10) ORDER BY number ASC WINDOW w AS (ORDER BY number ASC RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING); @@ -649,10 +649,10 @@ WINDOW w AS (ORDER BY number ASC RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING); -- nth_value without specific frame range given SELECT number, - nth_value(number, 1) AS firstValue, - nth_value(number, 2) AS secondValue, - nth_value(number, 3) AS thirdValue, - nth_value(number, 4) AS fourthValue + nth_value(number, 1) OVER w AS firstValue, + nth_value(number, 2) OVER w AS secondValue, + nth_value(number, 3) OVER w AS thirdValue, + nth_value(number, 4) OVER w AS fourthValue FROM numbers(10) ORDER BY number ASC WINDOW w AS (ORDER BY number ASC); @@ -660,10 +660,10 @@ WINDOW w AS (ORDER BY number ASC); -- nth_value with frame range specified SELECT number, - nth_value(number, 1) AS firstValue, - nth_value(number, 2) AS secondValue, - nth_value(number, 3) AS thirdValue, - nth_value(number, 4) AS fourthValue + nth_value(number, 1) OVER w AS firstValue, + nth_value(number, 2) OVER w AS secondValue, + nth_value(number, 3) OVER w AS thirdValue, + nth_value(number, 4) OVER w AS fourthValue FROM numbers(10) ORDER BY number ASC WINDOW w AS (ORDER BY number ASC RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING); @@ -672,8 +672,8 @@ WINDOW w AS (ORDER BY number ASC RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING); -- Nullable; otherwise, it returns default values. SELECT number, - nth_value(toNullable(number), 1) AS firstValue, - nth_value(toNullable(number), 3) AS thridValue + nth_value(toNullable(number), 1) OVER w AS firstValue, + nth_value(toNullable(number), 3) OVER w AS thridValue FROM numbers(5) WINDOW w AS (ORDER BY number ASC); @@ -814,7 +814,7 @@ WHERE NULL; -- Inheriting another window. SELECT number, - count() OVER (ROWS UNBOUNDED PRECEDING) + count() OVER (w1 ROWS UNBOUNDED PRECEDING) FROM numbers(10) ORDER BY p ASC, @@ -825,24 +825,24 @@ WINDOW w1 AS (w0 ORDER BY mod(number, 3) AS o ASC, number ASC); -- can't redefine PARTITION BY -SELECT count() OVER (PARTITION BY number) +SELECT count() OVER (w PARTITION BY number) FROM numbers(1) WINDOW w AS (PARTITION BY intDiv(number, 5)); -- { serverError BAD_ARGUMENTS } -- can't redefine existing ORDER BY -SELECT count() OVER (ORDER BY number ASC) +SELECT count() OVER (w ORDER BY number ASC) FROM numbers(1) WINDOW w AS (PARTITION BY intDiv(number, 5) ORDER BY mod(number, 3) ASC); -- { serverError BAD_ARGUMENTS } -- parent window can't have frame -SELECT count() OVER (RANGE UNBOUNDED PRECEDING) +SELECT count() OVER (w RANGE UNBOUNDED PRECEDING) FROM numbers(1) WINDOW w AS (PARTITION BY intDiv(number, 5) ORDER BY mod(number, 3) ASC ROWS UNBOUNDED PRECEDING); -- { serverError BAD_ARGUMENTS } -- looks weird but probably should work -- this is a window that inherits and changes nothing -SELECT count() OVER () +SELECT count() OVER (w) FROM numbers(1) WINDOW w AS (); -- nonexistent parent window -SELECT count() OVER (ROWS UNBOUNDED PRECEDING); -- { serverError BAD_ARGUMENTS } \ No newline at end of file +SELECT count() OVER (w2 ROWS UNBOUNDED PRECEDING); -- { serverError BAD_ARGUMENTS } \ No newline at end of file diff --git a/tests/clickhouse-reference/01594_storage_join_uuid.sql.expected.ast.json b/tests/clickhouse-reference/01594_storage_join_uuid.sql.expected.ast.json index 1378d8e35..55e86260c 100644 --- a/tests/clickhouse-reference/01594_storage_join_uuid.sql.expected.ast.json +++ b/tests/clickhouse-reference/01594_storage_join_uuid.sql.expected.ast.json @@ -188,7 +188,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { diff --git a/tests/clickhouse-reference/01594_storage_join_uuid.sql.expected.formatted.sql b/tests/clickhouse-reference/01594_storage_join_uuid.sql.expected.formatted.sql index 6449bde5a..dcb638f50 100644 --- a/tests/clickhouse-reference/01594_storage_join_uuid.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01594_storage_join_uuid.sql.expected.formatted.sql @@ -26,7 +26,7 @@ INSERT INTO t; SELECT id FROM t -LEFT JOIN joint +ANY LEFT JOIN joint ON t.id = joint.id; DROP TABLE joint; diff --git a/tests/clickhouse-reference/01614_with_fill_with_limit.sql.expected.ast.json b/tests/clickhouse-reference/01614_with_fill_with_limit.sql.expected.ast.json index 189dc425f..180ac2f46 100644 --- a/tests/clickhouse-reference/01614_with_fill_with_limit.sql.expected.ast.json +++ b/tests/clickhouse-reference/01614_with_fill_with_limit.sql.expected.ast.json @@ -83,6 +83,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "literal", "type": "UInt64", @@ -182,6 +183,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "literal", "type": "UInt64", diff --git a/tests/clickhouse-reference/01621_sort_after_join_pipeline_stuck.sql.expected.ast.json b/tests/clickhouse-reference/01621_sort_after_join_pipeline_stuck.sql.expected.ast.json index 424bc76c9..0b738f4b4 100644 --- a/tests/clickhouse-reference/01621_sort_after_join_pipeline_stuck.sql.expected.ast.json +++ b/tests/clickhouse-reference/01621_sort_after_join_pipeline_stuck.sql.expected.ast.json @@ -183,7 +183,8 @@ "columns": [ "k" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -193,7 +194,8 @@ "type": "UInt64", "value": "257" }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ], "format": "Null" diff --git a/tests/clickhouse-reference/01621_sort_after_join_pipeline_stuck.sql.expected.formatted.sql b/tests/clickhouse-reference/01621_sort_after_join_pipeline_stuck.sql.expected.formatted.sql index 303d5ef2e..ae9d8d7c1 100644 --- a/tests/clickhouse-reference/01621_sort_after_join_pipeline_stuck.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01621_sort_after_join_pipeline_stuck.sql.expected.formatted.sql @@ -12,7 +12,7 @@ FROM FROM `system`.numbers LIMIT 1048577 ) AS js1 -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT 1.000100016593933, nullIf(number, NULL) AS k, @@ -21,5 +21,5 @@ RIGHT JOIN ( LIMIT 2, 255 ) AS js2 USING (k) -ORDER BY 257 ASC +ORDER BY 257 ASC NULLS LAST FORMAT Null; \ No newline at end of file diff --git a/tests/clickhouse-reference/01651_bugs_from_15889.sql.expected.ast.json b/tests/clickhouse-reference/01651_bugs_from_15889.sql.expected.ast.json index e858dcfbb..fae0ca4c2 100644 --- a/tests/clickhouse-reference/01651_bugs_from_15889.sql.expected.ast.json +++ b/tests/clickhouse-reference/01651_bugs_from_15889.sql.expected.ast.json @@ -207,7 +207,8 @@ "number" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ], "limit": { @@ -287,7 +288,8 @@ "number" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ], "limit": { @@ -1841,7 +1843,9 @@ "columns": [ "n" ] - } + }, + "strictness": "ANY", + "global": true }, "limit": { "count": { diff --git a/tests/clickhouse-reference/01651_bugs_from_15889.sql.expected.formatted.sql b/tests/clickhouse-reference/01651_bugs_from_15889.sql.expected.formatted.sql index c7dddcd29..3c42a84bb 100644 --- a/tests/clickhouse-reference/01651_bugs_from_15889.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01651_bugs_from_15889.sql.expected.formatted.sql @@ -26,7 +26,7 @@ ENGINE = Distributed(test_shard_localhost, currentDatabase(), xp); SELECT count(7 = ( SELECT number FROM numbers(0) - ORDER BY number ASC + ORDER BY number ASC NULLS FIRST LIMIT 7 )) FROM xp_d @@ -35,7 +35,7 @@ PREWHERE toYYYYMM(A) GLOBAL IN ( NULL = ( SELECT number FROM numbers(1) - ORDER BY number DESC + ORDER BY number DESC NULLS LAST LIMIT 1 ), toYYYYMM(min(A)) @@ -180,7 +180,7 @@ SELECT j2 FROM remote('127.0.0.{2,3}', `system`.numbers) -LEFT JOIN ( +GLOBAL ANY LEFT JOIN ( SELECT number / 3 AS n, number AS j1, diff --git a/tests/clickhouse-reference/01655_window_functions_cume_dist.sql.expected.ast.json b/tests/clickhouse-reference/01655_window_functions_cume_dist.sql.expected.ast.json index a9fcd0dda..3fc912408 100644 --- a/tests/clickhouse-reference/01655_window_functions_cume_dist.sql.expected.ast.json +++ b/tests/clickhouse-reference/01655_window_functions_cume_dist.sql.expected.ast.json @@ -465,7 +465,8 @@ "b" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] } @@ -517,7 +518,8 @@ "b" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] } diff --git a/tests/clickhouse-reference/01655_window_functions_cume_dist.sql.expected.formatted.sql b/tests/clickhouse-reference/01655_window_functions_cume_dist.sql.expected.formatted.sql index e5bfef8e6..d1c6bb221 100644 --- a/tests/clickhouse-reference/01655_window_functions_cume_dist.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01655_window_functions_cume_dist.sql.expected.formatted.sql @@ -64,14 +64,14 @@ ORDER BY a ASC; SELECT a, b, - cume_dist() OVER (ORDER BY b ASC) + cume_dist() OVER (ORDER BY b ASC NULLS FIRST) FROM test_cume_dist ORDER BY a ASC; SELECT a, b, - cume_dist() OVER (ORDER BY b ASC) + cume_dist() OVER (ORDER BY b ASC NULLS LAST) FROM test_cume_dist ORDER BY a ASC; diff --git a/tests/clickhouse-reference/01656_sequence_next_node_distinct.sql.expected.ast.json b/tests/clickhouse-reference/01656_sequence_next_node_distinct.sql.expected.ast.json index 7a944aa95..54dd978c5 100644 --- a/tests/clickhouse-reference/01656_sequence_next_node_distinct.sql.expected.ast.json +++ b/tests/clickhouse-reference/01656_sequence_next_node_distinct.sql.expected.ast.json @@ -223,7 +223,8 @@ } ] } - ] + ], + "nullsAction": "IGNORE NULLS" }, "alias": "next_node" } @@ -251,7 +252,8 @@ "ALL" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] } diff --git a/tests/clickhouse-reference/01656_sequence_next_node_distinct.sql.expected.formatted.sql b/tests/clickhouse-reference/01656_sequence_next_node_distinct.sql.expected.formatted.sql index 0b86ee1b5..970fe292c 100644 --- a/tests/clickhouse-reference/01656_sequence_next_node_distinct.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01656_sequence_next_node_distinct.sql.expected.formatted.sql @@ -17,9 +17,9 @@ SELECT DISTINCT '(forward, head, A->B)', id, sequenceNextNodeDistinct('forward', 'head', 4)(dt, action, action = 'A', toNullable(isNotNull(1)) - AND (NOT toNullable(isNullable(1)))) AS next_node + AND (NOT toNullable(isNullable(1)))) IGNORE NULLS AS next_node FROM events_demo GROUP BY * WITH ROLLUP WITH TOTALS -ORDER BY `ALL` ASC; \ No newline at end of file +ORDER BY `ALL` ASC NULLS LAST; \ No newline at end of file diff --git a/tests/clickhouse-reference/01660_join_or_all.sql.expected.ast.json b/tests/clickhouse-reference/01660_join_or_all.sql.expected.ast.json index 058bf8db8..e1e90fe8c 100644 --- a/tests/clickhouse-reference/01660_join_or_all.sql.expected.ast.json +++ b/tests/clickhouse-reference/01660_join_or_all.sql.expected.ast.json @@ -274,7 +274,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -366,7 +367,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -470,7 +472,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -612,7 +615,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -730,7 +734,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -870,7 +875,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1027,7 +1033,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1128,7 +1135,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1220,7 +1228,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1324,7 +1333,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1466,7 +1476,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1584,7 +1595,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1724,7 +1736,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1881,7 +1894,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01660_join_or_all.sql.expected.formatted.sql b/tests/clickhouse-reference/01660_join_or_all.sql.expected.formatted.sql index cef4bf579..8b5cf0cb0 100644 --- a/tests/clickhouse-reference/01660_join_or_all.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01660_join_or_all.sql.expected.formatted.sql @@ -47,7 +47,7 @@ SELECT b2 FROM tab2 -LEFT JOIN tab3 +ALL LEFT JOIN tab3 ON a2 = a3 OR b2 = b3 ORDER BY @@ -59,7 +59,7 @@ SELECT b3 FROM tab2 -LEFT JOIN tab3 +ALL LEFT JOIN tab3 ON a2 = a3 OR b2 = b3 ORDER BY @@ -73,7 +73,7 @@ SELECT b3 FROM tab2 -LEFT JOIN tab3 +ALL LEFT JOIN tab3 ON a2 = a3 OR b2 = b3 ORDER BY @@ -85,7 +85,7 @@ ORDER BY SELECT a1 FROM tab1 -LEFT JOIN tab2 +ALL LEFT JOIN tab2 ON b1 + 1 = a2 + 1 OR a1 + 4 = b2 + 2 ORDER BY a1 ASC; @@ -95,7 +95,7 @@ SELECT b2 FROM tab1 -LEFT JOIN tab2 +ALL LEFT JOIN tab2 ON b1 + 1 = a2 + 1 OR a1 + 4 = b2 + 2 ORDER BY @@ -109,7 +109,7 @@ SELECT b2 FROM tab1 -LEFT JOIN tab2 +ALL LEFT JOIN tab2 ON b1 + 1 = a2 + 1 OR a1 + 4 = b2 + 2 ORDER BY @@ -123,7 +123,7 @@ SELECT b2 + 1 FROM tab1 -LEFT JOIN tab2 +ALL LEFT JOIN tab2 ON b1 + 1 = a2 + 1 OR a1 + 4 = b2 + 2 ORDER BY @@ -135,7 +135,7 @@ SELECT b2 FROM tab2 -RIGHT JOIN tab3 +ALL RIGHT JOIN tab3 ON a2 = a3 OR b2 = b3 ORDER BY @@ -147,7 +147,7 @@ SELECT b3 FROM tab2 -RIGHT JOIN tab3 +ALL RIGHT JOIN tab3 ON a2 = a3 OR b2 = b3 ORDER BY @@ -161,7 +161,7 @@ SELECT b3 FROM tab2 -RIGHT JOIN tab3 +ALL RIGHT JOIN tab3 ON a2 = a3 OR b2 = b3 ORDER BY @@ -173,7 +173,7 @@ ORDER BY SELECT a1 FROM tab1 -RIGHT JOIN tab2 +ALL RIGHT JOIN tab2 ON b1 + 1 = a2 + 1 OR a1 + 4 = b2 + 2 ORDER BY a1 ASC; @@ -183,7 +183,7 @@ SELECT b2 FROM tab1 -RIGHT JOIN tab2 +ALL RIGHT JOIN tab2 ON b1 + 1 = a2 + 1 OR a1 + 4 = b2 + 2 ORDER BY @@ -197,7 +197,7 @@ SELECT b2 FROM tab1 -RIGHT JOIN tab2 +ALL RIGHT JOIN tab2 ON b1 + 1 = a2 + 1 OR a1 + 4 = b2 + 2 ORDER BY @@ -211,7 +211,7 @@ SELECT b2 + 1 FROM tab1 -RIGHT JOIN tab2 +ALL RIGHT JOIN tab2 ON b1 + 1 = a2 + 1 OR a1 + 4 = b2 + 2 ORDER BY diff --git a/tests/clickhouse-reference/01660_join_or_any.sql.expected.ast.json b/tests/clickhouse-reference/01660_join_or_any.sql.expected.ast.json index 716a5b039..0e356ca25 100644 --- a/tests/clickhouse-reference/01660_join_or_any.sql.expected.ast.json +++ b/tests/clickhouse-reference/01660_join_or_any.sql.expected.ast.json @@ -287,7 +287,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -409,7 +410,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -543,7 +545,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -675,7 +678,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -793,7 +797,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -933,7 +938,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1090,7 +1096,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1191,7 +1198,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1283,7 +1291,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1387,7 +1396,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1529,7 +1539,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1647,7 +1658,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1787,7 +1799,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -1944,7 +1957,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -2052,7 +2066,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01660_join_or_any.sql.expected.formatted.sql b/tests/clickhouse-reference/01660_join_or_any.sql.expected.formatted.sql index 01047a508..30ce46012 100644 --- a/tests/clickhouse-reference/01660_join_or_any.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01660_join_or_any.sql.expected.formatted.sql @@ -49,7 +49,7 @@ SELECT b2 FROM tab2 -LEFT JOIN tab3 +ANY LEFT JOIN tab3 ON a2 = a3 OR b2 = b3 ORDER BY @@ -62,7 +62,7 @@ SELECT b3 FROM tab2 -LEFT JOIN tab3 +ANY LEFT JOIN tab3 ON a2 = a3 OR b2 = b3 ORDER BY @@ -77,7 +77,7 @@ SELECT b3 FROM tab2 -LEFT JOIN tab3 +ANY LEFT JOIN tab3 ON a2 = a3 OR b2 = b3 ORDER BY @@ -88,7 +88,7 @@ ORDER BY SELECT a1 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON b1 + 1 = a2 + 1 OR a1 + 4 = b2 + 2 ORDER BY a1 ASC; @@ -98,7 +98,7 @@ SELECT b2 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON b1 + 1 = a2 + 1 OR a1 + 4 = b2 + 2 ORDER BY @@ -112,7 +112,7 @@ SELECT b2 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON b1 + 1 = a2 + 1 OR a1 + 4 = b2 + 2 ORDER BY @@ -126,7 +126,7 @@ SELECT b2 + 1 FROM tab1 -LEFT JOIN tab2 +ANY LEFT JOIN tab2 ON b1 + 1 = a2 + 1 OR a1 + 4 = b2 + 2 ORDER BY @@ -138,7 +138,7 @@ SELECT b2 FROM tab2 -RIGHT JOIN tab3 +ANY RIGHT JOIN tab3 ON a2 = a3 OR b2 = b3 ORDER BY @@ -150,7 +150,7 @@ SELECT b3 FROM tab2 -RIGHT JOIN tab3 +ANY RIGHT JOIN tab3 ON a2 = a3 OR b2 = b3 ORDER BY @@ -164,7 +164,7 @@ SELECT b3 FROM tab2 -RIGHT JOIN tab3 +ANY RIGHT JOIN tab3 ON a2 = a3 OR b2 = b3 ORDER BY @@ -176,7 +176,7 @@ ORDER BY SELECT a1 FROM tab1 -RIGHT JOIN tab2 +ANY RIGHT JOIN tab2 ON b1 + 1 = a2 + 1 OR a1 + 4 = b2 + 2 ORDER BY a1 ASC; @@ -186,7 +186,7 @@ SELECT b2 FROM tab1 -RIGHT JOIN tab2 +ANY RIGHT JOIN tab2 ON b1 + 1 = a2 + 1 OR a1 + 4 = b2 + 2 ORDER BY @@ -200,7 +200,7 @@ SELECT b2 FROM tab1 -RIGHT JOIN tab2 +ANY RIGHT JOIN tab2 ON b1 + 1 = a2 + 1 OR a1 + 4 = b2 + 2 ORDER BY @@ -214,7 +214,7 @@ SELECT b2 + 1 FROM tab1 -RIGHT JOIN tab2 +ANY RIGHT JOIN tab2 ON b1 + 1 = a2 + 1 OR a1 + 4 = b2 + 2 ORDER BY @@ -226,7 +226,7 @@ SET any_join_distinct_right_table_keys = 1; SELECT b3 FROM tab2 -RIGHT JOIN tab3 +ANY RIGHT JOIN tab3 ON a2 = a3 OR b2 = b3 ORDER BY diff --git a/tests/clickhouse-reference/01660_join_or_inner.sql.expected.ast.json b/tests/clickhouse-reference/01660_join_or_inner.sql.expected.ast.json index b39f86522..0a8f51a49 100644 --- a/tests/clickhouse-reference/01660_join_or_inner.sql.expected.ast.json +++ b/tests/clickhouse-reference/01660_join_or_inner.sql.expected.ast.json @@ -265,7 +265,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -347,7 +348,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01660_join_or_inner.sql.expected.formatted.sql b/tests/clickhouse-reference/01660_join_or_inner.sql.expected.formatted.sql index 2d3603a60..021b69563 100644 --- a/tests/clickhouse-reference/01660_join_or_inner.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01660_join_or_inner.sql.expected.formatted.sql @@ -43,7 +43,7 @@ SELECT tab3.* FROM tab2 -INNER JOIN tab3 +ANY INNER JOIN tab3 ON a2 = a3 OR b2 = b3 ORDER BY `ALL` ASC; @@ -53,7 +53,7 @@ SELECT tab3.* FROM tab2 -INNER JOIN tab3 +ANY INNER JOIN tab3 ON b2 = b3 OR a2 = a3 ORDER BY `ALL` ASC; diff --git a/tests/clickhouse-reference/01660_join_or_subqueries.sql.expected.ast.json b/tests/clickhouse-reference/01660_join_or_subqueries.sql.expected.ast.json index 3dbb13474..2b6dbe9b0 100644 --- a/tests/clickhouse-reference/01660_join_or_subqueries.sql.expected.ast.json +++ b/tests/clickhouse-reference/01660_join_or_subqueries.sql.expected.ast.json @@ -217,7 +217,8 @@ } ] } - } + }, + "strictness": "ANY" } }, { @@ -301,7 +302,8 @@ } ] } - } + }, + "strictness": "ANY" } }, { @@ -382,7 +384,8 @@ } ] } - } + }, + "strictness": "ANY" } }, { @@ -512,7 +515,8 @@ } ] } - } + }, + "strictness": "ANY" } }, { @@ -642,7 +646,8 @@ } ] } - } + }, + "strictness": "ANY" } }, { diff --git a/tests/clickhouse-reference/01660_join_or_subqueries.sql.expected.formatted.sql b/tests/clickhouse-reference/01660_join_or_subqueries.sql.expected.formatted.sql index e52ce8529..571768100 100644 --- a/tests/clickhouse-reference/01660_join_or_subqueries.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01660_join_or_subqueries.sql.expected.formatted.sql @@ -31,7 +31,7 @@ INSERT INTO tab2; SELECT a1 FROM tab1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM tab2 ) @@ -41,7 +41,7 @@ LEFT JOIN ( SELECT a1 FROM tab1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT a2, b2 @@ -55,7 +55,7 @@ SELECT b1 FROM tab1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM tab2 ) @@ -69,7 +69,7 @@ SELECT b2 FROM tab1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT *, a2 AS z @@ -85,7 +85,7 @@ SELECT b2 FROM tab1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT *, a2 + 1 AS z diff --git a/tests/clickhouse-reference/01661_join_complex.sql.expected.ast.json b/tests/clickhouse-reference/01661_join_complex.sql.expected.ast.json index f5da8f53c..ccb9221d8 100644 --- a/tests/clickhouse-reference/01661_join_complex.sql.expected.ast.json +++ b/tests/clickhouse-reference/01661_join_complex.sql.expected.ast.json @@ -4918,7 +4918,8 @@ } ] } - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01661_join_complex.sql.expected.formatted.sql b/tests/clickhouse-reference/01661_join_complex.sql.expected.formatted.sql index eba0357d3..ee58d7b73 100644 --- a/tests/clickhouse-reference/01661_join_complex.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01661_join_complex.sql.expected.formatted.sql @@ -562,7 +562,7 @@ SELECT b3 FROM tab2 -LEFT JOIN tab3 +ANY LEFT JOIN tab3 ON a2 = a3 AND a2 + 1 = b3 + 0 OR b2 = b3 diff --git a/tests/clickhouse-reference/01669_join_or_duplicates.sql.expected.ast.json b/tests/clickhouse-reference/01669_join_or_duplicates.sql.expected.ast.json index 89796a045..11436e48a 100644 --- a/tests/clickhouse-reference/01669_join_or_duplicates.sql.expected.ast.json +++ b/tests/clickhouse-reference/01669_join_or_duplicates.sql.expected.ast.json @@ -734,7 +734,8 @@ } ] } - } + }, + "strictness": "ANY" } }, { @@ -980,7 +981,8 @@ } ] } - } + }, + "strictness": "ANY" } }, { diff --git a/tests/clickhouse-reference/01669_join_or_duplicates.sql.expected.formatted.sql b/tests/clickhouse-reference/01669_join_or_duplicates.sql.expected.formatted.sql index a3fc99e71..bf6db3da3 100644 --- a/tests/clickhouse-reference/01669_join_or_duplicates.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01669_join_or_duplicates.sql.expected.formatted.sql @@ -97,7 +97,7 @@ FROM 1 AS x, 2 AS y ) AS t1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 1 AS xx, 2 AS yy @@ -133,7 +133,7 @@ FROM 1 AS x, 2 AS y ) AS t1 -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT 1 AS xx, 2 AS yy diff --git a/tests/clickhouse-reference/01671_aggregate_function_group_bitmap_data.sql.expected.ast.json b/tests/clickhouse-reference/01671_aggregate_function_group_bitmap_data.sql.expected.ast.json index 551ed2214..f9fec4f4a 100644 --- a/tests/clickhouse-reference/01671_aggregate_function_group_bitmap_data.sql.expected.ast.json +++ b/tests/clickhouse-reference/01671_aggregate_function_group_bitmap_data.sql.expected.ast.json @@ -470,7 +470,8 @@ "columns": [ "city_id" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01671_aggregate_function_group_bitmap_data.sql.expected.formatted.sql b/tests/clickhouse-reference/01671_aggregate_function_group_bitmap_data.sql.expected.formatted.sql index d6c0fba3a..89bbf72fb 100644 --- a/tests/clickhouse-reference/01671_aggregate_function_group_bitmap_data.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01671_aggregate_function_group_bitmap_data.sql.expected.formatted.sql @@ -44,7 +44,7 @@ FROM uid, city_id ) AS js1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT city_id, groupBitmapState(uid) AS day_before diff --git a/tests/clickhouse-reference/01671_merge_join_and_constants.sql.expected.ast.json b/tests/clickhouse-reference/01671_merge_join_and_constants.sql.expected.ast.json index 956f0ba8e..fb9dffcb6 100644 --- a/tests/clickhouse-reference/01671_merge_join_and_constants.sql.expected.ast.json +++ b/tests/clickhouse-reference/01671_merge_join_and_constants.sql.expected.ast.json @@ -213,7 +213,8 @@ "a", "b" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -487,7 +488,8 @@ "parenthesized": true } } - } + }, + "strictness": "ANY" }, "settings": [ { diff --git a/tests/clickhouse-reference/01671_merge_join_and_constants.sql.expected.formatted.sql b/tests/clickhouse-reference/01671_merge_join_and_constants.sql.expected.formatted.sql index 7bab3cb91..9232a7699 100644 --- a/tests/clickhouse-reference/01671_merge_join_and_constants.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01671_merge_join_and_constants.sql.expected.formatted.sql @@ -32,7 +32,7 @@ SET join_algorithm = 'partial_merge'; SELECT * FROM table1 AS t1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT *, '0.10', @@ -59,7 +59,7 @@ FROM toLowCardinality(toNullable(dummy)) AS val FROM `system`.one ) AS s1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(dummy) AS rval FROM `system`.one ) AS s2 diff --git a/tests/clickhouse-reference/01680_date_time_add_ubsan.sql.expected.ast.json b/tests/clickhouse-reference/01680_date_time_add_ubsan.sql.expected.ast.json index cba2e2ef8..266c9b687 100644 --- a/tests/clickhouse-reference/01680_date_time_add_ubsan.sql.expected.ast.json +++ b/tests/clickhouse-reference/01680_date_time_add_ubsan.sql.expected.ast.json @@ -114,7 +114,8 @@ "result" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ], "format": "Null", @@ -242,7 +243,8 @@ "result" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ], "format": "Null" diff --git a/tests/clickhouse-reference/01680_date_time_add_ubsan.sql.expected.formatted.sql b/tests/clickhouse-reference/01680_date_time_add_ubsan.sql.expected.formatted.sql index 06efedb9d..d0e64ad09 100644 --- a/tests/clickhouse-reference/01680_date_time_add_ubsan.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01680_date_time_add_ubsan.sql.expected.formatted.sql @@ -4,7 +4,7 @@ FROM ( FROM `system`.numbers LIMIT 1048576 ) -ORDER BY result DESC +ORDER BY result DESC NULLS FIRST FORMAT Null; -- { serverError DECIMAL_OVERFLOW } SELECT DISTINCT result @@ -13,7 +13,7 @@ FROM ( FROM `system`.numbers LIMIT 1048576 ) -ORDER BY result DESC +ORDER BY result DESC NULLS FIRST FORMAT Null; SELECT round(round(round(round(round(100)), round(round(round(round(NULL), round(65535)), like(toTypeName(now() + 9223372036854775807), 'DateTime%DateTime%DateTime%DateTime%'), round(-2)), 255), round(NULL)))); \ No newline at end of file diff --git a/tests/clickhouse-reference/01710_minmax_count_projection.sql.expected.ast.json b/tests/clickhouse-reference/01710_minmax_count_projection.sql.expected.ast.json index ff4ecb146..9eb1ab4dc 100644 --- a/tests/clickhouse-reference/01710_minmax_count_projection.sql.expected.ast.json +++ b/tests/clickhouse-reference/01710_minmax_count_projection.sql.expected.ast.json @@ -780,7 +780,8 @@ "_partition_id" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ], "leadingComments": [ diff --git a/tests/clickhouse-reference/01710_minmax_count_projection.sql.expected.formatted.sql b/tests/clickhouse-reference/01710_minmax_count_projection.sql.expected.formatted.sql index 5e475db78..db6d556da 100644 --- a/tests/clickhouse-reference/01710_minmax_count_projection.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01710_minmax_count_projection.sql.expected.formatted.sql @@ -75,7 +75,7 @@ WHERE (_partition_value.1) = 0 GROUP BY ignore(bitTest(ignore(NULL), 0), NULL, (_partition_value.1) = 7, '10.25', bitTest(NULL, 0), NULL, ignore(ignore(-2147483647, NULL)), 1024), _partition_id -ORDER BY _partition_id ASC; +ORDER BY _partition_id ASC NULLS FIRST; DROP TABLE d; diff --git a/tests/clickhouse-reference/01710_projection_with_joins.sql.expected.ast.json b/tests/clickhouse-reference/01710_projection_with_joins.sql.expected.ast.json index c33dbeb1b..0ae154341 100644 --- a/tests/clickhouse-reference/01710_projection_with_joins.sql.expected.ast.json +++ b/tests/clickhouse-reference/01710_projection_with_joins.sql.expected.ast.json @@ -341,7 +341,8 @@ "columns": [ "alias1" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -412,7 +413,8 @@ "columns": [ "id1" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -482,7 +484,8 @@ "columns": [ "id1" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -745,7 +748,8 @@ "columns": [ "alias1" ] - } + }, + "strictness": "ALL" }, "where": { "kind": "inExpr", diff --git a/tests/clickhouse-reference/01710_projection_with_joins.sql.expected.formatted.sql b/tests/clickhouse-reference/01710_projection_with_joins.sql.expected.formatted.sql index bd7bf4e3c..4f0a506a3 100644 --- a/tests/clickhouse-reference/01710_projection_with_joins.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01710_projection_with_joins.sql.expected.formatted.sql @@ -52,7 +52,7 @@ FROM id1 AS alias1 FROM mt ) AS l -INNER JOIN ( +ALL INNER JOIN ( SELECT id2 AS alias1 FROM mt ) AS t @@ -63,7 +63,7 @@ SETTINGS optimize_use_projections = 1; SELECT id1 FROM mt -INNER JOIN ( +ALL INNER JOIN ( SELECT id2 AS id1 FROM mt ) AS t @@ -74,7 +74,7 @@ SETTINGS optimize_use_projections = 1; SELECT id2 AS id1 FROM mt -INNER JOIN ( +ALL INNER JOIN ( SELECT id1 FROM mt ) AS t @@ -112,7 +112,7 @@ FROM id1 AS alias1 FROM j ) AS l -INNER JOIN ( +ALL INNER JOIN ( SELECT id2, id2 AS alias1 diff --git a/tests/clickhouse-reference/01710_projections.sql.expected.ast.json b/tests/clickhouse-reference/01710_projections.sql.expected.ast.json index 0db66d3e1..8bb83cdc2 100644 --- a/tests/clickhouse-reference/01710_projections.sql.expected.ast.json +++ b/tests/clickhouse-reference/01710_projections.sql.expected.ast.json @@ -2262,7 +2262,8 @@ ] } }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -2271,7 +2272,8 @@ "type": "UInt64", "value": "1048576" }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ] }, diff --git a/tests/clickhouse-reference/01710_projections.sql.expected.formatted.sql b/tests/clickhouse-reference/01710_projections.sql.expected.formatted.sql index 8b20af9e1..62273858b 100644 --- a/tests/clickhouse-reference/01710_projections.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01710_projections.sql.expected.formatted.sql @@ -183,8 +183,8 @@ PREWHERE domain_alias = 1. WHERE domain = NULL GROUP BY -9223372036854775808 ORDER BY - countIf(first_time = 0) / count(-2147483649) DESC, - 1048576 DESC; + countIf(first_time = 0) / count(-2147483649) DESC NULLS LAST, + 1048576 DESC NULLS LAST; DROP TABLE IF EXISTS projection_without_key; diff --git a/tests/clickhouse-reference/01710_projections_and_duplicate_columms.sql.expected.ast.json b/tests/clickhouse-reference/01710_projections_and_duplicate_columms.sql.expected.ast.json index 093d125b9..f630dfb50 100644 --- a/tests/clickhouse-reference/01710_projections_and_duplicate_columms.sql.expected.ast.json +++ b/tests/clickhouse-reference/01710_projections_and_duplicate_columms.sql.expected.ast.json @@ -1017,7 +1017,8 @@ } ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -1026,7 +1027,8 @@ "type": "Float64", "value": "100000000000000000000." }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ], "format": "Null" diff --git a/tests/clickhouse-reference/01710_projections_and_duplicate_columms.sql.expected.formatted.sql b/tests/clickhouse-reference/01710_projections_and_duplicate_columms.sql.expected.formatted.sql index 41078cfbd..511eaa0e7 100644 --- a/tests/clickhouse-reference/01710_projections_and_duplicate_columms.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01710_projections_and_duplicate_columms.sql.expected.formatted.sql @@ -76,8 +76,8 @@ GROUP BY dt_m WITH ROLLUP WITH TOTALS ORDER BY - count(retry_count / duration) ASC, - 100000000000000000000. ASC + count(retry_count / duration) ASC NULLS LAST, + 100000000000000000000. ASC NULLS FIRST FORMAT Null; DROP TABLE projection_test__fuzz_0; \ No newline at end of file diff --git a/tests/clickhouse-reference/01747_join_view_filter_dictionary.sql.expected.ast.json b/tests/clickhouse-reference/01747_join_view_filter_dictionary.sql.expected.ast.json index 4fc8f829a..03a4a8929 100644 --- a/tests/clickhouse-reference/01747_join_view_filter_dictionary.sql.expected.ast.json +++ b/tests/clickhouse-reference/01747_join_view_filter_dictionary.sql.expected.ast.json @@ -420,7 +420,8 @@ ] } } - } + }, + "strictness": "ANY" } } }, diff --git a/tests/clickhouse-reference/01747_join_view_filter_dictionary.sql.expected.formatted.sql b/tests/clickhouse-reference/01747_join_view_filter_dictionary.sql.expected.formatted.sql index 676415b2f..67fdf3fe2 100644 --- a/tests/clickhouse-reference/01747_join_view_filter_dictionary.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01747_join_view_filter_dictionary.sql.expected.formatted.sql @@ -60,7 +60,7 @@ SELECT rates01747.rates01747 AS rates01747 FROM summing_table01747 -LEFT JOIN rates01747 +ANY LEFT JOIN rates01747 ON rates01747.from_currency = summing_table01747.currency; SELECT * diff --git a/tests/clickhouse-reference/01763_filter_push_down_bugs.sql.expected.ast.json b/tests/clickhouse-reference/01763_filter_push_down_bugs.sql.expected.ast.json index f73b7a726..40a9edafa 100644 --- a/tests/clickhouse-reference/01763_filter_push_down_bugs.sql.expected.ast.json +++ b/tests/clickhouse-reference/01763_filter_push_down_bugs.sql.expected.ast.json @@ -1621,7 +1621,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "where": { "kind": "binaryExpr", diff --git a/tests/clickhouse-reference/01763_filter_push_down_bugs.sql.expected.formatted.sql b/tests/clickhouse-reference/01763_filter_push_down_bugs.sql.expected.formatted.sql index 5cefa381f..63534fa6b 100644 --- a/tests/clickhouse-reference/01763_filter_push_down_bugs.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01763_filter_push_down_bugs.sql.expected.formatted.sql @@ -194,7 +194,7 @@ FROM SELECT * FROM Values('id UInt64, t UInt64', (1, 3)) ) AS t1 -INNER JOIN ( +ASOF INNER JOIN ( SELECT * FROM Values('id UInt64, t UInt64', (1, 1), (1, 2), (1, 3), (1, 4), (1, 5)) ) AS t2 diff --git a/tests/clickhouse-reference/01785_pmj_lc_bug.sql.expected.ast.json b/tests/clickhouse-reference/01785_pmj_lc_bug.sql.expected.ast.json index f4ef12ffa..13cef9b08 100644 --- a/tests/clickhouse-reference/01785_pmj_lc_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/01785_pmj_lc_bug.sql.expected.ast.json @@ -215,7 +215,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -276,7 +277,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -337,7 +339,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -398,7 +401,8 @@ ] } } - } + }, + "strictness": "ALL" } }, { diff --git a/tests/clickhouse-reference/01785_pmj_lc_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/01785_pmj_lc_bug.sql.expected.formatted.sql index 1f7df8228..76c7dc9fb 100644 --- a/tests/clickhouse-reference/01785_pmj_lc_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01785_pmj_lc_bug.sql.expected.formatted.sql @@ -25,25 +25,25 @@ LIMIT 1025; SELECT 1025 == count(n) FROM foo_lc AS t1 -LEFT JOIN foo_lc AS t2 +ANY LEFT JOIN foo_lc AS t2 ON t1.n == t2.n; SELECT 1025 == count(n) FROM foo AS t1 -LEFT JOIN foo_lc AS t2 +ANY LEFT JOIN foo_lc AS t2 ON t1.n == t2.n; SELECT 1025 == count(n) FROM foo_lc AS t1 -LEFT JOIN foo AS t2 +ANY LEFT JOIN foo AS t2 ON t1.n == t2.n; SELECT 1025 == count(n) FROM foo_lc AS t1 -LEFT JOIN foo_lc AS t2 +ALL LEFT JOIN foo_lc AS t2 ON t1.n == t2.n; DROP TABLE foo; diff --git a/tests/clickhouse-reference/01868_order_by_fill_with_datetime64.sql.expected.ast.json b/tests/clickhouse-reference/01868_order_by_fill_with_datetime64.sql.expected.ast.json index 784dc125f..e6f2c92ab 100644 --- a/tests/clickhouse-reference/01868_order_by_fill_with_datetime64.sql.expected.ast.json +++ b/tests/clickhouse-reference/01868_order_by_fill_with_datetime64.sql.expected.ast.json @@ -113,6 +113,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toDateTime64", @@ -246,6 +247,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toDateTime64", diff --git a/tests/clickhouse-reference/01883_grouping_sets_crash.sql.expected.ast.json b/tests/clickhouse-reference/01883_grouping_sets_crash.sql.expected.ast.json index 5f445b0df..5217af470 100644 --- a/tests/clickhouse-reference/01883_grouping_sets_crash.sql.expected.ast.json +++ b/tests/clickhouse-reference/01883_grouping_sets_crash.sql.expected.ast.json @@ -518,7 +518,8 @@ "fact_1_id" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -528,7 +529,8 @@ "fact_2_id" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -641,7 +643,8 @@ "fact_1_id" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -651,7 +654,8 @@ "fact_1_id" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -671,7 +675,8 @@ "fact_3_id" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -795,7 +800,8 @@ "type": "NULL", "value": "NULL" }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -815,7 +821,8 @@ "fact_3_id" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -824,7 +831,8 @@ "type": "String", "value": "wo\\0ldworldwo\\0ldworld" }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -833,7 +841,8 @@ "type": "String", "value": "w\\0\\0ldworldwo\\0l\\0world" }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -851,7 +860,8 @@ "type": "NULL", "value": "NULL" }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -861,7 +871,8 @@ "fact_4_id" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ], "leadingComments": [ @@ -932,7 +943,8 @@ "fact_3_id" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, diff --git a/tests/clickhouse-reference/01883_grouping_sets_crash.sql.expected.formatted.sql b/tests/clickhouse-reference/01883_grouping_sets_crash.sql.expected.formatted.sql index 7e9070bf5..554766f18 100644 --- a/tests/clickhouse-reference/01883_grouping_sets_crash.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01883_grouping_sets_crash.sql.expected.formatted.sql @@ -36,8 +36,8 @@ FROM grouping_sets GROUP BY GROUPING SETS ((fact_1_id, fact_2_id), ((-9223372036854775808, NULL, (tuple(1.), (tuple(1.), 1048576), 65535))), ((tuple(3.4028234663852886e38), (tuple(1024), -2147483647), NULL)), (fact_3_id, fact_4_id)) ORDER BY (NULL, ('256', (tuple(NULL), NULL), NULL, NULL), NULL) ASC, - fact_1_id DESC, - fact_2_id DESC, + fact_1_id DESC NULLS FIRST, + fact_2_id DESC NULLS FIRST, fact_4_id ASC; SELECT @@ -48,10 +48,10 @@ SELECT FROM grouping_sets GROUP BY GROUPING SETS ((sales_value), (fact_1_id, fact_2_id), ('wo\0ldworldwo\0ldworld'), (fact_3_id, fact_4_id)) ORDER BY - fact_1_id DESC, - fact_1_id DESC, + fact_1_id DESC NULLS LAST, + fact_1_id DESC NULLS FIRST, fact_2_id ASC, - fact_3_id DESC, + fact_3_id DESC NULLS FIRST, fact_4_id ASC; SELECT fact_3_id @@ -65,19 +65,19 @@ FROM grouping_sets GROUP BY GROUPING SETS ((fact_4_id), (NULL), (fact_3_id, fact_4_id)) ORDER BY NULL ASC, - NULL DESC, + NULL DESC NULLS FIRST, fact_3_id ASC, - fact_3_id ASC, - 'wo\0ldworldwo\0ldworld' ASC, - 'w\0\0ldworldwo\0l\0world' DESC, + fact_3_id ASC NULLS LAST, + 'wo\0ldworldwo\0ldworld' ASC NULLS LAST, + 'w\0\0ldworldwo\0l\0world' DESC NULLS FIRST, 'wo\0ldworldwo\0ldworld' ASC, - NULL ASC, - fact_4_id DESC; + NULL ASC NULLS FIRST, + fact_4_id DESC NULLS LAST; SELECT fact_3_id FROM grouping_sets GROUP BY GROUPING SETS (('wo\0ldworldwo\0ldworldwo\0ldworldwo\0ldworldwo\0ldworldwo\0ldworldwo\0ldworldwo\0ldworld'), (NULL), (fact_4_id), (fact_3_id, fact_4_id)) -ORDER BY fact_3_id ASC; +ORDER BY fact_3_id ASC NULLS FIRST; SELECT fact_3_id, diff --git a/tests/clickhouse-reference/01890_cross_join_explain_crash.sql.expected.ast.json b/tests/clickhouse-reference/01890_cross_join_explain_crash.sql.expected.ast.json index f4b5d8b35..b850750aa 100644 --- a/tests/clickhouse-reference/01890_cross_join_explain_crash.sql.expected.ast.json +++ b/tests/clickhouse-reference/01890_cross_join_explain_crash.sql.expected.ast.json @@ -49,6 +49,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -65,6 +66,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -104,6 +106,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -121,6 +124,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -162,6 +166,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -178,6 +183,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -219,6 +225,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -236,6 +243,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { diff --git a/tests/clickhouse-reference/01890_cross_join_explain_crash.sql.expected.formatted.sql b/tests/clickhouse-reference/01890_cross_join_explain_crash.sql.expected.formatted.sql index b34040cfb..b0ffbfdb1 100644 --- a/tests/clickhouse-reference/01890_cross_join_explain_crash.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01890_cross_join_explain_crash.sql.expected.formatted.sql @@ -7,10 +7,10 @@ FROM ( SELECT 1 ) -CROSS JOIN ( +, ( SELECT 1 ) -CROSS JOIN ( +, ( SELECT 1 ); @@ -19,10 +19,10 @@ FROM ( SELECT 2 ) -CROSS JOIN ( +, ( SELECT 1 ) AS a -CROSS JOIN ( +, ( SELECT 1 ) AS b; @@ -31,10 +31,10 @@ FROM ( SELECT 1 ) AS a -CROSS JOIN ( +, ( SELECT 2 ) -CROSS JOIN ( +, ( SELECT 1 ) AS b; @@ -43,9 +43,9 @@ FROM ( SELECT 1 ) AS a -CROSS JOIN ( +, ( SELECT 1 ) AS b -CROSS JOIN ( +, ( SELECT 2 ); \ No newline at end of file diff --git a/tests/clickhouse-reference/01911_logical_error_minus.sql.expected.ast.json b/tests/clickhouse-reference/01911_logical_error_minus.sql.expected.ast.json index c1877c104..d46fff01d 100644 --- a/tests/clickhouse-reference/01911_logical_error_minus.sql.expected.ast.json +++ b/tests/clickhouse-reference/01911_logical_error_minus.sql.expected.ast.json @@ -711,6 +711,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "codecTest", @@ -941,6 +942,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "codecTest", diff --git a/tests/clickhouse-reference/01911_logical_error_minus.sql.expected.formatted.sql b/tests/clickhouse-reference/01911_logical_error_minus.sql.expected.formatted.sql index 59b44ef9f..7e27a12e5 100644 --- a/tests/clickhouse-reference/01911_logical_error_minus.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01911_logical_error_minus.sql.expected.formatted.sql @@ -64,7 +64,7 @@ SELECT c2.key FROM codecTest AS c1 -CROSS JOIN codecTest AS c2 +, codecTest AS c2 WHERE ignore(IF(255, -2, NULL), arrayJoin([65537]), IF(3, 1024, 9223372036854775807)) AND IF(NULL, 256, NULL) AND (IF(NULL, '1048576', NULL) = (c1.key - NULL)) @@ -81,7 +81,7 @@ SELECT c2.ref_valueF64 FROM codecTest AS c1 -CROSS JOIN codecTest AS c2 +, codecTest AS c2 WHERE (dF64 != 3) AND c1.valueF64 != 0 AND (c2.key = (c1.key - 1048576)) diff --git a/tests/clickhouse-reference/01912_bad_cast_join_fuzz.sql.expected.ast.json b/tests/clickhouse-reference/01912_bad_cast_join_fuzz.sql.expected.ast.json index e9f13f4f4..93cc5d3d1 100644 --- a/tests/clickhouse-reference/01912_bad_cast_join_fuzz.sql.expected.ast.json +++ b/tests/clickhouse-reference/01912_bad_cast_join_fuzz.sql.expected.ast.json @@ -148,7 +148,8 @@ "parenthesized": true } } - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01912_bad_cast_join_fuzz.sql.expected.formatted.sql b/tests/clickhouse-reference/01912_bad_cast_join_fuzz.sql.expected.formatted.sql index 83439d8cf..26d2b7c3d 100644 --- a/tests/clickhouse-reference/01912_bad_cast_join_fuzz.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01912_bad_cast_join_fuzz.sql.expected.formatted.sql @@ -7,7 +7,7 @@ FROM FROM `system`.numbers LIMIT 10 ) AS s1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(toNullable(number)) AS r FROM `system`.numbers LIMIT 7 diff --git a/tests/clickhouse-reference/01916_multiple_join_view_optimize_predicate_chertus.sql.expected.ast.json b/tests/clickhouse-reference/01916_multiple_join_view_optimize_predicate_chertus.sql.expected.ast.json index 9c3cf6c97..fa9b82b21 100644 --- a/tests/clickhouse-reference/01916_multiple_join_view_optimize_predicate_chertus.sql.expected.ast.json +++ b/tests/clickhouse-reference/01916_multiple_join_view_optimize_predicate_chertus.sql.expected.ast.json @@ -132,7 +132,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -192,7 +193,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01916_multiple_join_view_optimize_predicate_chertus.sql.expected.formatted.sql b/tests/clickhouse-reference/01916_multiple_join_view_optimize_predicate_chertus.sql.expected.formatted.sql index 9b276475d..927f81b0d 100644 --- a/tests/clickhouse-reference/01916_multiple_join_view_optimize_predicate_chertus.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01916_multiple_join_view_optimize_predicate_chertus.sql.expected.formatted.sql @@ -23,7 +23,7 @@ INSERT INTO j; SELECT * FROM a -LEFT JOIN j +ANY LEFT JOIN j USING (id) ORDER BY a.id ASC, @@ -33,7 +33,7 @@ SETTINGS enable_optimize_predicate_expression = 1; SELECT * FROM a -LEFT JOIN j +ANY LEFT JOIN j USING (id) ORDER BY a.id ASC, diff --git a/tests/clickhouse-reference/01921_with_fill_with_totals.sql.expected.ast.json b/tests/clickhouse-reference/01921_with_fill_with_totals.sql.expected.ast.json index 246d8c9d6..3590e6702 100644 --- a/tests/clickhouse-reference/01921_with_fill_with_totals.sql.expected.ast.json +++ b/tests/clickhouse-reference/01921_with_fill_with_totals.sql.expected.ast.json @@ -78,6 +78,7 @@ ] }, "direction": "DESC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -187,6 +188,7 @@ ] }, "direction": "DESC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", diff --git a/tests/clickhouse-reference/01925_join_materialized_columns.sql.expected.ast.json b/tests/clickhouse-reference/01925_join_materialized_columns.sql.expected.ast.json index d1419223e..d1eec2ab5 100644 --- a/tests/clickhouse-reference/01925_join_materialized_columns.sql.expected.ast.json +++ b/tests/clickhouse-reference/01925_join_materialized_columns.sql.expected.ast.json @@ -559,7 +559,8 @@ ] } } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -609,7 +610,8 @@ "columns": [ "dt" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -669,7 +671,8 @@ "columns": [ "dt" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/01925_join_materialized_columns.sql.expected.formatted.sql b/tests/clickhouse-reference/01925_join_materialized_columns.sql.expected.formatted.sql index d93f661ef..83315487b 100644 --- a/tests/clickhouse-reference/01925_join_materialized_columns.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01925_join_materialized_columns.sql.expected.formatted.sql @@ -64,7 +64,7 @@ ORDER BY t1.dt ASC; SELECT * FROM t1 -INNER JOIN t2 +ALL INNER JOIN t2 ON t1.dt = t2.dt ORDER BY t1.time ASC, @@ -73,7 +73,7 @@ ORDER BY SELECT * FROM t1 -INNER JOIN t2 +ALL INNER JOIN t2 USING (dt) ORDER BY t1.time ASC, @@ -83,7 +83,7 @@ SETTINGS enable_analyzer = 0; SELECT * FROM t1 -INNER JOIN t2 +ALL INNER JOIN t2 USING (dt) ORDER BY t1.time ASC, diff --git a/tests/clickhouse-reference/01936_empty_function_support_uuid.sql.expected.ast.json b/tests/clickhouse-reference/01936_empty_function_support_uuid.sql.expected.ast.json index be2491899..a576393a5 100644 --- a/tests/clickhouse-reference/01936_empty_function_support_uuid.sql.expected.ast.json +++ b/tests/clickhouse-reference/01936_empty_function_support_uuid.sql.expected.ast.json @@ -345,7 +345,8 @@ "columns": [ "user_id" ] - } + }, + "strictness": "ALL" } }, { diff --git a/tests/clickhouse-reference/01936_empty_function_support_uuid.sql.expected.formatted.sql b/tests/clickhouse-reference/01936_empty_function_support_uuid.sql.expected.formatted.sql index b62798068..0e9e9e346 100644 --- a/tests/clickhouse-reference/01936_empty_function_support_uuid.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/01936_empty_function_support_uuid.sql.expected.formatted.sql @@ -44,7 +44,7 @@ FROM SELECT * FROM users ) AS t1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT * FROM orders ) AS t2 diff --git a/tests/clickhouse-reference/02000_join_on_const.sql.expected.ast.json b/tests/clickhouse-reference/02000_join_on_const.sql.expected.ast.json index d709b4d68..34166f07f 100644 --- a/tests/clickhouse-reference/02000_join_on_const.sql.expected.ast.json +++ b/tests/clickhouse-reference/02000_join_on_const.sql.expected.ast.json @@ -1277,7 +1277,8 @@ "id" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -1339,7 +1340,8 @@ "id" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -1401,7 +1403,8 @@ "id" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -1463,7 +1466,8 @@ "id" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -3494,7 +3498,8 @@ "type": "NULL", "value": "NULL" } - } + }, + "strictness": "SEMI" } }, { @@ -3561,7 +3566,8 @@ "type": "NULL", "value": "NULL" } - } + }, + "strictness": "ANTI" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/02000_join_on_const.sql.expected.formatted.sql b/tests/clickhouse-reference/02000_join_on_const.sql.expected.formatted.sql index af5a51cf6..0c42ab4a8 100644 --- a/tests/clickhouse-reference/02000_join_on_const.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02000_join_on_const.sql.expected.formatted.sql @@ -151,7 +151,7 @@ FROM INNER JOIN t2 ON NULL ORDER BY - t1.id ASC, + t1.id ASC NULLS FIRST, t2.id ASC SETTINGS join_use_nulls = 1; @@ -161,7 +161,7 @@ FROM LEFT JOIN t2 ON NULL ORDER BY - t1.id ASC, + t1.id ASC NULLS FIRST, t2.id ASC SETTINGS join_use_nulls = 1; @@ -171,7 +171,7 @@ FROM RIGHT JOIN t2 ON NULL ORDER BY - t1.id ASC, + t1.id ASC NULLS FIRST, t2.id ASC SETTINGS join_use_nulls = 1; @@ -181,7 +181,7 @@ FROM FULL JOIN t2 ON NULL ORDER BY - t1.id ASC, + t1.id ASC NULLS FIRST, t2.id ASC SETTINGS join_use_nulls = 1; @@ -444,7 +444,7 @@ FROM ( SELECT 1 AS a ) AS t1 -INNER JOIN ( +SEMI INNER JOIN ( SELECT ('b', 256) AS b ) AS t2 ON NULL; @@ -454,7 +454,7 @@ FROM ( SELECT 1 AS a ) AS t1 -INNER JOIN ( +ANTI INNER JOIN ( SELECT ('b', 256) AS b ) AS t2 ON NULL diff --git a/tests/clickhouse-reference/02004_intersect_except_const_column.sql.expected.ast.json b/tests/clickhouse-reference/02004_intersect_except_const_column.sql.expected.ast.json index 7ee8ccf7a..95bd5b360 100644 --- a/tests/clickhouse-reference/02004_intersect_except_const_column.sql.expected.ast.json +++ b/tests/clickhouse-reference/02004_intersect_except_const_column.sql.expected.ast.json @@ -22,6 +22,7 @@ } ] }, + "distinct": true, "leadingComments": [ "-- { echo }", "-- Test: crash the server" @@ -248,7 +249,8 @@ } ] } - } + }, + "distinct": true }, { "kind": "intersect", @@ -306,7 +308,8 @@ } ] } - } + }, + "distinct": true }, { "kind": "intersect", @@ -352,7 +355,8 @@ } ] } - } + }, + "distinct": true }, { "kind": "intersect", @@ -551,7 +555,8 @@ } ] } - } + }, + "distinct": true }, { "kind": "intersect", @@ -609,7 +614,8 @@ } ] } - } + }, + "distinct": true }, { "kind": "intersect", @@ -655,6 +661,7 @@ } ] } - } + }, + "distinct": true } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/02004_intersect_except_const_column.sql.expected.formatted.sql b/tests/clickhouse-reference/02004_intersect_except_const_column.sql.expected.formatted.sql index 9fab54a36..9c1caec46 100644 --- a/tests/clickhouse-reference/02004_intersect_except_const_column.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02004_intersect_except_const_column.sql.expected.formatted.sql @@ -1,7 +1,7 @@ -- { echo } -- Test: crash the server SELECT 'fooooo' -INTERSECT +INTERSECT DISTINCT SELECT 'fooooo'; SELECT 'fooooo' @@ -29,19 +29,19 @@ FROM numbers(10); SELECT 1 FROM numbers(10) -INTERSECT +INTERSECT DISTINCT SELECT 1 FROM numbers(10); SELECT toString(1) FROM numbers(10) -INTERSECT +INTERSECT DISTINCT SELECT toString(1) FROM numbers(10); SELECT '1' FROM numbers(10) -INTERSECT +INTERSECT DISTINCT SELECT '1' FROM numbers(10); @@ -66,18 +66,18 @@ FROM numbers(5); SELECT 2 FROM numbers(10) -EXCEPT +EXCEPT DISTINCT SELECT 1 FROM numbers(5); SELECT toString(2) FROM numbers(10) -EXCEPT +EXCEPT DISTINCT SELECT toString(1) FROM numbers(5); SELECT '2' FROM numbers(10) -EXCEPT +EXCEPT DISTINCT SELECT '1' FROM numbers(5); \ No newline at end of file diff --git a/tests/clickhouse-reference/02007_join_use_nulls.sql.expected.ast.json b/tests/clickhouse-reference/02007_join_use_nulls.sql.expected.ast.json index a1e4d52b6..7577a236e 100644 --- a/tests/clickhouse-reference/02007_join_use_nulls.sql.expected.ast.json +++ b/tests/clickhouse-reference/02007_join_use_nulls.sql.expected.ast.json @@ -87,7 +87,8 @@ "columns": [ "id" ] - } + }, + "strictness": "SEMI" } }, { @@ -212,7 +213,8 @@ "columns": [ "id" ] - } + }, + "strictness": "SEMI" } }, { @@ -361,7 +363,8 @@ "columns": [ "id" ] - } + }, + "strictness": "SEMI" } }, { @@ -510,7 +513,8 @@ "columns": [ "id" ] - } + }, + "strictness": "SEMI" } }, { @@ -655,7 +659,8 @@ "columns": [ "id" ] - } + }, + "strictness": "SEMI" } }, { @@ -824,7 +829,8 @@ "columns": [ "id" ] - } + }, + "strictness": "SEMI" } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/02007_join_use_nulls.sql.expected.formatted.sql b/tests/clickhouse-reference/02007_join_use_nulls.sql.expected.formatted.sql index adaaa44bd..d3f1154fc 100644 --- a/tests/clickhouse-reference/02007_join_use_nulls.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02007_join_use_nulls.sql.expected.formatted.sql @@ -9,7 +9,7 @@ FROM 1 AS id, 2 AS value ) AS a -LEFT JOIN ( +SEMI LEFT JOIN ( SELECT 1 AS id, 3 AS values @@ -29,7 +29,7 @@ FROM 1 AS id, 2 AS value ) AS a -LEFT JOIN ( +SEMI LEFT JOIN ( SELECT 1 AS id, 3 AS values @@ -49,7 +49,7 @@ FROM toLowCardinality(1) AS id, toLowCardinality(2) AS value ) AS a -LEFT JOIN ( +SEMI LEFT JOIN ( SELECT toLowCardinality(1) AS id, toLowCardinality(3) AS values @@ -69,7 +69,7 @@ FROM toLowCardinality(1) AS id, toLowCardinality(2) AS value ) AS a -LEFT JOIN ( +SEMI LEFT JOIN ( SELECT toLowCardinality(1) AS id, toLowCardinality(3) AS values @@ -91,7 +91,7 @@ FROM 1 AS id, 2 AS value ) AS a -LEFT JOIN ( +SEMI LEFT JOIN ( SELECT 1 AS id, 3 AS values @@ -113,7 +113,7 @@ FROM toLowCardinality(1) AS id, toLowCardinality(2) AS value ) AS a -LEFT JOIN ( +SEMI LEFT JOIN ( SELECT toLowCardinality(1) AS id, toLowCardinality(3) AS values diff --git a/tests/clickhouse-reference/02013_lc_nullable_and_infinity.sql.expected.ast.json b/tests/clickhouse-reference/02013_lc_nullable_and_infinity.sql.expected.ast.json index b438600de..ec8bd5bc5 100644 --- a/tests/clickhouse-reference/02013_lc_nullable_and_infinity.sql.expected.ast.json +++ b/tests/clickhouse-reference/02013_lc_nullable_and_infinity.sql.expected.ast.json @@ -170,7 +170,8 @@ "parenthesized": true } } - } + }, + "strictness": "ANY" } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/02013_lc_nullable_and_infinity.sql.expected.formatted.sql b/tests/clickhouse-reference/02013_lc_nullable_and_infinity.sql.expected.formatted.sql index a478bf192..7d5fcbe3e 100644 --- a/tests/clickhouse-reference/02013_lc_nullable_and_infinity.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02013_lc_nullable_and_infinity.sql.expected.formatted.sql @@ -6,7 +6,7 @@ FROM SELECT dummy AS val FROM `system`.one ) AS s1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(dummy) AS rval FROM `system`.one ) AS s2 diff --git a/tests/clickhouse-reference/02015_order_by_with_fill_misoptimization.sql.expected.ast.json b/tests/clickhouse-reference/02015_order_by_with_fill_misoptimization.sql.expected.ast.json index 2db455cf0..f516ebef0 100644 --- a/tests/clickhouse-reference/02015_order_by_with_fill_misoptimization.sql.expected.ast.json +++ b/tests/clickhouse-reference/02015_order_by_with_fill_misoptimization.sql.expected.ast.json @@ -43,6 +43,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", diff --git a/tests/clickhouse-reference/02016_order_by_with_fill_monotonic_functions_removal.sql.expected.ast.json b/tests/clickhouse-reference/02016_order_by_with_fill_monotonic_functions_removal.sql.expected.ast.json index 76a7d2954..cc179c389 100644 --- a/tests/clickhouse-reference/02016_order_by_with_fill_monotonic_functions_removal.sql.expected.ast.json +++ b/tests/clickhouse-reference/02016_order_by_with_fill_monotonic_functions_removal.sql.expected.ast.json @@ -52,6 +52,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "functionCall", "name": "toDateTime", diff --git a/tests/clickhouse-reference/02017_order_by_with_fill_redundant_functions.sql.expected.ast.json b/tests/clickhouse-reference/02017_order_by_with_fill_redundant_functions.sql.expected.ast.json index bb8efa57e..9c877d077 100644 --- a/tests/clickhouse-reference/02017_order_by_with_fill_redundant_functions.sql.expected.ast.json +++ b/tests/clickhouse-reference/02017_order_by_with_fill_redundant_functions.sql.expected.ast.json @@ -52,6 +52,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", diff --git a/tests/clickhouse-reference/02018_multiple_with_fill_for_the_same_column.sql.expected.ast.json b/tests/clickhouse-reference/02018_multiple_with_fill_for_the_same_column.sql.expected.ast.json index db770da7a..4e66f752e 100644 --- a/tests/clickhouse-reference/02018_multiple_with_fill_for_the_same_column.sql.expected.ast.json +++ b/tests/clickhouse-reference/02018_multiple_with_fill_for_the_same_column.sql.expected.ast.json @@ -51,6 +51,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -81,6 +82,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", diff --git a/tests/clickhouse-reference/02019_multiple_weird_with_fill.sql.expected.ast.json b/tests/clickhouse-reference/02019_multiple_weird_with_fill.sql.expected.ast.json index 20e1dad89..f7d058467 100644 --- a/tests/clickhouse-reference/02019_multiple_weird_with_fill.sql.expected.ast.json +++ b/tests/clickhouse-reference/02019_multiple_weird_with_fill.sql.expected.ast.json @@ -63,6 +63,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -99,6 +100,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "Int64", diff --git a/tests/clickhouse-reference/02020_exponential_smoothing.sql.expected.ast.json b/tests/clickhouse-reference/02020_exponential_smoothing.sql.expected.ast.json index 1db570af3..e3d2034c5 100644 --- a/tests/clickhouse-reference/02020_exponential_smoothing.sql.expected.ast.json +++ b/tests/clickhouse-reference/02020_exponential_smoothing.sql.expected.ast.json @@ -3605,7 +3605,8 @@ "t" ] } - ] + ], + "windowName": "w" }, "alias": "sum" }, @@ -3634,7 +3635,8 @@ "t" ] } - ] + ], + "windowName": "w" }, "alias": "max" }, @@ -3657,7 +3659,8 @@ "t" ] } - ] + ], + "windowName": "w" }, "alias": "count" }, @@ -3686,7 +3689,8 @@ "t" ] } - ] + ], + "windowName": "w" }, "alias": "avg" } @@ -4029,7 +4033,8 @@ "t" ] } - ] + ], + "windowName": "w" }, "alias": "sum" }, @@ -4058,7 +4063,8 @@ "t" ] } - ] + ], + "windowName": "w" }, "alias": "max" }, @@ -4081,7 +4087,8 @@ "t" ] } - ] + ], + "windowName": "w" }, "alias": "count" }, @@ -4110,7 +4117,8 @@ "t" ] } - ] + ], + "windowName": "w" }, "alias": "avg" } @@ -4278,7 +4286,8 @@ "t" ] } - ] + ], + "windowName": "w" }, "alias": "max" } diff --git a/tests/clickhouse-reference/02020_exponential_smoothing.sql.expected.formatted.sql b/tests/clickhouse-reference/02020_exponential_smoothing.sql.expected.formatted.sql index 3e36e1055..ab9b4be3a 100644 --- a/tests/clickhouse-reference/02020_exponential_smoothing.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02020_exponential_smoothing.sql.expected.formatted.sql @@ -324,10 +324,10 @@ FROM ( SELECT d[1] AS x, d[2] AS t, - exponentialTimeDecayedSum(100)(x, t) AS sum, - exponentialTimeDecayedMax(100)(x, t) AS max, - exponentialTimeDecayedCount(100)(t) AS count, - exponentialTimeDecayedAvg(100)(x, t) AS avg + exponentialTimeDecayedSum(100)(x, t) OVER w AS sum, + exponentialTimeDecayedMax(100)(x, t) OVER w AS max, + exponentialTimeDecayedCount(100)(t) OVER w AS count, + exponentialTimeDecayedAvg(100)(x, t) OVER w AS avg FROM ( SELECT [[2, 1], [1, 2], [0, 3], [4, 4], [5, 5], [1, 6], [0, 7], [10, 8]] AS d @@ -347,10 +347,10 @@ FROM ( SELECT sin(number) AS x, number AS t, - exponentialTimeDecayedSum(100)(x, t) AS sum, - exponentialTimeDecayedMax(100)(x, t) AS max, - exponentialTimeDecayedCount(100)(t) AS count, - exponentialTimeDecayedAvg(100)(x, t) AS avg + exponentialTimeDecayedSum(100)(x, t) OVER w AS sum, + exponentialTimeDecayedMax(100)(x, t) OVER w AS max, + exponentialTimeDecayedCount(100)(t) OVER w AS count, + exponentialTimeDecayedAvg(100)(x, t) OVER w AS avg FROM numbers(1000000) WINDOW w AS (ORDER BY 1 ASC ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING) ) @@ -364,7 +364,7 @@ FROM ( SELECT d[1] AS x, d[2] AS t, - exponentialTimeDecayedMax(100)(negate(x), t) AS max + exponentialTimeDecayedMax(100)(negate(x), t) OVER w AS max FROM ( SELECT [[2, 1], [1, 2], [10, 3], [4, 4], [5, 5], [1, 6], [10, 7], [10, 8], [10, 9], [9.81, 10], [9.9, 11]] AS d diff --git a/tests/clickhouse-reference/02100_now64_types_bug.sql.expected.ast.json b/tests/clickhouse-reference/02100_now64_types_bug.sql.expected.ast.json index a3a97d1f8..a6423ba42 100644 --- a/tests/clickhouse-reference/02100_now64_types_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/02100_now64_types_bug.sql.expected.ast.json @@ -449,7 +449,8 @@ "x" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ] } diff --git a/tests/clickhouse-reference/02100_now64_types_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/02100_now64_types_bug.sql.expected.formatted.sql index 5549e1bb5..b94a4ec00 100644 --- a/tests/clickhouse-reference/02100_now64_types_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02100_now64_types_bug.sql.expected.formatted.sql @@ -4,4 +4,4 @@ FROM ( FROM `system`.numbers LIMIT 3 ) -ORDER BY x DESC; \ No newline at end of file +ORDER BY x DESC NULLS LAST; \ No newline at end of file diff --git a/tests/clickhouse-reference/02111_with_fill_no_rows.sql.expected.ast.json b/tests/clickhouse-reference/02111_with_fill_no_rows.sql.expected.ast.json index f96dbf7a1..5301b9ad8 100644 --- a/tests/clickhouse-reference/02111_with_fill_no_rows.sql.expected.ast.json +++ b/tests/clickhouse-reference/02111_with_fill_no_rows.sql.expected.ast.json @@ -67,6 +67,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -148,6 +149,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -224,6 +226,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillTo": { "kind": "literal", "type": "UInt64", @@ -299,7 +302,8 @@ "y" ] }, - "direction": "ASC" + "direction": "ASC", + "withFill": true } ] } diff --git a/tests/clickhouse-reference/02111_with_fill_no_rows.sql.expected.formatted.sql b/tests/clickhouse-reference/02111_with_fill_no_rows.sql.expected.formatted.sql index 141e54ea5..fd7b5882a 100644 --- a/tests/clickhouse-reference/02111_with_fill_no_rows.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02111_with_fill_no_rows.sql.expected.formatted.sql @@ -36,4 +36,4 @@ FROM ( WHERE 0 ) GROUP BY y -ORDER BY y ASC; \ No newline at end of file +ORDER BY y ASC WITH FILL; \ No newline at end of file diff --git a/tests/clickhouse-reference/02112_with_fill_interval.sql.expected.ast.json b/tests/clickhouse-reference/02112_with_fill_interval.sql.expected.ast.json index b1a1c68ac..83c52d65a 100644 --- a/tests/clickhouse-reference/02112_with_fill_interval.sql.expected.ast.json +++ b/tests/clickhouse-reference/02112_with_fill_interval.sql.expected.ast.json @@ -114,6 +114,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toIntervalDay", @@ -185,6 +186,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toIntervalWeek", @@ -256,6 +258,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toIntervalMonth", @@ -327,6 +330,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "functionCall", "name": "toDate", @@ -403,6 +407,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toIntervalHour", @@ -467,6 +472,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toIntervalDay", @@ -538,6 +544,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toIntervalWeek", @@ -609,6 +616,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toIntervalMonth", @@ -680,6 +688,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "functionCall", "name": "toDate", @@ -826,6 +835,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toIntervalMinute", @@ -897,6 +907,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toIntervalHour", @@ -968,6 +979,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toIntervalDay", @@ -1029,6 +1041,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toIntervalMinute", @@ -1100,6 +1113,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toIntervalHour", @@ -1171,6 +1185,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toIntervalDay", @@ -1223,6 +1238,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toIntervalHour", @@ -1368,6 +1384,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "functionCall", "name": "toDate", @@ -1411,6 +1428,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -1467,6 +1485,7 @@ ] }, "direction": "DESC", + "withFill": true, "fillFrom": { "kind": "functionCall", "name": "toDate", diff --git a/tests/clickhouse-reference/02129_window_functions_disable_optimizations.sql.expected.ast.json b/tests/clickhouse-reference/02129_window_functions_disable_optimizations.sql.expected.ast.json index ea7c13fc6..a7993d0d8 100644 --- a/tests/clickhouse-reference/02129_window_functions_disable_optimizations.sql.expected.ast.json +++ b/tests/clickhouse-reference/02129_window_functions_disable_optimizations.sql.expected.ast.json @@ -69,7 +69,8 @@ "dummy" ] } - ] + ], + "windowName": "w" } ], "from": { diff --git a/tests/clickhouse-reference/02129_window_functions_disable_optimizations.sql.expected.formatted.sql b/tests/clickhouse-reference/02129_window_functions_disable_optimizations.sql.expected.formatted.sql index 732ac29d3..4a0ec701c 100644 --- a/tests/clickhouse-reference/02129_window_functions_disable_optimizations.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02129_window_functions_disable_optimizations.sql.expected.formatted.sql @@ -2,7 +2,7 @@ SET optimize_rewrite_sum_if_to_count_if = 1; SELECT if(number % 10 = 0, 1, 0) AS dummy, - sum(dummy) + sum(dummy) OVER w FROM numbers(10) WINDOW w AS (ORDER BY number ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW); diff --git a/tests/clickhouse-reference/02133_issue_32458.sql.expected.ast.json b/tests/clickhouse-reference/02133_issue_32458.sql.expected.ast.json index d5012faa8..5be527379 100644 --- a/tests/clickhouse-reference/02133_issue_32458.sql.expected.ast.json +++ b/tests/clickhouse-reference/02133_issue_32458.sql.expected.ast.json @@ -173,7 +173,8 @@ } ] } - } + }, + "strictness": "ANY" } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/02133_issue_32458.sql.expected.formatted.sql b/tests/clickhouse-reference/02133_issue_32458.sql.expected.formatted.sql index e19ec8343..b83e77a2e 100644 --- a/tests/clickhouse-reference/02133_issue_32458.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02133_issue_32458.sql.expected.formatted.sql @@ -23,6 +23,6 @@ INSERT INTO t2; SELECT * FROM t1 -INNER JOIN t2 +ANY INNER JOIN t2 ON ((NULL = t1.key) = t2.id) AND (('' = t1.key) = t2.id); \ No newline at end of file diff --git a/tests/clickhouse-reference/02174_cte_scalar_cache_mv.sql.expected.ast.json b/tests/clickhouse-reference/02174_cte_scalar_cache_mv.sql.expected.ast.json index c9235d433..bf62b82e3 100644 --- a/tests/clickhouse-reference/02174_cte_scalar_cache_mv.sql.expected.ast.json +++ b/tests/clickhouse-reference/02174_cte_scalar_cache_mv.sql.expected.ast.json @@ -820,6 +820,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t1", @@ -1277,6 +1278,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2", diff --git a/tests/clickhouse-reference/02174_cte_scalar_cache_mv.sql.expected.formatted.sql b/tests/clickhouse-reference/02174_cte_scalar_cache_mv.sql.expected.formatted.sql index 8dcb6343a..4f1103105 100644 --- a/tests/clickhouse-reference/02174_cte_scalar_cache_mv.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02174_cte_scalar_cache_mv.sql.expected.formatted.sql @@ -123,7 +123,7 @@ SELECT SELECT * FROM `system`.one AS _a - CROSS JOIN t1 AS _b + , t1 AS _b ) ) ) AS z @@ -180,7 +180,7 @@ SELECT SELECT * FROM `system`.one AS _a - CROSS JOIN t2 AS _b + , t2 AS _b ) ) ) AS z diff --git a/tests/clickhouse-reference/02175_distributed_join_current_database.sql.expected.ast.json b/tests/clickhouse-reference/02175_distributed_join_current_database.sql.expected.ast.json index 372db953e..92465431d 100644 --- a/tests/clickhouse-reference/02175_distributed_join_current_database.sql.expected.ast.json +++ b/tests/clickhouse-reference/02175_distributed_join_current_database.sql.expected.ast.json @@ -133,7 +133,8 @@ "columns": [ "dummy" ] - } + }, + "global": true } }, { @@ -228,7 +229,8 @@ "columns": [ "dummy" ] - } + }, + "global": true } }, { diff --git a/tests/clickhouse-reference/02175_distributed_join_current_database.sql.expected.formatted.sql b/tests/clickhouse-reference/02175_distributed_join_current_database.sql.expected.formatted.sql index 28cc66abe..5c7683027 100644 --- a/tests/clickhouse-reference/02175_distributed_join_current_database.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02175_distributed_join_current_database.sql.expected.formatted.sql @@ -21,7 +21,7 @@ INNER JOIN local_02175 AS r SELECT * FROM dist_02175 AS l -INNER JOIN local_02175 AS r +GLOBAL INNER JOIN local_02175 AS r USING (dummy); -- explicit database for distributed table @@ -34,7 +34,7 @@ INNER JOIN local_02175 AS r SELECT * FROM remote('127.1', currentDatabase(), dist_02175) AS l -INNER JOIN local_02175 AS r +GLOBAL INNER JOIN local_02175 AS r USING (dummy); -- { echoOff } diff --git a/tests/clickhouse-reference/02233_interpolate_1.sql.expected.ast.json b/tests/clickhouse-reference/02233_interpolate_1.sql.expected.ast.json index 2f36355de..51a9f573f 100644 --- a/tests/clickhouse-reference/02233_interpolate_1.sql.expected.ast.json +++ b/tests/clickhouse-reference/02233_interpolate_1.sql.expected.ast.json @@ -118,6 +118,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -258,6 +259,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -408,6 +410,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -559,6 +562,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -719,6 +723,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -872,6 +877,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -1032,6 +1038,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -1186,6 +1193,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -1354,6 +1362,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -1528,6 +1537,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -1739,6 +1749,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -1930,6 +1941,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -2104,6 +2116,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -2278,6 +2291,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -2414,6 +2428,7 @@ ] }, "direction": "ASC", + "withFill": true, "interpolate": [ { "col": "m", diff --git a/tests/clickhouse-reference/02233_optimize_aggregation_in_order_prefix.sql.expected.ast.json b/tests/clickhouse-reference/02233_optimize_aggregation_in_order_prefix.sql.expected.ast.json index b7bce37c0..aad776b0b 100644 --- a/tests/clickhouse-reference/02233_optimize_aggregation_in_order_prefix.sql.expected.ast.json +++ b/tests/clickhouse-reference/02233_optimize_aggregation_in_order_prefix.sql.expected.ast.json @@ -126,7 +126,8 @@ "parent_key" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ], "settings": [ @@ -210,7 +211,8 @@ "parent_key" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ], "settings": [ @@ -817,7 +819,8 @@ "parent_key" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ], "settings": [ @@ -911,7 +914,8 @@ "parent_key" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ], "settings": [ diff --git a/tests/clickhouse-reference/02233_optimize_aggregation_in_order_prefix.sql.expected.formatted.sql b/tests/clickhouse-reference/02233_optimize_aggregation_in_order_prefix.sql.expected.formatted.sql index e5bfcc577..d4df32783 100644 --- a/tests/clickhouse-reference/02233_optimize_aggregation_in_order_prefix.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02233_optimize_aggregation_in_order_prefix.sql.expected.formatted.sql @@ -22,7 +22,7 @@ GROUP BY parent_key, child_key, child_key -ORDER BY parent_key ASC +ORDER BY parent_key ASC NULLS LAST SETTINGS max_threads = 1, optimize_aggregation_in_order = 1; @@ -37,7 +37,7 @@ GROUP BY child_key, child_key WITH TOTALS -ORDER BY parent_key ASC +ORDER BY parent_key ASC NULLS LAST SETTINGS max_threads = 1, optimize_aggregation_in_order = 1; @@ -146,7 +146,7 @@ GROUP BY child_key ORDER BY child_key ASC, - parent_key ASC + parent_key ASC NULLS LAST SETTINGS max_threads = 1, optimize_aggregation_in_order = 1; @@ -163,7 +163,7 @@ GROUP BY WITH TOTALS ORDER BY child_key ASC, - parent_key ASC + parent_key ASC NULLS LAST SETTINGS max_threads = 1, optimize_aggregation_in_order = 1; diff --git a/tests/clickhouse-reference/02233_optimize_aggregation_in_order_prefix_with_merge.sql.expected.ast.json b/tests/clickhouse-reference/02233_optimize_aggregation_in_order_prefix_with_merge.sql.expected.ast.json index f3e915680..f339be762 100644 --- a/tests/clickhouse-reference/02233_optimize_aggregation_in_order_prefix_with_merge.sql.expected.ast.json +++ b/tests/clickhouse-reference/02233_optimize_aggregation_in_order_prefix_with_merge.sql.expected.ast.json @@ -153,7 +153,8 @@ "parent_key" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ], "settings": [ @@ -247,7 +248,8 @@ "parent_key" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ], "settings": [ diff --git a/tests/clickhouse-reference/02233_optimize_aggregation_in_order_prefix_with_merge.sql.expected.formatted.sql b/tests/clickhouse-reference/02233_optimize_aggregation_in_order_prefix_with_merge.sql.expected.formatted.sql index 48c184490..b76fd1c6f 100644 --- a/tests/clickhouse-reference/02233_optimize_aggregation_in_order_prefix_with_merge.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02233_optimize_aggregation_in_order_prefix_with_merge.sql.expected.formatted.sql @@ -27,7 +27,7 @@ GROUP BY child_key ORDER BY child_key ASC, - parent_key ASC + parent_key ASC NULLS LAST SETTINGS max_threads = 1, optimize_aggregation_in_order = 1; @@ -44,7 +44,7 @@ GROUP BY WITH TOTALS ORDER BY child_key ASC, - parent_key ASC + parent_key ASC NULLS LAST SETTINGS max_threads = 1, optimize_aggregation_in_order = 1; diff --git a/tests/clickhouse-reference/02236_explain_pipeline_join.sql.expected.ast.json b/tests/clickhouse-reference/02236_explain_pipeline_join.sql.expected.ast.json index 61553d0e2..4838457a9 100644 --- a/tests/clickhouse-reference/02236_explain_pipeline_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/02236_explain_pipeline_join.sql.expected.ast.json @@ -117,7 +117,8 @@ "columns": [ "number" ] - } + }, + "strictness": "ALL" }, "settings": [ { diff --git a/tests/clickhouse-reference/02236_explain_pipeline_join.sql.expected.formatted.sql b/tests/clickhouse-reference/02236_explain_pipeline_join.sql.expected.formatted.sql index 73ba73bbf..dd8c2c544 100644 --- a/tests/clickhouse-reference/02236_explain_pipeline_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02236_explain_pipeline_join.sql.expected.formatted.sql @@ -14,7 +14,7 @@ FROM FROM `system`.numbers LIMIT 100000 ) AS t1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT * FROM `system`.numbers LIMIT 100000 diff --git a/tests/clickhouse-reference/02240_asof_join_biginteger.sql.expected.ast.json b/tests/clickhouse-reference/02240_asof_join_biginteger.sql.expected.ast.json index c27823ddf..fcfb2b372 100644 --- a/tests/clickhouse-reference/02240_asof_join_biginteger.sql.expected.ast.json +++ b/tests/clickhouse-reference/02240_asof_join_biginteger.sql.expected.ast.json @@ -81,7 +81,8 @@ "k", "v" ] - } + }, + "strictness": "ASOF" } }, { @@ -166,7 +167,8 @@ "k", "v" ] - } + }, + "strictness": "ASOF" } }, { @@ -251,7 +253,8 @@ "k", "v" ] - } + }, + "strictness": "ASOF" } }, { @@ -336,7 +339,8 @@ "k", "v" ] - } + }, + "strictness": "ASOF" } }, { diff --git a/tests/clickhouse-reference/02240_asof_join_biginteger.sql.expected.formatted.sql b/tests/clickhouse-reference/02240_asof_join_biginteger.sql.expected.formatted.sql index f125e12cc..b9a3f5ec3 100644 --- a/tests/clickhouse-reference/02240_asof_join_biginteger.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02240_asof_join_biginteger.sql.expected.formatted.sql @@ -5,7 +5,7 @@ FROM 0 AS k, toInt128('18446744073709551617') AS v ) AS t1 -INNER JOIN ( +ASOF INNER JOIN ( SELECT 0 AS k, toInt128('18446744073709551616') AS v @@ -19,7 +19,7 @@ FROM 0 AS k, toInt256('340282366920938463463374607431768211457') AS v ) AS t1 -INNER JOIN ( +ASOF INNER JOIN ( SELECT 0 AS k, toInt256('340282366920938463463374607431768211456') AS v @@ -33,7 +33,7 @@ FROM 0 AS k, toUInt128('18446744073709551617') AS v ) AS t1 -INNER JOIN ( +ASOF INNER JOIN ( SELECT 0 AS k, toUInt128('18446744073709551616') AS v @@ -47,7 +47,7 @@ FROM 0 AS k, toUInt256('340282366920938463463374607431768211457') AS v ) AS t1 -INNER JOIN ( +ASOF INNER JOIN ( SELECT 0 AS k, toUInt256('340282366920938463463374607431768211456') AS v diff --git a/tests/clickhouse-reference/02242_join_rocksdb.sql.expected.ast.json b/tests/clickhouse-reference/02242_join_rocksdb.sql.expected.ast.json index 54ae214d2..7a018fbe0 100644 --- a/tests/clickhouse-reference/02242_join_rocksdb.sql.expected.ast.json +++ b/tests/clickhouse-reference/02242_join_rocksdb.sql.expected.ast.json @@ -498,7 +498,8 @@ ] } } - } + }, + "strictness": "SEMI" }, "orderBy": [ { @@ -554,7 +555,8 @@ ] } } - } + }, + "strictness": "ANTI" }, "orderBy": [ { @@ -1508,7 +1510,8 @@ ] } } - } + }, + "strictness": "SEMI" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" @@ -1564,7 +1567,8 @@ ] } } - } + }, + "strictness": "ANTI" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" diff --git a/tests/clickhouse-reference/02242_join_rocksdb.sql.expected.formatted.sql b/tests/clickhouse-reference/02242_join_rocksdb.sql.expected.formatted.sql index d3da44d8e..f1858bad7 100644 --- a/tests/clickhouse-reference/02242_join_rocksdb.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02242_join_rocksdb.sql.expected.formatted.sql @@ -66,14 +66,14 @@ ORDER BY key ASC; SELECT k FROM t2 -LEFT JOIN rdb +SEMI LEFT JOIN rdb ON rdb.key == t2.k ORDER BY k ASC; SELECT k FROM t2 -LEFT JOIN rdb +ANTI LEFT JOIN rdb ON rdb.key == t2.k ORDER BY k ASC; @@ -201,7 +201,7 @@ SETTINGS join_algorithm = 'direct,hash'; SELECT * FROM t1 -RIGHT JOIN ( +SEMI RIGHT JOIN ( SELECT * FROM rdb ) AS rdb @@ -210,7 +210,7 @@ RIGHT JOIN ( SELECT * FROM t1 -RIGHT JOIN ( +ANTI RIGHT JOIN ( SELECT * FROM rdb ) AS rdb diff --git a/tests/clickhouse-reference/02242_optimize_to_subcolumns_no_storage.sql.expected.ast.json b/tests/clickhouse-reference/02242_optimize_to_subcolumns_no_storage.sql.expected.ast.json index 9c225e40b..50d39a36f 100644 --- a/tests/clickhouse-reference/02242_optimize_to_subcolumns_no_storage.sql.expected.ast.json +++ b/tests/clickhouse-reference/02242_optimize_to_subcolumns_no_storage.sql.expected.ast.json @@ -41,6 +41,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -56,6 +57,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", diff --git a/tests/clickhouse-reference/02242_optimize_to_subcolumns_no_storage.sql.expected.formatted.sql b/tests/clickhouse-reference/02242_optimize_to_subcolumns_no_storage.sql.expected.formatted.sql index ac0005cc7..065fcd6c7 100644 --- a/tests/clickhouse-reference/02242_optimize_to_subcolumns_no_storage.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02242_optimize_to_subcolumns_no_storage.sql.expected.formatted.sql @@ -3,7 +3,7 @@ SET optimize_functions_to_subcolumns = 1; SELECT count(*) FROM numbers(2) AS n1 -CROSS JOIN numbers(3) AS n2 -CROSS JOIN numbers(4) AS n3 +, numbers(3) AS n2 +, numbers(4) AS n3 WHERE (n1.number = n2.number) AND (n2.number = n3.number); \ No newline at end of file diff --git a/tests/clickhouse-reference/02265_cross_join_empty_list.sql.expected.ast.json b/tests/clickhouse-reference/02265_cross_join_empty_list.sql.expected.ast.json index 1fc1e1fac..79babca76 100644 --- a/tests/clickhouse-reference/02265_cross_join_empty_list.sql.expected.ast.json +++ b/tests/clickhouse-reference/02265_cross_join_empty_list.sql.expected.ast.json @@ -30,6 +30,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -45,6 +46,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -88,6 +90,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -103,6 +106,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -142,6 +146,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -157,6 +162,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -230,6 +236,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -245,6 +252,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -282,6 +290,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -297,6 +306,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -387,6 +397,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -402,6 +413,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", diff --git a/tests/clickhouse-reference/02265_cross_join_empty_list.sql.expected.formatted.sql b/tests/clickhouse-reference/02265_cross_join_empty_list.sql.expected.formatted.sql index 8b05c4e09..972b2e5f5 100644 --- a/tests/clickhouse-reference/02265_cross_join_empty_list.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02265_cross_join_empty_list.sql.expected.formatted.sql @@ -1,20 +1,20 @@ SELECT count(1) FROM numbers(2) AS n1 -CROSS JOIN numbers(3) AS n2 -CROSS JOIN numbers(4) AS n3; +, numbers(3) AS n2 +, numbers(4) AS n3; SELECT count(*) FROM numbers(2) AS n1 -CROSS JOIN numbers(3) AS n2 -CROSS JOIN numbers(4) AS n3; +, numbers(3) AS n2 +, numbers(4) AS n3; SELECT count() FROM numbers(2) AS n1 -CROSS JOIN numbers(3) AS n2 -CROSS JOIN numbers(4) AS n3; +, numbers(3) AS n2 +, numbers(4) AS n3; SELECT count(n1.number), @@ -22,14 +22,14 @@ SELECT count(n3.number) FROM numbers(2) AS n1 -CROSS JOIN numbers(3) AS n2 -CROSS JOIN numbers(4) AS n3; +, numbers(3) AS n2 +, numbers(4) AS n3; SELECT * FROM numbers(2) AS n1 -CROSS JOIN numbers(3) AS n2 -CROSS JOIN numbers(4) AS n3 +, numbers(3) AS n2 +, numbers(4) AS n3 ORDER BY n1.number ASC, n2.number ASC, @@ -41,8 +41,8 @@ SELECT n3.number FROM numbers(2) AS n1 -CROSS JOIN numbers(3) AS n2 -CROSS JOIN numbers(4) AS n3 +, numbers(3) AS n2 +, numbers(4) AS n3 ORDER BY n1.number ASC, n2.number ASC, diff --git a/tests/clickhouse-reference/02265_limit_push_down_over_window_functions_bug.sql.expected.ast.json b/tests/clickhouse-reference/02265_limit_push_down_over_window_functions_bug.sql.expected.ast.json index e61421cfe..8ef39c93e 100644 --- a/tests/clickhouse-reference/02265_limit_push_down_over_window_functions_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/02265_limit_push_down_over_window_functions_bug.sql.expected.ast.json @@ -20,7 +20,8 @@ "number" ] } - ] + ], + "windowName": "w" }, "alias": "W" } diff --git a/tests/clickhouse-reference/02265_limit_push_down_over_window_functions_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/02265_limit_push_down_over_window_functions_bug.sql.expected.formatted.sql index 9421e64f7..19821e158 100644 --- a/tests/clickhouse-reference/02265_limit_push_down_over_window_functions_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02265_limit_push_down_over_window_functions_bug.sql.expected.formatted.sql @@ -1,6 +1,6 @@ SELECT number, - leadInFrame(number) AS W + leadInFrame(number) OVER w AS W FROM numbers(10) LIMIT 3 WINDOW w AS (ORDER BY number ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED PRECEDING); diff --git a/tests/clickhouse-reference/02276_full_sort_join_unsupported.sql.expected.ast.json b/tests/clickhouse-reference/02276_full_sort_join_unsupported.sql.expected.ast.json index 326659077..b992c4e36 100644 --- a/tests/clickhouse-reference/02276_full_sort_join_unsupported.sql.expected.ast.json +++ b/tests/clickhouse-reference/02276_full_sort_join_unsupported.sql.expected.ast.json @@ -208,7 +208,8 @@ ] } } - } + }, + "strictness": "ANTI" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" @@ -252,7 +253,8 @@ ] } } - } + }, + "strictness": "SEMI" }, "trailingComments": [ "-- { serverError NOT_IMPLEMENTED }" @@ -296,7 +298,8 @@ ] } } - } + }, + "strictness": "ANY" }, "settings": [ { diff --git a/tests/clickhouse-reference/02276_full_sort_join_unsupported.sql.expected.formatted.sql b/tests/clickhouse-reference/02276_full_sort_join_unsupported.sql.expected.formatted.sql index e3b9d84c7..96cc2b0d5 100644 --- a/tests/clickhouse-reference/02276_full_sort_join_unsupported.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02276_full_sort_join_unsupported.sql.expected.formatted.sql @@ -32,19 +32,19 @@ INNER JOIN t2 SELECT * FROM t1 -INNER JOIN t2 +ANTI INNER JOIN t2 ON t1.key = t2.key; -- { serverError NOT_IMPLEMENTED } SELECT * FROM t1 -INNER JOIN t2 +SEMI INNER JOIN t2 ON t1.key = t2.key; -- { serverError NOT_IMPLEMENTED } SELECT * FROM t1 -INNER JOIN t2 +ANY INNER JOIN t2 ON t1.key = t2.key SETTINGS any_join_distinct_right_table_keys = 1; -- { serverError NOT_IMPLEMENTED } diff --git a/tests/clickhouse-reference/02282_array_distance.sql.expected.ast.json b/tests/clickhouse-reference/02282_array_distance.sql.expected.ast.json index 490a2b6f8..7e82a0b48 100644 --- a/tests/clickhouse-reference/02282_array_distance.sql.expected.ast.json +++ b/tests/clickhouse-reference/02282_array_distance.sql.expected.ast.json @@ -1319,6 +1319,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "vec2", @@ -1529,6 +1530,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "vec2f", @@ -1739,6 +1741,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "vec2d", @@ -1939,6 +1942,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "vec2d", diff --git a/tests/clickhouse-reference/02282_array_distance.sql.expected.formatted.sql b/tests/clickhouse-reference/02282_array_distance.sql.expected.formatted.sql index df303bbf9..6193425fd 100644 --- a/tests/clickhouse-reference/02282_array_distance.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02282_array_distance.sql.expected.formatted.sql @@ -103,7 +103,7 @@ SELECT cosineDistance(v1.v, v2.v) FROM vec2 AS v1 -CROSS JOIN vec2 AS v2 +, vec2 AS v2 WHERE length(v1.v) == length(v2.v) ORDER BY `ALL` ASC; @@ -120,7 +120,7 @@ SELECT cosineDistance(v1.v, v2.v) FROM vec2f AS v1 -CROSS JOIN vec2f AS v2 +, vec2f AS v2 WHERE length(v1.v) == length(v2.v) ORDER BY `ALL` ASC; @@ -137,7 +137,7 @@ SELECT cosineDistance(v1.v, v2.v) FROM vec2d AS v1 -CROSS JOIN vec2d AS v2 +, vec2d AS v2 WHERE length(v1.v) == length(v2.v) ORDER BY `ALL` ASC; @@ -152,7 +152,7 @@ SELECT cosineDistance(v1.v, v2.v) FROM vec2f AS v1 -CROSS JOIN vec2d AS v2 +, vec2d AS v2 WHERE length(v1.v) == length(v2.v) ORDER BY `ALL` ASC; diff --git a/tests/clickhouse-reference/02302_join_auto_lc_nullable_bug.sql.expected.ast.json b/tests/clickhouse-reference/02302_join_auto_lc_nullable_bug.sql.expected.ast.json index 339d8ae02..aaa113281 100644 --- a/tests/clickhouse-reference/02302_join_auto_lc_nullable_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/02302_join_auto_lc_nullable_bug.sql.expected.ast.json @@ -145,7 +145,8 @@ ] } } - } + }, + "strictness": "ANY" } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/02302_join_auto_lc_nullable_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/02302_join_auto_lc_nullable_bug.sql.expected.formatted.sql index 2e773d333..152754e5d 100644 --- a/tests/clickhouse-reference/02302_join_auto_lc_nullable_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02302_join_auto_lc_nullable_bug.sql.expected.formatted.sql @@ -7,7 +7,7 @@ FROM FROM `system`.numbers LIMIT 3 ) AS s1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT toLowCardinality(toNullable(number)) AS r FROM `system`.numbers LIMIT 4 diff --git a/tests/clickhouse-reference/02313_cross_join_dup_col_names.sql.expected.ast.json b/tests/clickhouse-reference/02313_cross_join_dup_col_names.sql.expected.ast.json index 4fecc1cca..06c8dfd8d 100644 --- a/tests/clickhouse-reference/02313_cross_join_dup_col_names.sql.expected.ast.json +++ b/tests/clickhouse-reference/02313_cross_join_dup_col_names.sql.expected.ast.json @@ -25,6 +25,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -89,6 +90,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -133,6 +135,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -156,6 +159,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { diff --git a/tests/clickhouse-reference/02313_cross_join_dup_col_names.sql.expected.formatted.sql b/tests/clickhouse-reference/02313_cross_join_dup_col_names.sql.expected.formatted.sql index d0b0cafdf..d9b3e9e74 100644 --- a/tests/clickhouse-reference/02313_cross_join_dup_col_names.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02313_cross_join_dup_col_names.sql.expected.formatted.sql @@ -4,7 +4,7 @@ FROM ( SELECT NULL ) AS s1 -CROSS JOIN ( +, ( SELECT count(2), count(1) @@ -15,16 +15,16 @@ FROM ( SELECT NULL ) AS s1 -CROSS JOIN ( +, ( SELECT count(2.), 9223372036854775806, count('-1'), NULL ) AS s2 -CROSS JOIN ( +, ( SELECT count('-2147483648') ) AS any_query -CROSS JOIN ( +, ( SELECT NULL ) AS check_single_query; \ No newline at end of file diff --git a/tests/clickhouse-reference/02313_test_fpc_codec.sql.expected.ast.json b/tests/clickhouse-reference/02313_test_fpc_codec.sql.expected.ast.json index 3556f26f1..5a2b6ffba 100644 --- a/tests/clickhouse-reference/02313_test_fpc_codec.sql.expected.ast.json +++ b/tests/clickhouse-reference/02313_test_fpc_codec.sql.expected.ast.json @@ -711,6 +711,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "codecTest", @@ -854,6 +855,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "codecTest", diff --git a/tests/clickhouse-reference/02313_test_fpc_codec.sql.expected.formatted.sql b/tests/clickhouse-reference/02313_test_fpc_codec.sql.expected.formatted.sql index a775756a7..4e6310778 100644 --- a/tests/clickhouse-reference/02313_test_fpc_codec.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02313_test_fpc_codec.sql.expected.formatted.sql @@ -69,7 +69,7 @@ SELECT c2.ref_valueF64 FROM codecTest AS c1 -CROSS JOIN codecTest AS c2 +, codecTest AS c2 WHERE dF64 != 0 AND c2.key = c1.key - 1 LIMIT 10; @@ -85,7 +85,7 @@ SELECT c2.ref_valueF32 FROM codecTest AS c1 -CROSS JOIN codecTest AS c2 +, codecTest AS c2 WHERE dF32 != 0 AND c2.key = c1.key - 1 LIMIT 10; diff --git a/tests/clickhouse-reference/02315_pmj_union_ubsan_35857.sql.expected.ast.json b/tests/clickhouse-reference/02315_pmj_union_ubsan_35857.sql.expected.ast.json index 1cd2b5fc6..33129118f 100644 --- a/tests/clickhouse-reference/02315_pmj_union_ubsan_35857.sql.expected.ast.json +++ b/tests/clickhouse-reference/02315_pmj_union_ubsan_35857.sql.expected.ast.json @@ -114,7 +114,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/02315_pmj_union_ubsan_35857.sql.expected.formatted.sql b/tests/clickhouse-reference/02315_pmj_union_ubsan_35857.sql.expected.formatted.sql index c74e2f6a8..0a1c1d350 100644 --- a/tests/clickhouse-reference/02315_pmj_union_ubsan_35857.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02315_pmj_union_ubsan_35857.sql.expected.formatted.sql @@ -13,7 +13,7 @@ FROM 65536, NULL ) AS js1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT 2::Nullable(UInt8) AS a ) AS js2 USING (a) diff --git a/tests/clickhouse-reference/02336_sort_optimization_with_fill.sql.expected.ast.json b/tests/clickhouse-reference/02336_sort_optimization_with_fill.sql.expected.ast.json index 6bc347461..98e368249 100644 --- a/tests/clickhouse-reference/02336_sort_optimization_with_fill.sql.expected.ast.json +++ b/tests/clickhouse-reference/02336_sort_optimization_with_fill.sql.expected.ast.json @@ -49,6 +49,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", diff --git a/tests/clickhouse-reference/02337_join_analyze_stuck.sql.expected.ast.json b/tests/clickhouse-reference/02337_join_analyze_stuck.sql.expected.ast.json index b3ac77dd9..4215ad742 100644 --- a/tests/clickhouse-reference/02337_join_analyze_stuck.sql.expected.ast.json +++ b/tests/clickhouse-reference/02337_join_analyze_stuck.sql.expected.ast.json @@ -62,6 +62,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "x", @@ -70,6 +71,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "x", @@ -78,6 +80,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "x", @@ -86,6 +89,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "x", @@ -94,6 +98,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "x", @@ -102,6 +107,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "x", @@ -110,6 +116,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "x", @@ -118,6 +125,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "x", @@ -126,6 +134,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "x", @@ -263,6 +272,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "x", @@ -271,6 +281,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "x", @@ -279,6 +290,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "x", @@ -287,6 +299,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "x", @@ -295,6 +308,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "x", @@ -303,6 +317,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "x", @@ -311,6 +326,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "x", @@ -319,6 +335,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "x", @@ -327,6 +344,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "x", diff --git a/tests/clickhouse-reference/02337_join_analyze_stuck.sql.expected.formatted.sql b/tests/clickhouse-reference/02337_join_analyze_stuck.sql.expected.formatted.sql index 976a98b2f..100b0414f 100644 --- a/tests/clickhouse-reference/02337_join_analyze_stuck.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02337_join_analyze_stuck.sql.expected.formatted.sql @@ -10,15 +10,15 @@ cross_sales AS ( SELECT 1 AS xx FROM x - CROSS JOIN x AS d1 - CROSS JOIN x AS d2 - CROSS JOIN x AS d3 - CROSS JOIN x AS d4 - CROSS JOIN x AS d5 - CROSS JOIN x AS d6 - CROSS JOIN x AS d7 - CROSS JOIN x AS d8 - CROSS JOIN x AS d9 + , x AS d1 + , x AS d2 + , x AS d3 + , x AS d4 + , x AS d5 + , x AS d6 + , x AS d7 + , x AS d8 + , x AS d9 WHERE x.number = d9.number ) @@ -39,15 +39,15 @@ cross_sales AS ( SELECT 1 AS xx FROM x - CROSS JOIN x AS d1 - CROSS JOIN x AS d2 - CROSS JOIN x AS d3 - CROSS JOIN x AS d4 - CROSS JOIN x AS d5 - CROSS JOIN x AS d6 - CROSS JOIN x AS d7 - CROSS JOIN x AS d8 - CROSS JOIN x AS d9 + , x AS d1 + , x AS d2 + , x AS d3 + , x AS d4 + , x AS d5 + , x AS d6 + , x AS d7 + , x AS d8 + , x AS d9 WHERE x.number = d9.number ) diff --git a/tests/clickhouse-reference/02340_union_header.sql.expected.ast.json b/tests/clickhouse-reference/02340_union_header.sql.expected.ast.json index ac7b858b0..9bbe1b109 100644 --- a/tests/clickhouse-reference/02340_union_header.sql.expected.ast.json +++ b/tests/clickhouse-reference/02340_union_header.sql.expected.ast.json @@ -257,7 +257,8 @@ "a", "b" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -268,7 +269,8 @@ "a" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -287,7 +289,8 @@ "b" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -297,7 +300,8 @@ "c" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -306,7 +310,8 @@ "type": "UInt64", "value": "1048575" }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", diff --git a/tests/clickhouse-reference/02340_union_header.sql.expected.formatted.sql b/tests/clickhouse-reference/02340_union_header.sql.expected.formatted.sql index 06e918535..4470508a7 100644 --- a/tests/clickhouse-reference/02340_union_header.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02340_union_header.sql.expected.formatted.sql @@ -33,7 +33,7 @@ FROM NULL, -2 ) AS js1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT 100 AS a, -9223372036854775808 AS b, @@ -46,10 +46,10 @@ LEFT JOIN ( ) AS js2 USING (a, b) ORDER BY - a DESC, + a DESC NULLS FIRST, '-0.02' ASC, - b ASC, - c DESC, - 1048575 ASC, + b ASC NULLS FIRST, + c DESC NULLS FIRST, + 1048575 ASC NULLS LAST, d DESC SETTINGS enable_positional_arguments = 0; \ No newline at end of file diff --git a/tests/clickhouse-reference/02341_global_join_cte.sql.expected.ast.json b/tests/clickhouse-reference/02341_global_join_cte.sql.expected.ast.json index 74260ec84..634249753 100644 --- a/tests/clickhouse-reference/02341_global_join_cte.sql.expected.ast.json +++ b/tests/clickhouse-reference/02341_global_join_cte.sql.expected.ast.json @@ -137,7 +137,8 @@ "columns": [ "d1" ] - } + }, + "global": true }, "orderBy": [ { @@ -307,7 +308,8 @@ "columns": [ "d1" ] - } + }, + "global": true }, "orderBy": [ { @@ -474,7 +476,8 @@ "columns": [ "d1" ] - } + }, + "global": true }, "orderBy": [ { @@ -639,7 +642,8 @@ "columns": [ "d1" ] - } + }, + "global": true }, "orderBy": [ { diff --git a/tests/clickhouse-reference/02341_global_join_cte.sql.expected.formatted.sql b/tests/clickhouse-reference/02341_global_join_cte.sql.expected.formatted.sql index f08f4a2df..f213ccdc7 100644 --- a/tests/clickhouse-reference/02341_global_join_cte.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02341_global_join_cte.sql.expected.formatted.sql @@ -17,7 +17,7 @@ FROM dummy AS d2 FROM `system`.one ))) AS lhs -INNER JOIN rhs +GLOBAL INNER JOIN rhs USING (d1) ORDER BY rhs.d2 ASC SETTINGS enable_analyzer = 0; -- { serverError ALIAS_REQUIRED } @@ -40,7 +40,7 @@ FROM dummy AS d2 FROM `system`.one ))) AS lhs -INNER JOIN rhs +GLOBAL INNER JOIN rhs USING (d1) ORDER BY rhs.d2 ASC SETTINGS enable_analyzer = 1; -- It works with analyzer; rhs is an alias itself. @@ -63,7 +63,7 @@ FROM dummy AS d2 FROM `system`.one ))) AS lhs -INNER JOIN rhs +GLOBAL INNER JOIN rhs USING (d1) ORDER BY rhs.d2 ASC SETTINGS joined_subquery_requires_alias = 0; @@ -86,7 +86,7 @@ FROM dummy AS d2 FROM `system`.one ))) AS lhs -INNER JOIN rhs_ AS rhs +GLOBAL INNER JOIN rhs_ AS rhs USING (d1) ORDER BY rhs.d2 ASC SETTINGS joined_subquery_requires_alias = 0; \ No newline at end of file diff --git a/tests/clickhouse-reference/02346_additional_filters.sql.expected.ast.json b/tests/clickhouse-reference/02346_additional_filters.sql.expected.ast.json index 22752e48f..b9ee0413a 100644 --- a/tests/clickhouse-reference/02346_additional_filters.sql.expected.ast.json +++ b/tests/clickhouse-reference/02346_additional_filters.sql.expected.ast.json @@ -1465,7 +1465,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/02346_additional_filters.sql.expected.formatted.sql b/tests/clickhouse-reference/02346_additional_filters.sql.expected.formatted.sql index 40cbbb295..98770304b 100644 --- a/tests/clickhouse-reference/02346_additional_filters.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02346_additional_filters.sql.expected.formatted.sql @@ -167,7 +167,7 @@ FROM FROM `system`.numbers LIMIT 5 ) AS f -LEFT JOIN ( +ANY LEFT JOIN ( SELECT x, y diff --git a/tests/clickhouse-reference/02364_setting_cross_to_inner_rewrite.sql.expected.ast.json b/tests/clickhouse-reference/02364_setting_cross_to_inner_rewrite.sql.expected.ast.json index 79aac6930..8bff07c0f 100644 --- a/tests/clickhouse-reference/02364_setting_cross_to_inner_rewrite.sql.expected.ast.json +++ b/tests/clickhouse-reference/02364_setting_cross_to_inner_rewrite.sql.expected.ast.json @@ -113,6 +113,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -162,6 +163,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" diff --git a/tests/clickhouse-reference/02364_setting_cross_to_inner_rewrite.sql.expected.formatted.sql b/tests/clickhouse-reference/02364_setting_cross_to_inner_rewrite.sql.expected.formatted.sql index 1efb44b39..f7dd10ce3 100644 --- a/tests/clickhouse-reference/02364_setting_cross_to_inner_rewrite.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02364_setting_cross_to_inner_rewrite.sql.expected.formatted.sql @@ -23,13 +23,13 @@ SET cross_to_inner_join_rewrite = 1; SELECT count() = 1 FROM t1 -CROSS JOIN t2 +, t2 WHERE t1.x > t2.x; SELECT count() = 2 FROM t1 -CROSS JOIN t2 +, t2 WHERE t1.x = t2.x; SELECT count() = 2 diff --git a/tests/clickhouse-reference/02366_asof_optimize_predicate_bug_37813.sql.expected.ast.json b/tests/clickhouse-reference/02366_asof_optimize_predicate_bug_37813.sql.expected.ast.json index 0e1444d05..524787b4f 100644 --- a/tests/clickhouse-reference/02366_asof_optimize_predicate_bug_37813.sql.expected.ast.json +++ b/tests/clickhouse-reference/02366_asof_optimize_predicate_bug_37813.sql.expected.ast.json @@ -227,7 +227,8 @@ "c1", "c2" ] - } + }, + "strictness": "ASOF" } } } diff --git a/tests/clickhouse-reference/02366_asof_optimize_predicate_bug_37813.sql.expected.formatted.sql b/tests/clickhouse-reference/02366_asof_optimize_predicate_bug_37813.sql.expected.formatted.sql index 561dede65..360937b02 100644 --- a/tests/clickhouse-reference/02366_asof_optimize_predicate_bug_37813.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02366_asof_optimize_predicate_bug_37813.sql.expected.formatted.sql @@ -32,7 +32,7 @@ WITH v1 AS ( t2.c3 FROM t1 - INNER JOIN t2 + ASOF INNER JOIN t2 USING (c1, c2) ) diff --git a/tests/clickhouse-reference/02366_with_fill_date.sql.expected.ast.json b/tests/clickhouse-reference/02366_with_fill_date.sql.expected.ast.json index 8c6c1070e..6eb98f690 100644 --- a/tests/clickhouse-reference/02366_with_fill_date.sql.expected.ast.json +++ b/tests/clickhouse-reference/02366_with_fill_date.sql.expected.ast.json @@ -40,6 +40,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "functionCall", "name": "toDateTime", diff --git a/tests/clickhouse-reference/02371_analyzer_join_cross.sql.expected.ast.json b/tests/clickhouse-reference/02371_analyzer_join_cross.sql.expected.ast.json index 341a1c071..81134361a 100644 --- a/tests/clickhouse-reference/02371_analyzer_join_cross.sql.expected.ast.json +++ b/tests/clickhouse-reference/02371_analyzer_join_cross.sql.expected.ast.json @@ -286,6 +286,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_2" @@ -354,6 +355,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_2", @@ -441,6 +443,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_2", @@ -514,6 +517,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_2" @@ -521,6 +525,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_3" @@ -594,6 +599,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_2", @@ -602,6 +608,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_3", @@ -718,6 +725,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_2", @@ -726,6 +734,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_3", @@ -762,6 +771,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_2" @@ -788,6 +798,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_2" diff --git a/tests/clickhouse-reference/02371_analyzer_join_cross.sql.expected.formatted.sql b/tests/clickhouse-reference/02371_analyzer_join_cross.sql.expected.formatted.sql index d7d947388..ac8732a82 100644 --- a/tests/clickhouse-reference/02371_analyzer_join_cross.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02371_analyzer_join_cross.sql.expected.formatted.sql @@ -57,7 +57,7 @@ SELECT test_table_join_2.value FROM test_table_join_1 -CROSS JOIN test_table_join_2 +, test_table_join_2 ORDER BY `ALL` ASC; SELECT '--'; @@ -69,7 +69,7 @@ SELECT t2.value FROM test_table_join_1 AS t1 -CROSS JOIN test_table_join_2 AS t2 +, test_table_join_2 AS t2 ORDER BY `ALL` ASC; SELECT @@ -83,7 +83,7 @@ SELECT test_table_join_2.value FROM test_table_join_1 AS t1 -CROSS JOIN test_table_join_2 AS t2 +, test_table_join_2 AS t2 ORDER BY `ALL` ASC; SELECT @@ -95,8 +95,8 @@ SELECT test_table_join_3.value FROM test_table_join_1 -CROSS JOIN test_table_join_2 -CROSS JOIN test_table_join_3 +, test_table_join_2 +, test_table_join_3 ORDER BY `ALL` ASC; SELECT @@ -108,8 +108,8 @@ SELECT t3.value FROM test_table_join_1 AS t1 -CROSS JOIN test_table_join_2 AS t2 -CROSS JOIN test_table_join_3 AS t3 +, test_table_join_2 AS t2 +, test_table_join_3 AS t3 ORDER BY `ALL` ASC; SELECT @@ -127,19 +127,19 @@ SELECT test_table_join_3.value FROM test_table_join_1 AS t1 -CROSS JOIN test_table_join_2 AS t2 -CROSS JOIN test_table_join_3 AS t3 +, test_table_join_2 AS t2 +, test_table_join_3 AS t3 ORDER BY `ALL` ASC; SELECT id FROM test_table_join_1 -CROSS JOIN test_table_join_2; -- { serverError AMBIGUOUS_IDENTIFIER } +, test_table_join_2; -- { serverError AMBIGUOUS_IDENTIFIER } SELECT value FROM test_table_join_1 -CROSS JOIN test_table_join_2; -- { serverError AMBIGUOUS_IDENTIFIER } +, test_table_join_2; -- { serverError AMBIGUOUS_IDENTIFIER } DROP TABLE test_table_join_1; diff --git a/tests/clickhouse-reference/02374_analyzer_array_join.sql.expected.ast.json b/tests/clickhouse-reference/02374_analyzer_array_join.sql.expected.ast.json index 8f2bfed7c..9de19ee7b 100644 --- a/tests/clickhouse-reference/02374_analyzer_array_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/02374_analyzer_array_join.sql.expected.ast.json @@ -1361,7 +1361,8 @@ } ] } - ] + ], + "nullsAction": "IGNORE NULLS" }, { "kind": "functionCall", diff --git a/tests/clickhouse-reference/02374_analyzer_array_join.sql.expected.formatted.sql b/tests/clickhouse-reference/02374_analyzer_array_join.sql.expected.formatted.sql index a7c92fecd..51b062256 100644 --- a/tests/clickhouse-reference/02374_analyzer_array_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02374_analyzer_array_join.sql.expected.formatted.sql @@ -135,7 +135,7 @@ FROM ARRAY JOIN [0] AS elem, arrayMap(x -> concat(x, ignore(ignore(toLowCardinality('03147_parquet_memory_tracking.parquet'), 37, 37, toUInt128(37), 37, 37, toLowCardinality(37), 37), 8, ignore(ignore(1., 36, 8, 8)), *), 'hello'), ['']) AS unused WHERE NOT ignore(elem) GROUP BY - sum(ignore(ignore(ignore(1., 1, 36, 8, 8), ignore(52, 37, 37, '03147_parquet_memory_tracking.parquet', 37, 37, toUInt256(37), 37, 37, toNullable(37), 37, 37), 1., 1, 36, 8, 8), emptyArrayToSingle(arrayMap(x -> toString(x), arrayMap(x -> nullIf(x, 2), arrayJoin([[1]])))))), + sum(ignore(ignore(ignore(1., 1, 36, 8, 8), ignore(52, 37, 37, '03147_parquet_memory_tracking.parquet', 37, 37, toUInt256(37), 37, 37, toNullable(37), 37, 37), 1., 1, 36, 8, 8), emptyArrayToSingle(arrayMap(x -> toString(x), arrayMap(x -> nullIf(x, 2), arrayJoin([[1]])))))) IGNORE NULLS, modulo(toLowCardinality('03147_parquet_memory_tracking.parquet'), number, toLowCardinality(3)); -- { serverError UNKNOWN_IDENTIFIER } -- { echoOff } diff --git a/tests/clickhouse-reference/02378_analyzer_projection_names.sql.expected.ast.json b/tests/clickhouse-reference/02378_analyzer_projection_names.sql.expected.ast.json index d68ce6fba..c4b7d8f36 100644 --- a/tests/clickhouse-reference/02378_analyzer_projection_names.sql.expected.ast.json +++ b/tests/clickhouse-reference/02378_analyzer_projection_names.sql.expected.ast.json @@ -5495,7 +5495,8 @@ } ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] } @@ -5535,7 +5536,8 @@ } ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] } @@ -5570,6 +5572,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -5619,6 +5622,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "binaryExpr", "op": "+", @@ -5686,6 +5690,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "alias", "expr": { @@ -5758,7 +5763,8 @@ { "kind": "functionCall", "name": "count", - "args": [] + "args": [], + "windowName": "window_name" } ], "from": { @@ -5793,7 +5799,8 @@ { "kind": "functionCall", "name": "count", - "args": [] + "args": [], + "windowName": "window_name" } ], "from": { @@ -5853,7 +5860,8 @@ }, "direction": "ASC" } - ] + ], + "baseWindow": "window_name" } } ], @@ -6320,6 +6328,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_2" @@ -6347,6 +6356,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_2", @@ -6386,6 +6396,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_2", @@ -6437,6 +6448,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_2", @@ -6939,6 +6951,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_2" @@ -6946,6 +6959,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_3" @@ -6974,6 +6988,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_2", @@ -6982,6 +6997,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_3", @@ -7022,6 +7038,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_2", @@ -7030,6 +7047,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_3", @@ -7082,6 +7100,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_2", @@ -7090,6 +7109,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table_join_3", diff --git a/tests/clickhouse-reference/02378_analyzer_projection_names.sql.expected.formatted.sql b/tests/clickhouse-reference/02378_analyzer_projection_names.sql.expected.formatted.sql index c2b0d86da..9cda7490a 100644 --- a/tests/clickhouse-reference/02378_analyzer_projection_names.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02378_analyzer_projection_names.sql.expected.formatted.sql @@ -463,10 +463,10 @@ FROM test_table); DESCRIBE TABLE (SELECT count() OVER (PARTITION BY id, value ORDER BY id ASC, value DESC ROWS BETWEEN ((1 + 1) AS frame_offset_begin) PRECEDING AND ((2 + 2) AS frame_offset_end) FOLLOWING) FROM test_table); -DESCRIBE TABLE (SELECT count() OVER (ORDER BY toNullable(id) ASC) +DESCRIBE TABLE (SELECT count() OVER (ORDER BY toNullable(id) ASC NULLS FIRST) FROM test_table); -DESCRIBE TABLE (SELECT count() OVER (ORDER BY toNullable(id) ASC) +DESCRIBE TABLE (SELECT count() OVER (ORDER BY toNullable(id) ASC NULLS LAST) FROM test_table); DESCRIBE TABLE (SELECT count() OVER (ORDER BY id ASC WITH FILL FROM 1 TO 5 STEP 1) @@ -478,15 +478,15 @@ FROM test_table); DESCRIBE TABLE (SELECT count() OVER (ORDER BY id ASC WITH FILL FROM ((1 + 1) AS `from`) TO (6 AS to) STEP ((1 + 1) AS `step`)) FROM test_table); -DESCRIBE TABLE (SELECT count() +DESCRIBE TABLE (SELECT count() OVER window_name FROM test_table WINDOW window_name AS (PARTITION BY id)); -DESCRIBE TABLE (SELECT count() +DESCRIBE TABLE (SELECT count() OVER window_name FROM test_table WINDOW window_name AS (PARTITION BY id ORDER BY value ASC)); -DESCRIBE TABLE (SELECT count() OVER (ORDER BY id ASC) +DESCRIBE TABLE (SELECT count() OVER (window_name ORDER BY id ASC) FROM test_table WINDOW window_name AS (PARTITION BY id)); @@ -556,22 +556,22 @@ INNER JOIN test_table_in_cte_2 AS test_table_in_cte_2 DESCRIBE TABLE (SELECT * FROM test_table_join_1 -CROSS JOIN test_table_join_2); +, test_table_join_2); DESCRIBE TABLE (SELECT * FROM test_table_join_1 AS t1 -CROSS JOIN test_table_join_2 AS t2); +, test_table_join_2 AS t2); DESCRIBE TABLE (SELECT * APPLY(toString) FROM test_table_join_1 AS t1 -CROSS JOIN test_table_join_2 AS t2); +, test_table_join_2 AS t2); DESCRIBE TABLE (SELECT * APPLY(x -> toString(x)) FROM test_table_join_1 AS t1 -CROSS JOIN test_table_join_2 AS t2); +, test_table_join_2 AS t2); DESCRIBE TABLE (SELECT test_table_join_1.*, @@ -632,26 +632,26 @@ INNER JOIN test_table_join_2 AS t2 DESCRIBE TABLE (SELECT * FROM test_table_join_1 -CROSS JOIN test_table_join_2 -CROSS JOIN test_table_join_3); +, test_table_join_2 +, test_table_join_3); DESCRIBE TABLE (SELECT * FROM test_table_join_1 AS t1 -CROSS JOIN test_table_join_2 AS t2 -CROSS JOIN test_table_join_3 AS t3); +, test_table_join_2 AS t2 +, test_table_join_3 AS t3); DESCRIBE TABLE (SELECT * APPLY(toString) FROM test_table_join_1 AS t1 -CROSS JOIN test_table_join_2 AS t2 -CROSS JOIN test_table_join_3 AS t3); +, test_table_join_2 AS t2 +, test_table_join_3 AS t3); DESCRIBE TABLE (SELECT * APPLY(x -> toString(x)) FROM test_table_join_1 AS t1 -CROSS JOIN test_table_join_2 AS t2 -CROSS JOIN test_table_join_3 AS t3); +, test_table_join_2 AS t2 +, test_table_join_3 AS t3); DESCRIBE TABLE (SELECT test_table_join_1.*, diff --git a/tests/clickhouse-reference/02385_analyzer_aliases_compound_expression.sql.expected.ast.json b/tests/clickhouse-reference/02385_analyzer_aliases_compound_expression.sql.expected.ast.json index 5b06a9b84..997ed489a 100644 --- a/tests/clickhouse-reference/02385_analyzer_aliases_compound_expression.sql.expected.ast.json +++ b/tests/clickhouse-reference/02385_analyzer_aliases_compound_expression.sql.expected.ast.json @@ -187,6 +187,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t1", @@ -209,6 +210,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -249,6 +251,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "database": "t1", @@ -276,6 +279,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { diff --git a/tests/clickhouse-reference/02385_analyzer_aliases_compound_expression.sql.expected.formatted.sql b/tests/clickhouse-reference/02385_analyzer_aliases_compound_expression.sql.expected.formatted.sql index 7ca7957e2..b90bd3dd4 100644 --- a/tests/clickhouse-reference/02385_analyzer_aliases_compound_expression.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02385_analyzer_aliases_compound_expression.sql.expected.formatted.sql @@ -20,12 +20,12 @@ FROM ( SELECT 1 ) AS t1 -CROSS JOIN t1 AS t2; +, t1 AS t2; SELECT * FROM t1 AS t2 -CROSS JOIN ( +, ( SELECT 1 ) AS t1; @@ -34,11 +34,11 @@ FROM ( SELECT 1 ) AS t1 -CROSS JOIN t1.nested AS t2; -- { serverError UNKNOWN_IDENTIFIER } +, t1.nested AS t2; -- { serverError UNKNOWN_IDENTIFIER } SELECT * FROM t1.nested AS t2 -CROSS JOIN ( +, ( SELECT 1 ) AS t1; -- { serverError UNKNOWN_IDENTIFIER } \ No newline at end of file diff --git a/tests/clickhouse-reference/02402_external_disk_metrics.sql.expected.ast.json b/tests/clickhouse-reference/02402_external_disk_metrics.sql.expected.ast.json index 11db03ac6..f7d99ac0a 100644 --- a/tests/clickhouse-reference/02402_external_disk_metrics.sql.expected.ast.json +++ b/tests/clickhouse-reference/02402_external_disk_metrics.sql.expected.ast.json @@ -455,7 +455,8 @@ "columns": [ "n" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -631,7 +632,8 @@ "columns": [ "n" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/02402_external_disk_metrics.sql.expected.formatted.sql b/tests/clickhouse-reference/02402_external_disk_metrics.sql.expected.formatted.sql index 4a5bf042c..cf16a81e4 100644 --- a/tests/clickhouse-reference/02402_external_disk_metrics.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02402_external_disk_metrics.sql.expected.formatted.sql @@ -56,7 +56,7 @@ FROM SELECT number * 200000 AS n FROM numbers(5) ) AS nums -LEFT JOIN ( +ANY LEFT JOIN ( SELECT number * 2 AS n, number AS j @@ -77,7 +77,7 @@ FROM SELECT number * 200000 AS n FROM numbers(5) ) AS nums -LEFT JOIN ( +ANY LEFT JOIN ( SELECT number * 2 AS n, number AS j diff --git a/tests/clickhouse-reference/02416_keeper_map.sql.expected.ast.json b/tests/clickhouse-reference/02416_keeper_map.sql.expected.ast.json index 1e94237ff..53cfa58a8 100644 --- a/tests/clickhouse-reference/02416_keeper_map.sql.expected.ast.json +++ b/tests/clickhouse-reference/02416_keeper_map.sql.expected.ast.json @@ -1302,7 +1302,8 @@ "columns": [ "a" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/02416_keeper_map.sql.expected.formatted.sql b/tests/clickhouse-reference/02416_keeper_map.sql.expected.formatted.sql index 383a98fd1..3d3f551c3 100644 --- a/tests/clickhouse-reference/02416_keeper_map.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02416_keeper_map.sql.expected.formatted.sql @@ -123,7 +123,7 @@ FROM SUM(dummy.1) AS e FROM `02416_test` ) AS A -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 0 AS a, groupBitmapMerge(bm) AS b, diff --git a/tests/clickhouse-reference/02421_exponential_join_rewrite_21557.sql.expected.ast.json b/tests/clickhouse-reference/02421_exponential_join_rewrite_21557.sql.expected.ast.json index 5e02b0b87..6c6bc0e79 100644 --- a/tests/clickhouse-reference/02421_exponential_join_rewrite_21557.sql.expected.ast.json +++ b/tests/clickhouse-reference/02421_exponential_join_rewrite_21557.sql.expected.ast.json @@ -4113,6 +4113,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "catalog_returns" @@ -4482,6 +4483,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "store_returns" @@ -4489,6 +4491,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "cs_ui" @@ -4496,6 +4499,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "date_dim", @@ -4504,6 +4508,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "date_dim", @@ -4512,6 +4517,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "date_dim", @@ -4520,6 +4526,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "store" @@ -4527,6 +4534,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "customer" @@ -4534,6 +4542,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "customer_demographics", @@ -4542,6 +4551,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "customer_demographics", @@ -4550,6 +4560,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "promotion" @@ -4557,6 +4568,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "household_demographics", @@ -4565,6 +4577,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "household_demographics", @@ -4573,6 +4586,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "customer_address", @@ -4581,6 +4595,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "customer_address", @@ -4589,6 +4604,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "income_band", @@ -4597,6 +4613,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "income_band", @@ -4605,6 +4622,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "item" @@ -5396,6 +5414,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "cross_sales", diff --git a/tests/clickhouse-reference/02421_exponential_join_rewrite_21557.sql.expected.formatted.sql b/tests/clickhouse-reference/02421_exponential_join_rewrite_21557.sql.expected.formatted.sql index 4fca2ef33..b2e3b8a80 100644 --- a/tests/clickhouse-reference/02421_exponential_join_rewrite_21557.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02421_exponential_join_rewrite_21557.sql.expected.formatted.sql @@ -366,7 +366,7 @@ WITH cs_ui AS ( sum((cr_refunded_cash + cr_reversed_charge) + cr_store_credit) AS refund FROM catalog_sales - CROSS JOIN catalog_returns + , catalog_returns WHERE (cs_item_sk = cr_item_sk) AND (cs_order_number = cr_order_number) GROUP BY cs_item_sk @@ -396,23 +396,23 @@ cross_sales AS ( sum(ss_coupon_amt) AS s3 FROM store_sales - CROSS JOIN store_returns - CROSS JOIN cs_ui - CROSS JOIN date_dim AS d1 - CROSS JOIN date_dim AS d2 - CROSS JOIN date_dim AS d3 - CROSS JOIN store - CROSS JOIN customer - CROSS JOIN customer_demographics AS cd1 - CROSS JOIN customer_demographics AS cd2 - CROSS JOIN promotion - CROSS JOIN household_demographics AS hd1 - CROSS JOIN household_demographics AS hd2 - CROSS JOIN customer_address AS ad1 - CROSS JOIN customer_address AS ad2 - CROSS JOIN income_band AS ib1 - CROSS JOIN income_band AS ib2 - CROSS JOIN item + , store_returns + , cs_ui + , date_dim AS d1 + , date_dim AS d2 + , date_dim AS d3 + , store + , customer + , customer_demographics AS cd1 + , customer_demographics AS cd2 + , promotion + , household_demographics AS hd1 + , household_demographics AS hd2 + , customer_address AS ad1 + , customer_address AS ad2 + , income_band AS ib1 + , income_band AS ib2 + , item WHERE (ss_store_sk = s_store_sk) AND (ss_sold_date_sk = d1.d_date_sk) AND (ss_customer_sk = c_customer_sk) @@ -479,7 +479,7 @@ SELECT cs2.cnt FROM cross_sales AS cs1 -CROSS JOIN cross_sales AS cs2 +, cross_sales AS cs2 WHERE (cs1.item_sk = cs2.item_sk) AND (cs1.syear = 2000) AND (cs2.syear = (2000 + 1)) diff --git a/tests/clickhouse-reference/02461_mullable_pk_monotonicity_bug.sql.expected.ast.json b/tests/clickhouse-reference/02461_mullable_pk_monotonicity_bug.sql.expected.ast.json index 774834e11..e536206c4 100644 --- a/tests/clickhouse-reference/02461_mullable_pk_monotonicity_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/02461_mullable_pk_monotonicity_bug.sql.expected.ast.json @@ -1655,7 +1655,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] } diff --git a/tests/clickhouse-reference/02461_mullable_pk_monotonicity_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/02461_mullable_pk_monotonicity_bug.sql.expected.formatted.sql index 64d26792e..e5ca5dfbd 100644 --- a/tests/clickhouse-reference/02461_mullable_pk_monotonicity_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02461_mullable_pk_monotonicity_bug.sql.expected.formatted.sql @@ -135,4 +135,4 @@ ORDER BY x ASC; SELECT x + 1 FROM tab WHERE (x + CAST('1', 'Nullable(UInt8)')) <= -2147483647 -ORDER BY x ASC; \ No newline at end of file +ORDER BY x ASC NULLS FIRST; \ No newline at end of file diff --git a/tests/clickhouse-reference/02467_cross_join_three_table_functions.sql.expected.ast.json b/tests/clickhouse-reference/02467_cross_join_three_table_functions.sql.expected.ast.json index 8684ab733..59081b15b 100644 --- a/tests/clickhouse-reference/02467_cross_join_three_table_functions.sql.expected.ast.json +++ b/tests/clickhouse-reference/02467_cross_join_three_table_functions.sql.expected.ast.json @@ -28,6 +28,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -43,6 +44,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", diff --git a/tests/clickhouse-reference/02467_cross_join_three_table_functions.sql.expected.formatted.sql b/tests/clickhouse-reference/02467_cross_join_three_table_functions.sql.expected.formatted.sql index 779c4f869..301712308 100644 --- a/tests/clickhouse-reference/02467_cross_join_three_table_functions.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02467_cross_join_three_table_functions.sql.expected.formatted.sql @@ -1,5 +1,5 @@ SELECT count(*) FROM numbers(10) AS a -CROSS JOIN numbers(11) AS b -CROSS JOIN numbers(12) AS c; \ No newline at end of file +, numbers(11) AS b +, numbers(12) AS c; \ No newline at end of file diff --git a/tests/clickhouse-reference/02476_analyzer_join_with_unused_columns.sql.expected.ast.json b/tests/clickhouse-reference/02476_analyzer_join_with_unused_columns.sql.expected.ast.json index 6be9990ff..493d76bca 100644 --- a/tests/clickhouse-reference/02476_analyzer_join_with_unused_columns.sql.expected.ast.json +++ b/tests/clickhouse-reference/02476_analyzer_join_with_unused_columns.sql.expected.ast.json @@ -60,6 +60,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -147,6 +148,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -221,6 +223,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -295,6 +298,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -361,6 +365,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { diff --git a/tests/clickhouse-reference/02476_analyzer_join_with_unused_columns.sql.expected.formatted.sql b/tests/clickhouse-reference/02476_analyzer_join_with_unused_columns.sql.expected.formatted.sql index 6c5dfb367..fb8ddff63 100644 --- a/tests/clickhouse-reference/02476_analyzer_join_with_unused_columns.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02476_analyzer_join_with_unused_columns.sql.expected.formatted.sql @@ -9,7 +9,7 @@ FROM 1 AS id, 2 AS value ) AS subquery_1 -CROSS JOIN ( +, ( SELECT 3 AS id, 4 AS value @@ -26,7 +26,7 @@ FROM 1 AS id, 2 AS value ) AS subquery_1 -CROSS JOIN ( +, ( SELECT 3 AS id, 4 AS value @@ -39,7 +39,7 @@ FROM 1 AS id, 2 AS value ) AS subquery_1 -CROSS JOIN ( +, ( SELECT 3 AS id, 4 AS value @@ -52,7 +52,7 @@ FROM 1 AS id, 2 AS value ) AS subquery_1 -CROSS JOIN ( +, ( SELECT 3 AS id, 4 AS value @@ -65,7 +65,7 @@ FROM 1 AS id, 2 AS value ) AS subquery_1 -CROSS JOIN ( +, ( SELECT 3 AS id, 4 AS value diff --git a/tests/clickhouse-reference/02478_analyzer_table_expression_aliases.sql.expected.ast.json b/tests/clickhouse-reference/02478_analyzer_table_expression_aliases.sql.expected.ast.json index e882bba9f..f8a27e602 100644 --- a/tests/clickhouse-reference/02478_analyzer_table_expression_aliases.sql.expected.ast.json +++ b/tests/clickhouse-reference/02478_analyzer_table_expression_aliases.sql.expected.ast.json @@ -95,6 +95,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t1" @@ -115,6 +116,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table", @@ -137,6 +139,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table" @@ -167,6 +170,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table", @@ -189,6 +193,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -265,6 +270,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "cte_subquery", @@ -288,6 +294,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "test_table", @@ -296,6 +303,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t1", @@ -304,6 +312,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2", @@ -328,6 +337,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -345,6 +355,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t1", @@ -353,6 +364,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2", diff --git a/tests/clickhouse-reference/02478_analyzer_table_expression_aliases.sql.expected.formatted.sql b/tests/clickhouse-reference/02478_analyzer_table_expression_aliases.sql.expected.formatted.sql index 08f39e41f..325b25161 100644 --- a/tests/clickhouse-reference/02478_analyzer_table_expression_aliases.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02478_analyzer_table_expression_aliases.sql.expected.formatted.sql @@ -19,29 +19,29 @@ SELECT '--'; SELECT * FROM test_table AS t1 -CROSS JOIN t1; +, t1; SELECT * FROM t1 -CROSS JOIN test_table AS t1; +, test_table AS t1; SELECT * FROM test_table AS test_table -CROSS JOIN test_table; +, test_table; SELECT * FROM ( SELECT 1 ) AS test_table -CROSS JOIN test_table AS subquery; +, test_table AS subquery; SELECT * FROM test_table AS subquery -CROSS JOIN ( +, ( SELECT 1 ) AS test_table; @@ -59,22 +59,22 @@ WITH cte_subquery AS ( SELECT * FROM cte_subquery AS cte_subquery -CROSS JOIN cte_subquery AS subquery; +, cte_subquery AS subquery; SELECT * FROM t3 -CROSS JOIN test_table AS t1 -CROSS JOIN t1 AS t2 -CROSS JOIN t2 AS t3; +, test_table AS t1 +, t1 AS t2 +, t2 AS t3; SELECT * FROM t3 AS t4 -CROSS JOIN ( +, ( SELECT 1 ) AS t1 -CROSS JOIN t1 AS t2 -CROSS JOIN t2 AS t3; +, t1 AS t2 +, t2 AS t3; DROP TABLE test_table; \ No newline at end of file diff --git a/tests/clickhouse-reference/02479_analyzer_join_with_constants.sql.expected.ast.json b/tests/clickhouse-reference/02479_analyzer_join_with_constants.sql.expected.ast.json index 51bfb71a2..3fb20e5a8 100644 --- a/tests/clickhouse-reference/02479_analyzer_join_with_constants.sql.expected.ast.json +++ b/tests/clickhouse-reference/02479_analyzer_join_with_constants.sql.expected.ast.json @@ -466,7 +466,8 @@ } ] } - } + }, + "strictness": "ASOF" } }, { @@ -593,7 +594,8 @@ } ] } - } + }, + "strictness": "ASOF" } }, { @@ -744,7 +746,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "settings": [ { @@ -908,7 +911,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "settings": [ { @@ -1081,7 +1085,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "leadingComments": [ "-- Fuzzed" diff --git a/tests/clickhouse-reference/02479_analyzer_join_with_constants.sql.expected.formatted.sql b/tests/clickhouse-reference/02479_analyzer_join_with_constants.sql.expected.formatted.sql index 2a057cb7f..b522d8d64 100644 --- a/tests/clickhouse-reference/02479_analyzer_join_with_constants.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02479_analyzer_join_with_constants.sql.expected.formatted.sql @@ -53,7 +53,7 @@ FROM 1 AS id, 1 AS value ) AS t1 -LEFT JOIN ( +ASOF LEFT JOIN ( SELECT 1 AS id, 1 AS value @@ -69,7 +69,7 @@ FROM 1 AS id, 1 AS value ) AS t1 -LEFT JOIN ( +ASOF LEFT JOIN ( SELECT 1 AS id, 1 AS value @@ -86,7 +86,7 @@ FROM 1 AS dt FROM numbers(5) ) AS a -LEFT JOIN ( +ASOF LEFT JOIN ( SELECT NULL AS pk, 1 AS dt @@ -104,7 +104,7 @@ FROM 1 AS dt FROM numbers(5) ) AS a -LEFT JOIN ( +ASOF LEFT JOIN ( SELECT NULL AS pk, 1 AS dt @@ -122,7 +122,7 @@ FROM 1 AS id, 1 AS value ) AS t1 -LEFT JOIN ( +ASOF LEFT JOIN ( SELECT 1 AS id, 1 AS value diff --git a/tests/clickhouse-reference/02493_do_not_assume_that_the_original_query_was_valid_when_transforming_joins.sql.expected.ast.json b/tests/clickhouse-reference/02493_do_not_assume_that_the_original_query_was_valid_when_transforming_joins.sql.expected.ast.json index f0e5bbc42..efde019d0 100644 --- a/tests/clickhouse-reference/02493_do_not_assume_that_the_original_query_was_valid_when_transforming_joins.sql.expected.ast.json +++ b/tests/clickhouse-reference/02493_do_not_assume_that_the_original_query_was_valid_when_transforming_joins.sql.expected.ast.json @@ -203,7 +203,8 @@ } ] } - } + }, + "strictness": "ANY" }, "kind": "joinExpr", "joinType": "LEFT", @@ -243,7 +244,8 @@ ] } } - } + }, + "strictness": "ANY" }, "trailingComments": [ "-- {serverError UNKNOWN_IDENTIFIER}" diff --git a/tests/clickhouse-reference/02493_do_not_assume_that_the_original_query_was_valid_when_transforming_joins.sql.expected.formatted.sql b/tests/clickhouse-reference/02493_do_not_assume_that_the_original_query_was_valid_when_transforming_joins.sql.expected.formatted.sql index e3b172711..46b04b7f0 100644 --- a/tests/clickhouse-reference/02493_do_not_assume_that_the_original_query_was_valid_when_transforming_joins.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02493_do_not_assume_that_the_original_query_was_valid_when_transforming_joins.sql.expected.formatted.sql @@ -28,13 +28,13 @@ FROM FROM table1 GROUP BY column1 ) AS a -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM table2 ) AS b ON (b.column1 = a.column1) AND (b.column2 = a.column2) -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * FROM table3 ) AS c diff --git a/tests/clickhouse-reference/02494_analyzer_cte_resolution_in_subquery_fix.sql.expected.ast.json b/tests/clickhouse-reference/02494_analyzer_cte_resolution_in_subquery_fix.sql.expected.ast.json index 9e72ea29d..4bd516b86 100644 --- a/tests/clickhouse-reference/02494_analyzer_cte_resolution_in_subquery_fix.sql.expected.ast.json +++ b/tests/clickhouse-reference/02494_analyzer_cte_resolution_in_subquery_fix.sql.expected.ast.json @@ -46,6 +46,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -104,6 +105,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "a", @@ -173,6 +175,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "a", @@ -242,6 +245,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "b", diff --git a/tests/clickhouse-reference/02494_analyzer_cte_resolution_in_subquery_fix.sql.expected.formatted.sql b/tests/clickhouse-reference/02494_analyzer_cte_resolution_in_subquery_fix.sql.expected.formatted.sql index d29509175..d2cbd8c28 100644 --- a/tests/clickhouse-reference/02494_analyzer_cte_resolution_in_subquery_fix.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02494_analyzer_cte_resolution_in_subquery_fix.sql.expected.formatted.sql @@ -4,7 +4,7 @@ WITH a AS ( t2.number AS n2 FROM numbers(1) AS t1 - CROSS JOIN numbers(1) AS t2 + , numbers(1) AS t2 ), b AS ( @@ -15,7 +15,7 @@ b AS ( SELECT * FROM b AS l -CROSS JOIN a AS r; +, a AS r; WITH a AS ( SELECT number @@ -30,7 +30,7 @@ b AS ( SELECT * FROM b AS l -CROSS JOIN a AS r; +, a AS r; WITH a AS ( SELECT number @@ -45,4 +45,4 @@ b AS ( SELECT * FROM a AS l -CROSS JOIN b AS r; \ No newline at end of file +, b AS r; \ No newline at end of file diff --git a/tests/clickhouse-reference/02495_analyzer_storage_join.sql.expected.ast.json b/tests/clickhouse-reference/02495_analyzer_storage_join.sql.expected.ast.json index ae763112e..5480d2601 100644 --- a/tests/clickhouse-reference/02495_analyzer_storage_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/02495_analyzer_storage_join.sql.expected.ast.json @@ -257,7 +257,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -362,7 +363,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -472,7 +474,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -565,7 +568,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -646,7 +650,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -727,7 +732,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -824,7 +830,8 @@ "key1", "key2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -867,7 +874,8 @@ "key1", "key2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -918,7 +926,8 @@ "key1", "key2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -969,7 +978,8 @@ "key1", "key2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1020,7 +1030,8 @@ "key1", "key2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1071,7 +1082,8 @@ "key1", "key2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1115,7 +1127,8 @@ "key1", "key2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1159,7 +1172,8 @@ "key1", "key2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1203,7 +1217,8 @@ "key1", "key2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1247,7 +1262,8 @@ "key1", "key2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1290,7 +1306,8 @@ "key1", "key2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1333,7 +1350,8 @@ "key1", "key2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1379,7 +1397,8 @@ "key1", "key2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1425,7 +1444,8 @@ "key1", "key2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1469,7 +1489,8 @@ "key1", "key2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1512,7 +1533,8 @@ "key1", "key2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1590,7 +1612,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1672,7 +1695,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1765,7 +1789,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1855,7 +1880,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1945,7 +1971,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -2035,7 +2062,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -2118,7 +2146,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -2201,7 +2230,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -2284,7 +2314,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -2367,7 +2398,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -2449,7 +2481,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -2531,7 +2564,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -2616,7 +2650,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -2701,7 +2736,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -2784,7 +2820,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -2866,7 +2903,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -2954,7 +2992,8 @@ } ] } - } + }, + "strictness": "ALL" }, "format": "TSVWithNames", "trailingComments": [ @@ -3047,7 +3086,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -3154,7 +3194,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -3259,7 +3300,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -3369,7 +3411,8 @@ } ] } - } + }, + "strictness": "ALL" }, "format": "TSVWithNames", "trailingComments": [ @@ -3454,7 +3497,8 @@ } ] } - } + }, + "strictness": "ALL" }, "format": "TSVWithNames", "trailingComments": [ @@ -3539,7 +3583,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -3646,7 +3691,8 @@ } ] } - } + }, + "strictness": "ALL" }, "format": "TSVWithNames", "trailingComments": [ @@ -3720,7 +3766,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -3816,7 +3863,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -3917,7 +3965,8 @@ } ] } - } + }, + "strictness": "ALL" }, "format": "TSVWithNames", "trailingComments": [ @@ -3949,7 +3998,8 @@ "type": "String", "value": "aaa" } - } + }, + "strictness": "ALL" }, "format": "TSVWithNames", "trailingComments": [ @@ -4023,7 +4073,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -4119,7 +4170,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -4178,7 +4230,8 @@ "type": "UInt64", "value": "0" } - } + }, + "strictness": "ALL" }, "format": "TSVWithNames", "trailingComments": [ @@ -4210,7 +4263,8 @@ "type": "UInt64", "value": "1" } - } + }, + "strictness": "ALL" }, "format": "TSVWithNames", "trailingComments": [ diff --git a/tests/clickhouse-reference/02495_analyzer_storage_join.sql.expected.formatted.sql b/tests/clickhouse-reference/02495_analyzer_storage_join.sql.expected.formatted.sql index 5f655cb54..54336d625 100644 --- a/tests/clickhouse-reference/02495_analyzer_storage_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02495_analyzer_storage_join.sql.expected.formatted.sql @@ -36,7 +36,7 @@ INSERT INTO t1; SELECT * FROM t1 -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t1.id1 == tj.key1 AND t1.id2 == tj.key2 ORDER BY key1 ASC @@ -50,7 +50,7 @@ SELECT x FROM t1 -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t1.id1 == tj.key1 AND t1.id2 == tj.key2 ORDER BY key1 ASC @@ -64,7 +64,7 @@ SELECT tj.x FROM t1 -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t1.id1 == tj.key1 AND t1.id2 == tj.key2 ORDER BY key1 ASC @@ -76,7 +76,7 @@ SELECT x FROM t1 -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t1.id1 == tj.key1 AND t1.id2 == tj.key2 ORDER BY key1 ASC @@ -85,7 +85,7 @@ FORMAT TSVWithNames; SELECT val FROM t1 -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t1.id1 == tj.key1 AND t1.id2 == tj.key2 ORDER BY key1 ASC @@ -94,7 +94,7 @@ FORMAT TSVWithNames; SELECT x FROM t1 -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t1.id1 == tj.key1 AND t1.id2 == tj.key2 ORDER BY key1 ASC @@ -115,7 +115,7 @@ INSERT INTO t; SELECT * FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj USING (key1, key2) ORDER BY key1 ASC FORMAT TSVWithNames; @@ -123,7 +123,7 @@ FORMAT TSVWithNames; SELECT key1 FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj USING (key1, key2) ORDER BY key1 ASC FORMAT TSVWithNames; @@ -133,7 +133,7 @@ SELECT tj.key1 FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj USING (key1, key2) ORDER BY key1 ASC FORMAT TSVWithNames; @@ -143,7 +143,7 @@ SELECT tj.key2 FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj USING (key1, key2) ORDER BY key1 ASC FORMAT TSVWithNames; @@ -153,7 +153,7 @@ SELECT tj.b FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj USING (key1, key2) ORDER BY key1 ASC FORMAT TSVWithNames; @@ -163,7 +163,7 @@ SELECT tj.b FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj USING (key1, key2) ORDER BY key1 ASC FORMAT TSVWithNames; @@ -171,7 +171,7 @@ FORMAT TSVWithNames; SELECT tj.a FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj USING (key1, key2) ORDER BY key1 ASC FORMAT TSVWithNames; @@ -179,7 +179,7 @@ FORMAT TSVWithNames; SELECT tj.b FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj USING (key1, key2) ORDER BY key1 ASC FORMAT TSVWithNames; @@ -187,7 +187,7 @@ FORMAT TSVWithNames; SELECT tj.x FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj USING (key1, key2) ORDER BY key1 ASC FORMAT TSVWithNames; @@ -195,7 +195,7 @@ FORMAT TSVWithNames; SELECT tj.y FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj USING (key1, key2) ORDER BY key1 ASC FORMAT TSVWithNames; @@ -203,7 +203,7 @@ FORMAT TSVWithNames; SELECT a FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj USING (key1, key2) ORDER BY key1 ASC FORMAT TSVWithNames; @@ -211,7 +211,7 @@ FORMAT TSVWithNames; SELECT b FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj USING (key1, key2) ORDER BY key1 ASC FORMAT TSVWithNames; -- { serverError AMBIGUOUS_IDENTIFIER } @@ -219,7 +219,7 @@ FORMAT TSVWithNames; -- { serverError AMBIGUOUS_IDENTIFIER } SELECT x FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj USING (key1, key2) ORDER BY key1 ASC FORMAT TSVWithNames; -- { serverError AMBIGUOUS_IDENTIFIER } @@ -227,7 +227,7 @@ FORMAT TSVWithNames; -- { serverError AMBIGUOUS_IDENTIFIER } SELECT y FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj USING (key1, key2) ORDER BY key1 ASC FORMAT TSVWithNames; @@ -235,7 +235,7 @@ FORMAT TSVWithNames; SELECT t.val FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj USING (key1, key2) ORDER BY key1 ASC FORMAT TSVWithNames; @@ -243,7 +243,7 @@ FORMAT TSVWithNames; SELECT val FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj USING (key1, key2) ORDER BY key1 ASC FORMAT TSVWithNames; @@ -251,7 +251,7 @@ FORMAT TSVWithNames; SELECT * FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 ORDER BY t.key1 ASC @@ -260,7 +260,7 @@ FORMAT TSVWithNames; SELECT key1 FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 ORDER BY t.key1 ASC @@ -271,7 +271,7 @@ SELECT tj.key1 FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 ORDER BY t.key1 ASC @@ -282,7 +282,7 @@ SELECT tj.key2 FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 ORDER BY t.key1 ASC @@ -293,7 +293,7 @@ SELECT tj.b FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 ORDER BY t.key1 ASC @@ -304,7 +304,7 @@ SELECT tj.b FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 ORDER BY t.key1 ASC @@ -313,7 +313,7 @@ FORMAT TSVWithNames; SELECT tj.a FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 ORDER BY t.key1 ASC @@ -322,7 +322,7 @@ FORMAT TSVWithNames; SELECT tj.b FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 ORDER BY t.key1 ASC @@ -331,7 +331,7 @@ FORMAT TSVWithNames; SELECT tj.x FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 ORDER BY t.key1 ASC @@ -340,7 +340,7 @@ FORMAT TSVWithNames; SELECT tj.y FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 ORDER BY t.key1 ASC @@ -349,7 +349,7 @@ FORMAT TSVWithNames; SELECT a FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 ORDER BY t.key1 ASC @@ -358,7 +358,7 @@ FORMAT TSVWithNames; SELECT b FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 ORDER BY t.key1 ASC @@ -367,7 +367,7 @@ FORMAT TSVWithNames; -- { serverError AMBIGUOUS_IDENTIFIER } SELECT x FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 ORDER BY t.key1 ASC @@ -376,7 +376,7 @@ FORMAT TSVWithNames; -- { serverError AMBIGUOUS_IDENTIFIER } SELECT y FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 ORDER BY t.key1 ASC @@ -385,7 +385,7 @@ FORMAT TSVWithNames; SELECT t.val FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 ORDER BY t.key1 ASC @@ -394,7 +394,7 @@ FORMAT TSVWithNames; SELECT val FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 ORDER BY t.key1 ASC @@ -403,7 +403,7 @@ FORMAT TSVWithNames; SELECT * FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 + 1 FORMAT TSVWithNames; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN } @@ -411,7 +411,7 @@ FORMAT TSVWithNames; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN } SELECT * FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 + 1 == tj.key1 AND toUInt64(t.key2 - 1) == tj.key2 ORDER BY @@ -422,7 +422,7 @@ FORMAT TSVWithNames; -- Ok: expression on the left table SELECT * FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 AND 1 == 1 @@ -433,7 +433,7 @@ FORMAT TSVWithNames; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN } SELECT * FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 AND 1 == 1 @@ -446,7 +446,7 @@ FORMAT TSVWithNames; SELECT * FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 AND 1 == 2 @@ -455,7 +455,7 @@ FORMAT TSVWithNames; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN } SELECT * FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 AND tj.a == 20 @@ -464,7 +464,7 @@ FORMAT TSVWithNames; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN } SELECT * FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 AND t.b == 22 @@ -476,7 +476,7 @@ FORMAT TSVWithNames; -- Ok: t.b from the left table SELECT * FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 AND 1 != 1 @@ -485,7 +485,7 @@ FORMAT TSVWithNames; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN } SELECT * FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 AND NULL @@ -496,7 +496,7 @@ FORMAT TSVWithNames; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN } SELECT * FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 AND NULL @@ -509,7 +509,7 @@ FORMAT TSVWithNames; SELECT * FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 AND 'aaa' @@ -518,14 +518,14 @@ FORMAT TSVWithNames; -- { serverError ILLEGAL_TYPE_OF_ARGUMENT } SELECT * FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON 'aaa' FORMAT TSVWithNames; -- { serverError INVALID_JOIN_ON_EXPRESSION } SELECT * FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 AND 1 @@ -536,7 +536,7 @@ FORMAT TSVWithNames; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN } SELECT * FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON t.key1 == tj.key1 AND t.key2 == tj.key2 AND 1 @@ -549,13 +549,13 @@ FORMAT TSVWithNames; SELECT * FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON 0 FORMAT TSVWithNames; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN } SELECT * FROM t -RIGHT JOIN tj +ALL RIGHT JOIN tj ON 1 FORMAT TSVWithNames; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN } \ No newline at end of file diff --git a/tests/clickhouse-reference/02497_storage_join_right_assert.sql.expected.ast.json b/tests/clickhouse-reference/02497_storage_join_right_assert.sql.expected.ast.json index 78145da05..9791b102e 100644 --- a/tests/clickhouse-reference/02497_storage_join_right_assert.sql.expected.ast.json +++ b/tests/clickhouse-reference/02497_storage_join_right_assert.sql.expected.ast.json @@ -145,7 +145,8 @@ "columns": [ "key" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/02497_storage_join_right_assert.sql.expected.formatted.sql b/tests/clickhouse-reference/02497_storage_join_right_assert.sql.expected.formatted.sql index 608e779f0..55aae8799 100644 --- a/tests/clickhouse-reference/02497_storage_join_right_assert.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02497_storage_join_right_assert.sql.expected.formatted.sql @@ -25,7 +25,7 @@ SET enable_analyzer = 0; SELECT * FROM t1 -RIGHT JOIN t2 +ALL RIGHT JOIN t2 USING (key) ORDER BY key ASC; diff --git a/tests/clickhouse-reference/02498_storage_join_key_positions.sql.expected.ast.json b/tests/clickhouse-reference/02498_storage_join_key_positions.sql.expected.ast.json index de1f93254..136ed9e12 100644 --- a/tests/clickhouse-reference/02498_storage_join_key_positions.sql.expected.ast.json +++ b/tests/clickhouse-reference/02498_storage_join_key_positions.sql.expected.ast.json @@ -294,7 +294,8 @@ "key2", "key3" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -355,7 +356,8 @@ "key2", "key3" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -416,7 +418,8 @@ "key3", "key1" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -477,7 +480,8 @@ "key2", "key1" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -538,7 +542,8 @@ "key3", "key2" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -633,7 +638,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -729,7 +735,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -825,7 +832,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -921,7 +929,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1056,7 +1065,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1191,7 +1201,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1326,7 +1337,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1427,7 +1439,8 @@ } ] } - } + }, + "strictness": "ALL" }, "trailingComments": [ "-- { serverError INCOMPATIBLE_TYPE_OF_JOIN,INVALID_JOIN_ON_EXPRESSION }" @@ -1527,7 +1540,8 @@ } ] } - } + }, + "strictness": "ALL" }, "trailingComments": [ "-- { serverError INCOMPATIBLE_TYPE_OF_JOIN,INVALID_JOIN_ON_EXPRESSION }" @@ -1558,7 +1572,8 @@ "type": "UInt64", "value": "1" } - } + }, + "strictness": "ALL" }, "trailingComments": [ "-- { serverError INCOMPATIBLE_TYPE_OF_JOIN,INVALID_JOIN_ON_EXPRESSION }" @@ -1589,7 +1604,8 @@ "type": "UInt64", "value": "0" } - } + }, + "strictness": "ALL" }, "trailingComments": [ "-- { serverError INCOMPATIBLE_TYPE_OF_JOIN,INVALID_JOIN_ON_EXPRESSION }" @@ -1620,7 +1636,8 @@ "type": "NULL", "value": "NULL" } - } + }, + "strictness": "ALL" }, "trailingComments": [ "-- { serverError INCOMPATIBLE_TYPE_OF_JOIN,INVALID_JOIN_ON_EXPRESSION }" @@ -1660,7 +1677,8 @@ "value": "1" } } - } + }, + "strictness": "ALL" }, "trailingComments": [ "-- { serverError INCOMPATIBLE_TYPE_OF_JOIN,INVALID_JOIN_ON_EXPRESSION }" @@ -1700,7 +1718,8 @@ "value": "1" } } - } + }, + "strictness": "ALL" }, "leadingComments": [ "-- Here is another error code because equality is handled differently in CollectJoinOnKeysVisitor.", @@ -1746,7 +1765,8 @@ "value": "2" } } - } + }, + "strictness": "ALL" }, "trailingComments": [ "-- { serverError INCOMPATIBLE_TYPE_OF_JOIN,AMBIGUOUS_COLUMN_NAME }" @@ -1777,7 +1797,8 @@ "key2", "attr" ] - } + }, + "strictness": "ALL" }, "trailingComments": [ "-- { serverError INCOMPATIBLE_TYPE_OF_JOIN,UNKNOWN_IDENTIFIER }" @@ -1809,7 +1830,8 @@ "key3", "attr" ] - } + }, + "strictness": "ALL" }, "trailingComments": [ "-- { serverError INCOMPATIBLE_TYPE_OF_JOIN,UNKNOWN_IDENTIFIER }" @@ -1839,7 +1861,8 @@ "key2", "key3" ] - } + }, + "strictness": "ALL" }, "trailingComments": [ "-- { serverError INCOMPATIBLE_TYPE_OF_JOIN }" @@ -1883,7 +1906,8 @@ ] } } - } + }, + "strictness": "ALL" }, "trailingComments": [ "-- { serverError INCOMPATIBLE_TYPE_OF_JOIN }" @@ -1927,7 +1951,8 @@ ] } } - } + }, + "strictness": "ALL" }, "trailingComments": [ "-- { serverError INCOMPATIBLE_TYPE_OF_JOIN }" @@ -2013,7 +2038,8 @@ } ] } - } + }, + "strictness": "ALL" }, "trailingComments": [ "-- { serverError INCOMPATIBLE_TYPE_OF_JOIN }" @@ -2117,7 +2143,8 @@ } ] } - } + }, + "strictness": "ALL" }, "trailingComments": [ "-- { serverError INCOMPATIBLE_TYPE_OF_JOIN }" @@ -2203,7 +2230,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -2299,7 +2327,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/02498_storage_join_key_positions.sql.expected.formatted.sql b/tests/clickhouse-reference/02498_storage_join_key_positions.sql.expected.formatted.sql index 5e70f82d3..316a1b154 100644 --- a/tests/clickhouse-reference/02498_storage_join_key_positions.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02498_storage_join_key_positions.sql.expected.formatted.sql @@ -46,7 +46,7 @@ SELECT '--- using ---'; SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj USING (key1, key2, key3) ORDER BY key1 ASC; @@ -57,7 +57,7 @@ SELECT attr FROM t1 -INNER JOIN tj +ALL INNER JOIN tj USING (key1, key2, key3) ORDER BY key1 ASC; @@ -68,7 +68,7 @@ SELECT attr FROM t1 -INNER JOIN tj +ALL INNER JOIN tj USING (key2, key3, key1) ORDER BY key1 ASC; @@ -79,7 +79,7 @@ SELECT attr FROM t1 -INNER JOIN tj +ALL INNER JOIN tj USING (key3, key2, key1) ORDER BY key1 ASC; @@ -90,14 +90,14 @@ SELECT attr FROM t1 -INNER JOIN tj +ALL INNER JOIN tj USING (key1, key3, key2) ORDER BY key1 ASC; SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj ON t1.key3 = tj.key3 AND t1.key2 = tj.key2 AND t1.key1 = tj.key1 @@ -106,7 +106,7 @@ ORDER BY t1.key1 ASC; SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj ON t1.key2 = tj.key2 AND t1.key3 = tj.key3 AND t1.key1 = tj.key1 @@ -115,7 +115,7 @@ ORDER BY t1.key1 ASC; SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj ON t1.key3 = tj.key3 AND t1.key1 = tj.key1 AND t1.key2 = tj.key2 @@ -124,7 +124,7 @@ ORDER BY t1.key1 ASC; SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj ON t1.key1 = tj.key1 AND t1.key3 = tj.key3 AND t1.key2 = tj.key2 @@ -139,7 +139,7 @@ FROM key2 AS b FROM t1 ) AS t1 -INNER JOIN tj +ALL INNER JOIN tj ON t1.a = tj.key1 AND t1.c = tj.key3 AND t1.b = tj.key2 @@ -154,7 +154,7 @@ FROM key2 AS b FROM t1 ) AS t1 -INNER JOIN tj +ALL INNER JOIN tj ON t1.a = tj.key1 AND t1.b = tj.key2 AND t1.c = tj.key3 @@ -169,7 +169,7 @@ FROM key2 AS b FROM t1 ) AS t1 -INNER JOIN tj +ALL INNER JOIN tj ON t1.c = tj.key3 AND t1.a = tj.key1 AND t1.b = tj.key2 @@ -178,7 +178,7 @@ ORDER BY t1.a ASC; SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj ON t1.key1 = tj.key1 AND t1.key3 = tj.key3 AND t1.key2 = tj.key2 @@ -187,7 +187,7 @@ INNER JOIN tj SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj ON t1.key1 = tj.key1 AND t1.key3 = tj.key3 AND t1.key2 = tj.key2 @@ -196,25 +196,25 @@ INNER JOIN tj SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj ON 1; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN,INVALID_JOIN_ON_EXPRESSION } SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj ON 0; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN,INVALID_JOIN_ON_EXPRESSION } SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj ON NULL; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN,INVALID_JOIN_ON_EXPRESSION } SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj ON 1 != 1; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN,INVALID_JOIN_ON_EXPRESSION } -- Here is another error code because equality is handled differently in CollectJoinOnKeysVisitor. @@ -224,49 +224,49 @@ INNER JOIN tj SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj ON 1 == 1; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN,AMBIGUOUS_COLUMN_NAME } SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj ON 1 == 2; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN,AMBIGUOUS_COLUMN_NAME } SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj USING (key1, key2, attr); -- { serverError INCOMPATIBLE_TYPE_OF_JOIN,UNKNOWN_IDENTIFIER } SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj USING (key1, key2, key3, attr); -- { serverError INCOMPATIBLE_TYPE_OF_JOIN,UNKNOWN_IDENTIFIER } SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj USING (key2, key3); -- { serverError INCOMPATIBLE_TYPE_OF_JOIN } SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj ON t1.key1 = tj.attr; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN } SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj ON t1.key1 = tj.key1; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN } SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj ON t1.key1 = tj.key1 AND t1.key2 = tj.key2 AND t1.key3 = tj.attr; -- { serverError INCOMPATIBLE_TYPE_OF_JOIN } @@ -274,7 +274,7 @@ INNER JOIN tj SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj ON t1.key1 = tj.key1 AND t1.key2 = tj.key2 AND t1.key3 = tj.key3 @@ -283,7 +283,7 @@ INNER JOIN tj SELECT * FROM t1 -INNER JOIN tjj +ALL INNER JOIN tjj ON t1.key1 = tjj.key1 AND t1.key1 = tjj.key2 AND t1.key1 = tjj.key3 @@ -292,7 +292,7 @@ ORDER BY t1.key1 ASC; SELECT * FROM t1 -INNER JOIN tjj +ALL INNER JOIN tjj ON t1.key1 = tjj.key1 AND t1.key1 = tjj.key3 AND t1.key1 = tjj.key2 diff --git a/tests/clickhouse-reference/02531_semi_join_null_const_bug.sql.expected.ast.json b/tests/clickhouse-reference/02531_semi_join_null_const_bug.sql.expected.ast.json index 60525b8f2..580d3ed26 100644 --- a/tests/clickhouse-reference/02531_semi_join_null_const_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/02531_semi_join_null_const_bug.sql.expected.ast.json @@ -99,7 +99,8 @@ "columns": [ "id" ] - } + }, + "strictness": "SEMI" } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/02531_semi_join_null_const_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/02531_semi_join_null_const_bug.sql.expected.formatted.sql index 627e0685c..f3c25641a 100644 --- a/tests/clickhouse-reference/02531_semi_join_null_const_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02531_semi_join_null_const_bug.sql.expected.formatted.sql @@ -6,7 +6,7 @@ FROM SELECT toLowCardinality(0::UInt32) AS id GROUP BY [] ) AS a -LEFT JOIN ( +SEMI LEFT JOIN ( SELECT toLowCardinality(1::UInt64) AS id ) AS b USING (id); \ No newline at end of file diff --git a/tests/clickhouse-reference/02531_storage_join_null_44940.sql.expected.ast.json b/tests/clickhouse-reference/02531_storage_join_null_44940.sql.expected.ast.json index 7bd0bcd81..36dc9245d 100644 --- a/tests/clickhouse-reference/02531_storage_join_null_44940.sql.expected.ast.json +++ b/tests/clickhouse-reference/02531_storage_join_null_44940.sql.expected.ast.json @@ -231,7 +231,8 @@ "s" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] } diff --git a/tests/clickhouse-reference/02531_storage_join_null_44940.sql.expected.formatted.sql b/tests/clickhouse-reference/02531_storage_join_null_44940.sql.expected.formatted.sql index 1d86081c6..615fbd230 100644 --- a/tests/clickhouse-reference/02531_storage_join_null_44940.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02531_storage_join_null_44940.sql.expected.formatted.sql @@ -33,4 +33,4 @@ FULL JOIN full_join__fuzz_4 ORDER BY x DESC, str ASC, - s ASC; \ No newline at end of file + s ASC NULLS LAST; \ No newline at end of file diff --git a/tests/clickhouse-reference/02532_analyzer_aggregation_with_rollup.sql.expected.ast.json b/tests/clickhouse-reference/02532_analyzer_aggregation_with_rollup.sql.expected.ast.json index e7277fd00..a5efd1bed 100644 --- a/tests/clickhouse-reference/02532_analyzer_aggregation_with_rollup.sql.expected.ast.json +++ b/tests/clickhouse-reference/02532_analyzer_aggregation_with_rollup.sql.expected.ast.json @@ -207,6 +207,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -222,6 +223,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", diff --git a/tests/clickhouse-reference/02532_analyzer_aggregation_with_rollup.sql.expected.formatted.sql b/tests/clickhouse-reference/02532_analyzer_aggregation_with_rollup.sql.expected.formatted.sql index ba48166c6..8f35300cd 100644 --- a/tests/clickhouse-reference/02532_analyzer_aggregation_with_rollup.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02532_analyzer_aggregation_with_rollup.sql.expected.formatted.sql @@ -8,8 +8,8 @@ SELECT rank() OVER (PARTITION BY grouping(c.number) + grouping(b.number), multiIf(grouping(c.number) = 0, b.number, NULL) ORDER BY sum(a.number) DESC) AS r FROM numbers(10) AS a -CROSS JOIN numbers(10) AS b -CROSS JOIN numbers(10) AS c +, numbers(10) AS b +, numbers(10) AS c GROUP BY cn, bn diff --git a/tests/clickhouse-reference/02541_multiple_ignore_with_nested_select.sql.expected.ast.json b/tests/clickhouse-reference/02541_multiple_ignore_with_nested_select.sql.expected.ast.json index 800c166fd..ec31f8602 100644 --- a/tests/clickhouse-reference/02541_multiple_ignore_with_nested_select.sql.expected.ast.json +++ b/tests/clickhouse-reference/02541_multiple_ignore_with_nested_select.sql.expected.ast.json @@ -90,7 +90,8 @@ } ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -105,7 +106,8 @@ } ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -149,7 +151,8 @@ "number" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] } diff --git a/tests/clickhouse-reference/02541_multiple_ignore_with_nested_select.sql.expected.formatted.sql b/tests/clickhouse-reference/02541_multiple_ignore_with_nested_select.sql.expected.formatted.sql index af7b551f8..effe272ab 100644 --- a/tests/clickhouse-reference/02541_multiple_ignore_with_nested_select.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02541_multiple_ignore_with_nested_select.sql.expected.formatted.sql @@ -7,12 +7,12 @@ FROM ( number % 65536 AS number FROM numbers(2) ORDER BY - ignore(ignore(-1, 10.0001)) DESC, - ignore(2147483648) DESC, + ignore(ignore(-1, 10.0001)) DESC NULLS LAST, + ignore(2147483648) DESC NULLS FIRST, ignore(255, 0.0001) ASC, number ASC ) - ORDER BY number ASC + ORDER BY number ASC NULLS FIRST ) WHERE ignore(2147483648) ORDER BY number DESC; \ No newline at end of file diff --git a/tests/clickhouse-reference/02560_with_fill_int256_int.sql.expected.ast.json b/tests/clickhouse-reference/02560_with_fill_int256_int.sql.expected.ast.json index a3656a808..e3f40024c 100644 --- a/tests/clickhouse-reference/02560_with_fill_int256_int.sql.expected.ast.json +++ b/tests/clickhouse-reference/02560_with_fill_int256_int.sql.expected.ast.json @@ -44,6 +44,7 @@ "value": "1" }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -102,6 +103,7 @@ "value": "1" }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -160,6 +162,7 @@ "value": "1" }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -218,6 +221,7 @@ "value": "1" }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -276,6 +280,7 @@ "value": "1" }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "Int64", @@ -334,6 +339,7 @@ "value": "1" }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "Int64", @@ -392,6 +398,7 @@ "value": "1" }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "Int64", @@ -453,6 +460,7 @@ "value": "1" }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "Int64", diff --git a/tests/clickhouse-reference/02561_with_fill_date_datetime_incompatible.sql.expected.ast.json b/tests/clickhouse-reference/02561_with_fill_date_datetime_incompatible.sql.expected.ast.json index 02a83fce3..91d892a71 100644 --- a/tests/clickhouse-reference/02561_with_fill_date_datetime_incompatible.sql.expected.ast.json +++ b/tests/clickhouse-reference/02561_with_fill_date_datetime_incompatible.sql.expected.ast.json @@ -22,6 +22,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "binaryExpr", "op": "-", diff --git a/tests/clickhouse-reference/02562_with_fill_nullable.sql.expected.ast.json b/tests/clickhouse-reference/02562_with_fill_nullable.sql.expected.ast.json index 1f5694b0d..96309ac50 100644 --- a/tests/clickhouse-reference/02562_with_fill_nullable.sql.expected.ast.json +++ b/tests/clickhouse-reference/02562_with_fill_nullable.sql.expected.ast.json @@ -62,7 +62,8 @@ "d" ] }, - "direction": "ASC" + "direction": "ASC", + "withFill": true } ] }, @@ -156,7 +157,9 @@ "d" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false, + "withFill": true } ], "trailingComments": [ diff --git a/tests/clickhouse-reference/02562_with_fill_nullable.sql.expected.formatted.sql b/tests/clickhouse-reference/02562_with_fill_nullable.sql.expected.formatted.sql index c078f2f0c..e44224a65 100644 --- a/tests/clickhouse-reference/02562_with_fill_nullable.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02562_with_fill_nullable.sql.expected.formatted.sql @@ -1,9 +1,9 @@ SELECT toNullable('2023-02-09'::Date + number * 10) AS d FROM numbers(2) -ORDER BY d ASC; +ORDER BY d ASC WITH FILL; SELECT '---'; SELECT if(number % 2, NULL, toNullable('2023-02-09'::Date + number)) AS d FROM numbers(5) -ORDER BY d ASC; -- TODO: NULLS FIRST does not work correctly with FILL. \ No newline at end of file +ORDER BY d ASC NULLS LAST WITH FILL; -- TODO: NULLS FIRST does not work correctly with FILL. \ No newline at end of file diff --git a/tests/clickhouse-reference/02564_analyzer_cross_to_inner.sql.expected.ast.json b/tests/clickhouse-reference/02564_analyzer_cross_to_inner.sql.expected.ast.json index fed015180..6d3f2c50b 100644 --- a/tests/clickhouse-reference/02564_analyzer_cross_to_inner.sql.expected.ast.json +++ b/tests/clickhouse-reference/02564_analyzer_cross_to_inner.sql.expected.ast.json @@ -265,6 +265,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -272,6 +273,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -411,6 +413,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -418,6 +421,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -565,6 +569,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -572,6 +577,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -579,6 +585,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -586,6 +593,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t5" @@ -651,6 +659,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -658,6 +667,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -665,6 +675,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -672,6 +683,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t5" @@ -755,6 +767,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -762,6 +775,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -769,6 +783,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -776,6 +791,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t5" @@ -877,6 +893,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -884,6 +901,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -891,6 +909,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -898,6 +917,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t5" @@ -1108,6 +1128,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -1115,6 +1136,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -1261,6 +1283,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -1268,6 +1291,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -1421,6 +1445,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -1428,6 +1453,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -1554,6 +1580,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -1561,6 +1588,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -1568,6 +1596,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -1575,6 +1604,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t5" @@ -1654,6 +1684,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -1661,6 +1692,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -1668,6 +1700,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -1675,6 +1708,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t5" @@ -1772,6 +1806,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -1779,6 +1814,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -1786,6 +1822,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -1793,6 +1830,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t5" @@ -1908,6 +1946,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -1915,6 +1954,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t3" @@ -1922,6 +1962,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" @@ -1929,6 +1970,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t5" @@ -2137,6 +2179,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -2144,6 +2187,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { diff --git a/tests/clickhouse-reference/02564_analyzer_cross_to_inner.sql.expected.formatted.sql b/tests/clickhouse-reference/02564_analyzer_cross_to_inner.sql.expected.formatted.sql index 95d5b9686..88113ddbc 100644 --- a/tests/clickhouse-reference/02564_analyzer_cross_to_inner.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02564_analyzer_cross_to_inner.sql.expected.formatted.sql @@ -60,8 +60,8 @@ SET cross_to_inner_join_rewrite = 1; SELECT * FROM t1 -CROSS JOIN t2 -CROSS JOIN ( +, t2 +, ( SELECT a AS x FROM t3 WHERE a + 1 = b @@ -73,8 +73,8 @@ WHERE t1.a = if(t2.b > 0, t2.a, 0) SELECT * FROM t1 -CROSS JOIN t2 -CROSS JOIN ( +, t2 +, ( SELECT a AS x FROM t3 WHERE a + 1 = b @@ -88,20 +88,20 @@ ORDER BY SELECT * FROM t1 -CROSS JOIN t2 -CROSS JOIN t3 -CROSS JOIN t4 -CROSS JOIN t5 +, t2 +, t3 +, t4 +, t5 WHERE t2.a = t3.a AND t1.b = t5.b; SELECT * FROM t1 -CROSS JOIN t2 -CROSS JOIN t3 -CROSS JOIN t4 -CROSS JOIN t5 +, t2 +, t3 +, t4 +, t5 WHERE t2.a = t3.a AND t1.b = t5.b AND t4.a = t5.a; @@ -109,10 +109,10 @@ WHERE t2.a = t3.a SELECT * FROM t1 -CROSS JOIN t2 -CROSS JOIN t3 -CROSS JOIN t4 -CROSS JOIN t5 +, t2 +, t3 +, t4 +, t5 WHERE t1.a = t3.a AND t3.b = t4.b AND t1.a = t4.a @@ -121,10 +121,10 @@ WHERE t1.a = t3.a SELECT * FROM t1 -CROSS JOIN t2 -CROSS JOIN t3 -CROSS JOIN t4 -CROSS JOIN t5 +, t2 +, t3 +, t4 +, t5 WHERE t1.a = t2.a AND t1.a = t3.a AND t1.a = t4.a @@ -141,8 +141,8 @@ EXPLAIN QUERY TREE SELECT * FROM t1 -CROSS JOIN t2 -CROSS JOIN ( +, t2 +, ( SELECT a AS x FROM t3 WHERE a + 1 = b @@ -155,8 +155,8 @@ EXPLAIN QUERY TREE SELECT * FROM t1 -CROSS JOIN t2 -CROSS JOIN ( +, t2 +, ( SELECT a AS x FROM t3 WHERE a + 1 = b @@ -170,8 +170,8 @@ EXPLAIN QUERY TREE SELECT * FROM t1 -CROSS JOIN t2 -CROSS JOIN ( +, t2 +, ( SELECT a AS x FROM t3 WHERE a + 1 = b @@ -182,10 +182,10 @@ EXPLAIN QUERY TREE dump_ast = 1 SELECT * FROM t1 -CROSS JOIN t2 -CROSS JOIN t3 -CROSS JOIN t4 -CROSS JOIN t5 +, t2 +, t3 +, t4 +, t5 WHERE t2.a = t3.a AND t1.b = t5.b; @@ -193,10 +193,10 @@ EXPLAIN QUERY TREE dump_ast = 1 SELECT * FROM t1 -CROSS JOIN t2 -CROSS JOIN t3 -CROSS JOIN t4 -CROSS JOIN t5 +, t2 +, t3 +, t4 +, t5 WHERE t2.a = t3.a AND t1.b = t5.b AND t4.a = t5.a; @@ -205,10 +205,10 @@ EXPLAIN QUERY TREE dump_ast = 1 SELECT * FROM t1 -CROSS JOIN t2 -CROSS JOIN t3 -CROSS JOIN t4 -CROSS JOIN t5 +, t2 +, t3 +, t4 +, t5 WHERE t1.a = t3.a AND t3.b = t4.b AND t1.a = t4.a @@ -218,10 +218,10 @@ EXPLAIN QUERY TREE dump_ast = 1 SELECT * FROM t1 -CROSS JOIN t2 -CROSS JOIN t3 -CROSS JOIN t4 -CROSS JOIN t5 +, t2 +, t3 +, t4 +, t5 WHERE t1.a = t2.a AND t1.a = t3.a AND t1.a = t4.a @@ -237,8 +237,8 @@ WHERE t1.a = t2.a SELECT * FROM t1 -CROSS JOIN t2 -CROSS JOIN ( +, t2 +, ( SELECT a AS x FROM t3 WHERE a + 1 = b diff --git a/tests/clickhouse-reference/02564_analyzer_ssb_cross_to_inner.sql.expected.ast.json b/tests/clickhouse-reference/02564_analyzer_ssb_cross_to_inner.sql.expected.ast.json index e3f912647..be5424c1e 100644 --- a/tests/clickhouse-reference/02564_analyzer_ssb_cross_to_inner.sql.expected.ast.json +++ b/tests/clickhouse-reference/02564_analyzer_ssb_cross_to_inner.sql.expected.ast.json @@ -833,6 +833,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "customer" @@ -840,6 +841,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "supplier" @@ -847,6 +849,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "part" @@ -854,6 +857,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "lineorder" diff --git a/tests/clickhouse-reference/02564_analyzer_ssb_cross_to_inner.sql.expected.formatted.sql b/tests/clickhouse-reference/02564_analyzer_ssb_cross_to_inner.sql.expected.formatted.sql index 016e0973f..b77095faf 100644 --- a/tests/clickhouse-reference/02564_analyzer_ssb_cross_to_inner.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02564_analyzer_ssb_cross_to_inner.sql.expected.formatted.sql @@ -109,10 +109,10 @@ SELECT sum(LO_REVENUE - LO_SUPPLYCOST) AS profit FROM date -CROSS JOIN customer -CROSS JOIN supplier -CROSS JOIN part -CROSS JOIN lineorder +, customer +, supplier +, part +, lineorder WHERE LO_CUSTKEY = C_CUSTKEY AND LO_SUPPKEY = S_SUPPKEY AND LO_PARTKEY = P_PARTKEY diff --git a/tests/clickhouse-reference/02574_suspicious_low_cardinality_msan.sql.expected.ast.json b/tests/clickhouse-reference/02574_suspicious_low_cardinality_msan.sql.expected.ast.json index 857515970..c1182adf5 100644 --- a/tests/clickhouse-reference/02574_suspicious_low_cardinality_msan.sql.expected.ast.json +++ b/tests/clickhouse-reference/02574_suspicious_low_cardinality_msan.sql.expected.ast.json @@ -429,7 +429,8 @@ "value": "1023" } }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -448,7 +449,8 @@ "value": "2147483646" } }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -510,7 +512,8 @@ } ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ] }, diff --git a/tests/clickhouse-reference/02574_suspicious_low_cardinality_msan.sql.expected.formatted.sql b/tests/clickhouse-reference/02574_suspicious_low_cardinality_msan.sql.expected.formatted.sql index 51c770655..c6cd13193 100644 --- a/tests/clickhouse-reference/02574_suspicious_low_cardinality_msan.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02574_suspicious_low_cardinality_msan.sql.expected.formatted.sql @@ -31,9 +31,9 @@ SELECT 2147483646 FROM table1__fuzz_19 ORDER BY - ((((id % 1048577) = 1024)) % id) = 1023 DESC, - id % 2147483646 ASC, + ((((id % 1048577) = 1024)) % id) = 1023 DESC NULLS FIRST, + id % 2147483646 ASC NULLS FIRST, ((id % 1) = 9223372036854775807) - OR ((id % NULL) = 257) DESC; + OR ((id % NULL) = 257) DESC NULLS FIRST; DROP TABLE table1__fuzz_19; \ No newline at end of file diff --git a/tests/clickhouse-reference/02579_fill_empty_chunk.sql.expected.ast.json b/tests/clickhouse-reference/02579_fill_empty_chunk.sql.expected.ast.json index cd5d2c576..106738acf 100644 --- a/tests/clickhouse-reference/02579_fill_empty_chunk.sql.expected.ast.json +++ b/tests/clickhouse-reference/02579_fill_empty_chunk.sql.expected.ast.json @@ -113,6 +113,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", diff --git a/tests/clickhouse-reference/02579_fill_empty_chunk_analyzer.sql.expected.ast.json b/tests/clickhouse-reference/02579_fill_empty_chunk_analyzer.sql.expected.ast.json index 1a673bf40..5ef078343 100644 --- a/tests/clickhouse-reference/02579_fill_empty_chunk_analyzer.sql.expected.ast.json +++ b/tests/clickhouse-reference/02579_fill_empty_chunk_analyzer.sql.expected.ast.json @@ -113,6 +113,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", diff --git a/tests/clickhouse-reference/02582_analyzer_join_subquery_empty_column_list.sql.expected.ast.json b/tests/clickhouse-reference/02582_analyzer_join_subquery_empty_column_list.sql.expected.ast.json index d4ee606ae..9d676343e 100644 --- a/tests/clickhouse-reference/02582_analyzer_join_subquery_empty_column_list.sql.expected.ast.json +++ b/tests/clickhouse-reference/02582_analyzer_join_subquery_empty_column_list.sql.expected.ast.json @@ -43,6 +43,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -125,6 +126,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -185,6 +187,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -292,6 +295,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -410,6 +414,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -528,6 +533,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -635,6 +641,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -741,6 +748,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -847,6 +855,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { diff --git a/tests/clickhouse-reference/02582_analyzer_join_subquery_empty_column_list.sql.expected.formatted.sql b/tests/clickhouse-reference/02582_analyzer_join_subquery_empty_column_list.sql.expected.formatted.sql index bc0697401..bcb7a48d5 100644 --- a/tests/clickhouse-reference/02582_analyzer_join_subquery_empty_column_list.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02582_analyzer_join_subquery_empty_column_list.sql.expected.formatted.sql @@ -6,7 +6,7 @@ FROM ( SELECT 1 AS a ) AS t1 -CROSS JOIN ( +, ( SELECT 2 AS b, 3 AS c @@ -19,7 +19,7 @@ FROM UNION ALL SELECT 1 AS a ) AS t1 -CROSS JOIN ( +, ( SELECT 2 AS b, 3 AS c @@ -30,7 +30,7 @@ FROM ( SELECT 1 AS a ) AS t1 -CROSS JOIN ( +, ( SELECT 2 AS b, 3 AS c @@ -47,7 +47,7 @@ FROM UNION ALL SELECT 1 AS a ) AS t1 -CROSS JOIN ( +, ( SELECT 2 AS b, 3 AS c @@ -67,7 +67,7 @@ FROM SELECT 1 AS a ) ) AS t1 -CROSS JOIN ( +, ( SELECT * FROM ( SELECT @@ -87,7 +87,7 @@ FROM UNION ALL SELECT 1 AS a ) AS t1 -CROSS JOIN ( +, ( SELECT 2 AS b, 3 AS c @@ -104,7 +104,7 @@ FROM UNION ALL SELECT 1 AS a ) AS t1 -CROSS JOIN ( +, ( SELECT 2 AS b, 3 AS c @@ -121,7 +121,7 @@ FROM UNION ALL SELECT 1 AS a ) AS t1 -CROSS JOIN ( +, ( SELECT 2 AS b, 3 AS c @@ -138,7 +138,7 @@ FROM UNION ALL SELECT 1 AS a ) AS t1 -CROSS JOIN ( +, ( SELECT 2 AS b, 3 AS c diff --git a/tests/clickhouse-reference/02662_first_last_value.sql.expected.ast.json b/tests/clickhouse-reference/02662_first_last_value.sql.expected.ast.json index 03761808a..90cfb6908 100644 --- a/tests/clickhouse-reference/02662_first_last_value.sql.expected.ast.json +++ b/tests/clickhouse-reference/02662_first_last_value.sql.expected.ast.json @@ -115,7 +115,8 @@ "b" ] } - ] + ], + "nullsAction": "IGNORE NULLS" } ], "from": { @@ -136,7 +137,8 @@ "b" ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { @@ -181,7 +183,8 @@ "b" ] } - ] + ], + "nullsAction": "IGNORE NULLS" } ], "from": { @@ -202,7 +205,8 @@ "b" ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { diff --git a/tests/clickhouse-reference/02662_first_last_value.sql.expected.formatted.sql b/tests/clickhouse-reference/02662_first_last_value.sql.expected.formatted.sql index 9e41ec1ca..6fa8ffcf6 100644 --- a/tests/clickhouse-reference/02662_first_last_value.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02662_first_last_value.sql.expected.formatted.sql @@ -15,20 +15,20 @@ INSERT INTO test (a, b); SELECT first_value(b) FROM test; -SELECT first_value(b) +SELECT first_value(b) IGNORE NULLS FROM test; -SELECT first_value(b) +SELECT first_value(b) RESPECT NULLS FROM test; -- last value SELECT last_value(b) FROM test; -SELECT last_value(b) +SELECT last_value(b) IGNORE NULLS FROM test; -SELECT last_value(b) +SELECT last_value(b) RESPECT NULLS FROM test; SET enable_analyzer = 1; \ No newline at end of file diff --git a/tests/clickhouse-reference/02695_storage_join_insert_select_deadlock.sql.expected.ast.json b/tests/clickhouse-reference/02695_storage_join_insert_select_deadlock.sql.expected.ast.json index 04c945774..121987208 100644 --- a/tests/clickhouse-reference/02695_storage_join_insert_select_deadlock.sql.expected.ast.json +++ b/tests/clickhouse-reference/02695_storage_join_insert_select_deadlock.sql.expected.ast.json @@ -135,7 +135,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" } }, "trailingComments": [ @@ -218,7 +219,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" } }, "trailingComments": [ diff --git a/tests/clickhouse-reference/02695_storage_join_insert_select_deadlock.sql.expected.formatted.sql b/tests/clickhouse-reference/02695_storage_join_insert_select_deadlock.sql.expected.formatted.sql index 91d8d22b5..bad2d7f1e 100644 --- a/tests/clickhouse-reference/02695_storage_join_insert_select_deadlock.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02695_storage_join_insert_select_deadlock.sql.expected.formatted.sql @@ -17,7 +17,7 @@ FROM ( SELECT 1 AS id ) AS t1 -LEFT JOIN test_table_join +ANY LEFT JOIN test_table_join USING (id); -- { serverError DEADLOCK_AVOIDED } INSERT INTO test_table_join SELECT @@ -27,7 +27,7 @@ FROM ( SELECT 1 AS id ) AS t1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT id FROM test_table_join ) AS t2 diff --git a/tests/clickhouse-reference/02719_aggregate_with_empty_string_key.sql.expected.ast.json b/tests/clickhouse-reference/02719_aggregate_with_empty_string_key.sql.expected.ast.json index a7c7f8650..bb9606cf3 100644 --- a/tests/clickhouse-reference/02719_aggregate_with_empty_string_key.sql.expected.ast.json +++ b/tests/clickhouse-reference/02719_aggregate_with_empty_string_key.sql.expected.ast.json @@ -109,7 +109,8 @@ "str" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, diff --git a/tests/clickhouse-reference/02719_aggregate_with_empty_string_key.sql.expected.formatted.sql b/tests/clickhouse-reference/02719_aggregate_with_empty_string_key.sql.expected.formatted.sql index f1fa8a858..57487f964 100644 --- a/tests/clickhouse-reference/02719_aggregate_with_empty_string_key.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02719_aggregate_with_empty_string_key.sql.expected.formatted.sql @@ -16,6 +16,6 @@ SELECT max(i) FROM test GROUP BY str -ORDER BY str ASC; +ORDER BY str ASC NULLS FIRST; DROP TABLE test; \ No newline at end of file diff --git a/tests/clickhouse-reference/02724_function_in_left_table_clause_asof_join.sql.expected.ast.json b/tests/clickhouse-reference/02724_function_in_left_table_clause_asof_join.sql.expected.ast.json index 4d6bbae0e..cb2a7012c 100644 --- a/tests/clickhouse-reference/02724_function_in_left_table_clause_asof_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/02724_function_in_left_table_clause_asof_join.sql.expected.ast.json @@ -165,7 +165,8 @@ } ] } - } + }, + "strictness": "ASOF" } }, { @@ -334,7 +335,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "settings": [ { diff --git a/tests/clickhouse-reference/02724_function_in_left_table_clause_asof_join.sql.expected.formatted.sql b/tests/clickhouse-reference/02724_function_in_left_table_clause_asof_join.sql.expected.formatted.sql index 4e873c98f..68aa110a0 100644 --- a/tests/clickhouse-reference/02724_function_in_left_table_clause_asof_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02724_function_in_left_table_clause_asof_join.sql.expected.formatted.sql @@ -5,7 +5,7 @@ FROM 1 AS id, [1, 2, 3] AS arr ) AS sessions -LEFT JOIN ( +ASOF LEFT JOIN ( SELECT 1 AS session_id, 4 AS id @@ -20,7 +20,7 @@ FROM 1 AS id, [1, 2, 3] AS arr ) AS sessions -LEFT JOIN ( +ASOF LEFT JOIN ( SELECT 1 AS session_id, 4 AS id diff --git a/tests/clickhouse-reference/02724_mutliple_storage_join.sql.expected.ast.json b/tests/clickhouse-reference/02724_mutliple_storage_join.sql.expected.ast.json index c1b57e225..f7cfa1b78 100644 --- a/tests/clickhouse-reference/02724_mutliple_storage_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/02724_mutliple_storage_join.sql.expected.ast.json @@ -226,7 +226,8 @@ ] } } - } + }, + "strictness": "ANY" } } } @@ -275,7 +276,8 @@ ] } } - } + }, + "strictness": "ANY" }, "kind": "joinExpr", "joinType": "LEFT", @@ -302,7 +304,8 @@ ] } } - } + }, + "strictness": "ANY" } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/02724_mutliple_storage_join.sql.expected.formatted.sql b/tests/clickhouse-reference/02724_mutliple_storage_join.sql.expected.formatted.sql index 9a7270beb..538095acd 100644 --- a/tests/clickhouse-reference/02724_mutliple_storage_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02724_mutliple_storage_join.sql.expected.formatted.sql @@ -34,14 +34,14 @@ FROM ( user.id AS uuu FROM `order` - LEFT JOIN user + ANY LEFT JOIN user ON uId = uuu ); SELECT ignore(*) FROM `order` -LEFT JOIN user +ANY LEFT JOIN user ON uId = user.id -LEFT JOIN product +ANY LEFT JOIN product ON pId = product.id; \ No newline at end of file diff --git a/tests/clickhouse-reference/02725_any_join_single_row.sql.expected.ast.json b/tests/clickhouse-reference/02725_any_join_single_row.sql.expected.ast.json index 8350ca61d..bd5a733fe 100644 --- a/tests/clickhouse-reference/02725_any_join_single_row.sql.expected.ast.json +++ b/tests/clickhouse-reference/02725_any_join_single_row.sql.expected.ast.json @@ -673,7 +673,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -790,7 +791,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -856,7 +858,8 @@ ] } } - } + }, + "strictness": "ANY" } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/02725_any_join_single_row.sql.expected.formatted.sql b/tests/clickhouse-reference/02725_any_join_single_row.sql.expected.formatted.sql index d9879f16c..3e112d09b 100644 --- a/tests/clickhouse-reference/02725_any_join_single_row.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02725_any_join_single_row.sql.expected.formatted.sql @@ -86,7 +86,7 @@ FROM ( SELECT 1 AS key ) AS t1 -RIGHT JOIN join_test_right +ANY RIGHT JOIN join_test_right ON t1.key = join_test_right.key; INSERT INTO join_test_right (key, value) SELECT @@ -99,7 +99,7 @@ FROM ( SELECT 1 AS key ) AS t1 -RIGHT JOIN join_test_right +ANY RIGHT JOIN join_test_right ON t1.key = join_test_right.key; SELECT count() == 10 @@ -107,5 +107,5 @@ FROM ( SELECT 2 AS key ) AS t1 -RIGHT JOIN join_test_right +ANY RIGHT JOIN join_test_right ON t1.key = join_test_right.key; \ No newline at end of file diff --git a/tests/clickhouse-reference/02730_with_fill_by_sorting_prefix.sql.expected.ast.json b/tests/clickhouse-reference/02730_with_fill_by_sorting_prefix.sql.expected.ast.json index 0646b7280..9ad8c5b10 100644 --- a/tests/clickhouse-reference/02730_with_fill_by_sorting_prefix.sql.expected.ast.json +++ b/tests/clickhouse-reference/02730_with_fill_by_sorting_prefix.sql.expected.ast.json @@ -55,6 +55,7 @@ ] }, "direction": "DESC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -181,6 +182,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "literal", "type": "UInt64", @@ -260,6 +262,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "literal", "type": "UInt64", @@ -332,6 +335,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "literal", "type": "UInt64", @@ -381,6 +385,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -444,6 +449,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -513,6 +519,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -575,6 +582,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -644,6 +652,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -702,6 +711,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -766,6 +776,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -823,6 +834,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -887,6 +899,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillTo": { "kind": "literal", "type": "UInt64", @@ -945,6 +958,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillTo": { "kind": "literal", "type": "UInt64", @@ -1009,6 +1023,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillTo": { "kind": "literal", "type": "UInt64", @@ -1066,6 +1081,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillTo": { "kind": "literal", "type": "UInt64", @@ -1140,6 +1156,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", diff --git a/tests/clickhouse-reference/02735_asof_join_right_null.sql.expected.ast.json b/tests/clickhouse-reference/02735_asof_join_right_null.sql.expected.ast.json index d6af786e0..4b4ed15f5 100644 --- a/tests/clickhouse-reference/02735_asof_join_right_null.sql.expected.ast.json +++ b/tests/clickhouse-reference/02735_asof_join_right_null.sql.expected.ast.json @@ -141,7 +141,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -222,7 +223,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -300,7 +302,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -378,7 +381,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -456,7 +460,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -534,7 +539,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -612,7 +618,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -690,7 +697,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/02735_asof_join_right_null.sql.expected.formatted.sql b/tests/clickhouse-reference/02735_asof_join_right_null.sql.expected.formatted.sql index 6db0e7c3d..24b79e91e 100644 --- a/tests/clickhouse-reference/02735_asof_join_right_null.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02735_asof_join_right_null.sql.expected.formatted.sql @@ -20,7 +20,7 @@ INSERT INTO t2; SELECT * FROM t1 -INNER JOIN t2 +ASOF INNER JOIN t2 ON t1.a = t2.a AND t1.b < t2.b ORDER BY t1.b ASC; @@ -28,7 +28,7 @@ ORDER BY t1.b ASC; SELECT * FROM t1 -INNER JOIN t2 +ASOF INNER JOIN t2 ON t1.a = t2.a AND t1.b <= t2.b ORDER BY t1.b ASC; @@ -36,7 +36,7 @@ ORDER BY t1.b ASC; SELECT * FROM t1 -INNER JOIN t2 +ASOF INNER JOIN t2 ON t1.a = t2.a AND t1.b > t2.b ORDER BY t1.b ASC; @@ -44,7 +44,7 @@ ORDER BY t1.b ASC; SELECT * FROM t1 -INNER JOIN t2 +ASOF INNER JOIN t2 ON t1.a = t2.a AND t1.b >= t2.b ORDER BY t1.b ASC; @@ -52,7 +52,7 @@ ORDER BY t1.b ASC; SELECT * FROM t1 -LEFT JOIN t2 +ASOF LEFT JOIN t2 ON t1.a = t2.a AND t1.b < t2.b ORDER BY t1.b ASC; @@ -60,7 +60,7 @@ ORDER BY t1.b ASC; SELECT * FROM t1 -LEFT JOIN t2 +ASOF LEFT JOIN t2 ON t1.a = t2.a AND t1.b <= t2.b ORDER BY t1.b ASC; @@ -68,7 +68,7 @@ ORDER BY t1.b ASC; SELECT * FROM t1 -LEFT JOIN t2 +ASOF LEFT JOIN t2 ON t1.a = t2.a AND t1.b > t2.b ORDER BY t1.b ASC; @@ -76,7 +76,7 @@ ORDER BY t1.b ASC; SELECT * FROM t1 -LEFT JOIN t2 +ASOF LEFT JOIN t2 ON t1.a = t2.a AND t1.b >= t2.b ORDER BY t1.b ASC; diff --git a/tests/clickhouse-reference/02746_index_analysis_binary_operator_with_null.sql.expected.ast.json b/tests/clickhouse-reference/02746_index_analysis_binary_operator_with_null.sql.expected.ast.json index 8313002ef..fcbe5198f 100644 --- a/tests/clickhouse-reference/02746_index_analysis_binary_operator_with_null.sql.expected.ast.json +++ b/tests/clickhouse-reference/02746_index_analysis_binary_operator_with_null.sql.expected.ast.json @@ -206,7 +206,8 @@ } ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -216,7 +217,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, diff --git a/tests/clickhouse-reference/02746_index_analysis_binary_operator_with_null.sql.expected.formatted.sql b/tests/clickhouse-reference/02746_index_analysis_binary_operator_with_null.sql.expected.formatted.sql index 999ac94a8..5a9cf5119 100644 --- a/tests/clickhouse-reference/02746_index_analysis_binary_operator_with_null.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02746_index_analysis_binary_operator_with_null.sql.expected.formatted.sql @@ -12,7 +12,7 @@ FROM tab WHERE ((x + CAST('1', 'Nullable(UInt8)')) <= 2) AND ((x + CAST('', 'Nullable(UInt8)')) <= 256) ORDER BY - toDateTime(toDateTime(-2, NULL, NULL) + 100.0001, NULL, -2, NULL) DESC, - x ASC; + toDateTime(toDateTime(-2, NULL, NULL) + 100.0001, NULL, -2, NULL) DESC NULLS LAST, + x ASC NULLS LAST; DROP TABLE tab; \ No newline at end of file diff --git a/tests/clickhouse-reference/02751_parallel_replicas_bug_chunkinfo_not_set.sql.expected.ast.json b/tests/clickhouse-reference/02751_parallel_replicas_bug_chunkinfo_not_set.sql.expected.ast.json index 4f9e2384d..dd19632d5 100644 --- a/tests/clickhouse-reference/02751_parallel_replicas_bug_chunkinfo_not_set.sql.expected.ast.json +++ b/tests/clickhouse-reference/02751_parallel_replicas_bug_chunkinfo_not_set.sql.expected.ast.json @@ -403,7 +403,8 @@ "value2" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ], "limit": { diff --git a/tests/clickhouse-reference/02751_parallel_replicas_bug_chunkinfo_not_set.sql.expected.formatted.sql b/tests/clickhouse-reference/02751_parallel_replicas_bug_chunkinfo_not_set.sql.expected.formatted.sql index a67ae692e..9e7839359 100644 --- a/tests/clickhouse-reference/02751_parallel_replicas_bug_chunkinfo_not_set.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02751_parallel_replicas_bug_chunkinfo_not_set.sql.expected.formatted.sql @@ -39,6 +39,6 @@ WITH ROLLUP ORDER BY key ASC, value1 ASC, - value2 ASC + value2 ASC NULLS LAST LIMIT 10 FORMAT Null; \ No newline at end of file diff --git a/tests/clickhouse-reference/02769_compare_functions_nan.sql.expected.ast.json b/tests/clickhouse-reference/02769_compare_functions_nan.sql.expected.ast.json index ad7e18dad..08ad9fecc 100644 --- a/tests/clickhouse-reference/02769_compare_functions_nan.sql.expected.ast.json +++ b/tests/clickhouse-reference/02769_compare_functions_nan.sql.expected.ast.json @@ -944,6 +944,7 @@ ] } ], + "windowName": "test_window", "parenthesized": true }, "alias": "value" @@ -1135,7 +1136,8 @@ }, "parenthesized": true } - } + }, + "strictness": "ANTI" }, "where": { "kind": "naryExpr", diff --git a/tests/clickhouse-reference/02769_compare_functions_nan.sql.expected.formatted.sql b/tests/clickhouse-reference/02769_compare_functions_nan.sql.expected.formatted.sql index d9953302c..5ccefc4c5 100644 --- a/tests/clickhouse-reference/02769_compare_functions_nan.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02769_compare_functions_nan.sql.expected.formatted.sql @@ -83,7 +83,7 @@ INSERT INTO test_table; SELECT value FROM ( - SELECT (corr(value_1, value_1)) AS value + SELECT (corr(value_1, value_1) OVER test_window) AS value FROM test_table WINDOW test_window AS (PARTITION BY value_2 ORDER BY id ASC) ) AS subquery @@ -106,7 +106,7 @@ FROM FROM test_table GROUP BY value ) AS subquery -LEFT JOIN test_table +ANTI LEFT JOIN test_table ON (subquery.corr_value = test_table.id) WHERE (test_table.id >= test_table.id) AND (NOT test_table.id >= test_table.id); \ No newline at end of file diff --git a/tests/clickhouse-reference/02772_jit_date_time_add.sql.expected.ast.json b/tests/clickhouse-reference/02772_jit_date_time_add.sql.expected.ast.json index 0f1e5d079..c83be8c66 100644 --- a/tests/clickhouse-reference/02772_jit_date_time_add.sql.expected.ast.json +++ b/tests/clickhouse-reference/02772_jit_date_time_add.sql.expected.ast.json @@ -140,7 +140,8 @@ "result" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ], "format": "Null", @@ -268,7 +269,8 @@ "result" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ], "format": "Null" diff --git a/tests/clickhouse-reference/02772_jit_date_time_add.sql.expected.formatted.sql b/tests/clickhouse-reference/02772_jit_date_time_add.sql.expected.formatted.sql index a451f97d5..3a92a5a8f 100644 --- a/tests/clickhouse-reference/02772_jit_date_time_add.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02772_jit_date_time_add.sql.expected.formatted.sql @@ -8,7 +8,7 @@ FROM ( FROM `system`.numbers LIMIT 1048576 ) -ORDER BY result DESC +ORDER BY result DESC NULLS FIRST FORMAT Null; -- { serverError DECIMAL_OVERFLOW } SELECT DISTINCT result @@ -17,7 +17,7 @@ FROM ( FROM `system`.numbers LIMIT 1048576 ) -ORDER BY result DESC +ORDER BY result DESC NULLS FIRST FORMAT Null; SELECT round(round(round(round(round(100)), round(round(round(round(NULL), round(65535)), like(toTypeName(now() + 9223372036854775807), 'DateTime%DateTime%DateTime%DateTime%'), round(-2)), 255), round(NULL)))); \ No newline at end of file diff --git a/tests/clickhouse-reference/02785_global_join_too_many_columns.sql.expected.ast.json b/tests/clickhouse-reference/02785_global_join_too_many_columns.sql.expected.ast.json index 1a086e17f..2059cba23 100644 --- a/tests/clickhouse-reference/02785_global_join_too_many_columns.sql.expected.ast.json +++ b/tests/clickhouse-reference/02785_global_join_too_many_columns.sql.expected.ast.json @@ -212,7 +212,9 @@ ] } } - } + }, + "strictness": "ALL", + "global": true } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/02785_global_join_too_many_columns.sql.expected.formatted.sql b/tests/clickhouse-reference/02785_global_join_too_many_columns.sql.expected.formatted.sql index a48e1e012..6b386179b 100644 --- a/tests/clickhouse-reference/02785_global_join_too_many_columns.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02785_global_join_too_many_columns.sql.expected.formatted.sql @@ -26,5 +26,5 @@ SET max_columns_to_read = 1; SELECT count() FROM distr AS l -LEFT JOIN distr AS r +GLOBAL ALL LEFT JOIN distr AS r ON l.a = r.a; \ No newline at end of file diff --git a/tests/clickhouse-reference/02785_left_anti_join_bug.sql.expected.ast.json b/tests/clickhouse-reference/02785_left_anti_join_bug.sql.expected.ast.json index 07b1f1d49..0f556eadb 100644 --- a/tests/clickhouse-reference/02785_left_anti_join_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/02785_left_anti_join_bug.sql.expected.ast.json @@ -270,7 +270,8 @@ ] } } - } + }, + "strictness": "ANTI" }, "format": "Null" } diff --git a/tests/clickhouse-reference/02785_left_anti_join_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/02785_left_anti_join_bug.sql.expected.formatted.sql index d624eb127..001c666b6 100644 --- a/tests/clickhouse-reference/02785_left_anti_join_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02785_left_anti_join_bug.sql.expected.formatted.sql @@ -36,6 +36,6 @@ FROM FROM test_table__fuzz_3 GROUP BY value ) AS subquery -LEFT JOIN test_table +ANTI LEFT JOIN test_table ON subquery.corr_value = test_table.id FORMAT Null; \ No newline at end of file diff --git a/tests/clickhouse-reference/02831_ast_fuzz_asan_join.sql.expected.ast.json b/tests/clickhouse-reference/02831_ast_fuzz_asan_join.sql.expected.ast.json index c50382414..563691899 100644 --- a/tests/clickhouse-reference/02831_ast_fuzz_asan_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/02831_ast_fuzz_asan_join.sql.expected.ast.json @@ -169,7 +169,8 @@ "type": "Float64", "value": "inf" }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -180,7 +181,8 @@ "k" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", diff --git a/tests/clickhouse-reference/02831_ast_fuzz_asan_join.sql.expected.formatted.sql b/tests/clickhouse-reference/02831_ast_fuzz_asan_join.sql.expected.formatted.sql index 033127683..133e6c0aa 100644 --- a/tests/clickhouse-reference/02831_ast_fuzz_asan_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02831_ast_fuzz_asan_join.sql.expected.formatted.sql @@ -16,7 +16,7 @@ FULL JOIN ( ) AS js2 ON js1.k = js2.k ORDER BY - inf DESC, - js1.k ASC, + inf DESC NULLS FIRST, + js1.k ASC NULLS LAST, js2.k ASC FORMAT Null; \ No newline at end of file diff --git a/tests/clickhouse-reference/02834_nulls_first_sort.sql.expected.ast.json b/tests/clickhouse-reference/02834_nulls_first_sort.sql.expected.ast.json index b7b21907b..0ba02221d 100644 --- a/tests/clickhouse-reference/02834_nulls_first_sort.sql.expected.ast.json +++ b/tests/clickhouse-reference/02834_nulls_first_sort.sql.expected.ast.json @@ -95,7 +95,8 @@ "a" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -105,7 +106,8 @@ "b" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -115,7 +117,8 @@ "c" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ], "limit": { diff --git a/tests/clickhouse-reference/02834_nulls_first_sort.sql.expected.formatted.sql b/tests/clickhouse-reference/02834_nulls_first_sort.sql.expected.formatted.sql index 7664f56da..ac937a717 100644 --- a/tests/clickhouse-reference/02834_nulls_first_sort.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02834_nulls_first_sort.sql.expected.formatted.sql @@ -13,9 +13,9 @@ INSERT INTO nulls_first_sort_test; SELECT * FROM nulls_first_sort_test ORDER BY - a ASC, - b ASC, - c ASC + a ASC NULLS FIRST, + b ASC NULLS FIRST, + c ASC NULLS FIRST LIMIT 5; DROP TABLE nulls_first_sort_test; \ No newline at end of file diff --git a/tests/clickhouse-reference/02835_fuzz_remove_redundant_sorting.sql.expected.ast.json b/tests/clickhouse-reference/02835_fuzz_remove_redundant_sorting.sql.expected.ast.json index 032d1995d..7b602b701 100644 --- a/tests/clickhouse-reference/02835_fuzz_remove_redundant_sorting.sql.expected.ast.json +++ b/tests/clickhouse-reference/02835_fuzz_remove_redundant_sorting.sql.expected.ast.json @@ -154,7 +154,8 @@ "number" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ] } @@ -182,7 +183,8 @@ "k" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ], "limit": { diff --git a/tests/clickhouse-reference/02835_fuzz_remove_redundant_sorting.sql.expected.formatted.sql b/tests/clickhouse-reference/02835_fuzz_remove_redundant_sorting.sql.expected.formatted.sql index 01dbfe96e..c04463d0b 100644 --- a/tests/clickhouse-reference/02835_fuzz_remove_redundant_sorting.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02835_fuzz_remove_redundant_sorting.sql.expected.formatted.sql @@ -17,9 +17,9 @@ FROM ( FROM remote('127.0.0.{2,3}', currentDatabase(), numbers500k) PREWHERE 31 WHERE 65537 > 0 - ORDER BY number DESC + ORDER BY number DESC NULLS FIRST ) GROUP BY GROUPING SETS ((k)) WITH TOTALS -ORDER BY k ASC +ORDER BY k ASC NULLS LAST LIMIT 2147483648; \ No newline at end of file diff --git a/tests/clickhouse-reference/02835_join_step_explain.sql.expected.ast.json b/tests/clickhouse-reference/02835_join_step_explain.sql.expected.ast.json index cc4496c59..ed470b8e3 100644 --- a/tests/clickhouse-reference/02835_join_step_explain.sql.expected.ast.json +++ b/tests/clickhouse-reference/02835_join_step_explain.sql.expected.ast.json @@ -383,7 +383,8 @@ } ] } - } + }, + "strictness": "ASOF" } } }, diff --git a/tests/clickhouse-reference/02835_join_step_explain.sql.expected.formatted.sql b/tests/clickhouse-reference/02835_join_step_explain.sql.expected.formatted.sql index 588f04d55..836a14ec2 100644 --- a/tests/clickhouse-reference/02835_join_step_explain.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02835_join_step_explain.sql.expected.formatted.sql @@ -53,7 +53,7 @@ SELECT rhs.value_1 FROM test_table_1 AS lhs -INNER JOIN test_table_2 AS rhs +ASOF INNER JOIN test_table_2 AS rhs ON lhs.id = rhs.id AND lhs.value_2 < rhs.value_2; diff --git a/tests/clickhouse-reference/02861_interpolate_alias_precedence.sql.expected.ast.json b/tests/clickhouse-reference/02861_interpolate_alias_precedence.sql.expected.ast.json index 24eb28583..744afb411 100644 --- a/tests/clickhouse-reference/02861_interpolate_alias_precedence.sql.expected.ast.json +++ b/tests/clickhouse-reference/02861_interpolate_alias_precedence.sql.expected.ast.json @@ -121,6 +121,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toIntervalDay", diff --git a/tests/clickhouse-reference/02863_interpolate_subquery.sql.expected.ast.json b/tests/clickhouse-reference/02863_interpolate_subquery.sql.expected.ast.json index ef583ca2c..4483c0ffd 100644 --- a/tests/clickhouse-reference/02863_interpolate_subquery.sql.expected.ast.json +++ b/tests/clickhouse-reference/02863_interpolate_subquery.sql.expected.ast.json @@ -99,6 +99,7 @@ ] }, "direction": "ASC", + "withFill": true, "interpolate": [ { "col": "col1", diff --git a/tests/clickhouse-reference/02884_parallel_window_functions_bug.sql.expected.ast.json b/tests/clickhouse-reference/02884_parallel_window_functions_bug.sql.expected.ast.json index 75573d034..9b5b12fb2 100644 --- a/tests/clickhouse-reference/02884_parallel_window_functions_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/02884_parallel_window_functions_bug.sql.expected.ast.json @@ -851,7 +851,8 @@ "post_id", "row_num" ] - } + }, + "global": true }, "where": { "kind": "naryExpr", diff --git a/tests/clickhouse-reference/02884_parallel_window_functions_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/02884_parallel_window_functions_bug.sql.expected.formatted.sql index 130d8e942..f0537733a 100644 --- a/tests/clickhouse-reference/02884_parallel_window_functions_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02884_parallel_window_functions_bug.sql.expected.formatted.sql @@ -74,7 +74,7 @@ FROM ( ntile(20) OVER (PARTITION BY page_id ORDER BY clicks ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED PRECEDING) AS rank FROM as_of_posts - LEFT JOIN as_of_post_metrics + GLOBAL LEFT JOIN as_of_post_metrics USING (page_id, post_id, row_num) WHERE (row_num = 1) AND (impressions > 0) diff --git a/tests/clickhouse-reference/02901_analyzer_recursive_window.sql.expected.ast.json b/tests/clickhouse-reference/02901_analyzer_recursive_window.sql.expected.ast.json index 6b39120a7..91c7af811 100644 --- a/tests/clickhouse-reference/02901_analyzer_recursive_window.sql.expected.ast.json +++ b/tests/clickhouse-reference/02901_analyzer_recursive_window.sql.expected.ast.json @@ -83,7 +83,8 @@ { "kind": "functionCall", "name": "count", - "args": [] + "args": [], + "windowName": "dummy" } ], "windows": [ diff --git a/tests/clickhouse-reference/02901_analyzer_recursive_window.sql.expected.formatted.sql b/tests/clickhouse-reference/02901_analyzer_recursive_window.sql.expected.formatted.sql index 6bbd9940f..2ba18ab42 100644 --- a/tests/clickhouse-reference/02901_analyzer_recursive_window.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02901_analyzer_recursive_window.sql.expected.formatted.sql @@ -7,5 +7,5 @@ WINDOW x AS (PARTITION BY dummy); SELECT 1 WINDOW dummy AS (PARTITION BY dummy); -SELECT count() +SELECT count() OVER dummy WINDOW dummy AS (PARTITION BY dummy); \ No newline at end of file diff --git a/tests/clickhouse-reference/02911_analyzer_order_by_read_in_order_query_plan.sql.expected.ast.json b/tests/clickhouse-reference/02911_analyzer_order_by_read_in_order_query_plan.sql.expected.ast.json index d46946178..4ced4512d 100644 --- a/tests/clickhouse-reference/02911_analyzer_order_by_read_in_order_query_plan.sql.expected.ast.json +++ b/tests/clickhouse-reference/02911_analyzer_order_by_read_in_order_query_plan.sql.expected.ast.json @@ -740,7 +740,8 @@ } ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ] }, @@ -833,7 +834,8 @@ } ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ] } @@ -3213,7 +3215,8 @@ } ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ] } diff --git a/tests/clickhouse-reference/02911_analyzer_order_by_read_in_order_query_plan.sql.expected.formatted.sql b/tests/clickhouse-reference/02911_analyzer_order_by_read_in_order_query_plan.sql.expected.formatted.sql index fc24a91d3..366461965 100644 --- a/tests/clickhouse-reference/02911_analyzer_order_by_read_in_order_query_plan.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02911_analyzer_order_by_read_in_order_query_plan.sql.expected.formatted.sql @@ -77,7 +77,7 @@ SELECT * FROM tab ORDER BY ((a + b)) * c DESC, - sin(a / b) DESC; + sin(a / b) DESC NULLS FIRST; SELECT * FROM ( @@ -86,7 +86,7 @@ FROM ( FROM tab ORDER BY ((a + b)) * c DESC, - sin(a / b) DESC + sin(a / b) DESC NULLS FIRST ) WHERE like(`explain`, '%sort description%'); @@ -292,7 +292,7 @@ FROM ( FROM tab ORDER BY ((a + b)) * c DESC, - intDiv(sin(a / b), 2) DESC + intDiv(sin(a / b), 2) DESC NULLS FIRST ) WHERE like(`explain`, '%sort description%'); diff --git a/tests/clickhouse-reference/02911_join_on_nullsafe_optimization.sql.expected.ast.json b/tests/clickhouse-reference/02911_join_on_nullsafe_optimization.sql.expected.ast.json index 3e1a877ef..f67c1cfcd 100644 --- a/tests/clickhouse-reference/02911_join_on_nullsafe_optimization.sql.expected.ast.json +++ b/tests/clickhouse-reference/02911_join_on_nullsafe_optimization.sql.expected.ast.json @@ -314,7 +314,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ], "leadingComments": [ @@ -434,7 +435,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -762,7 +764,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -907,7 +910,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -1092,7 +1096,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -1166,7 +1171,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -1303,7 +1309,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -1458,7 +1465,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -1602,7 +1610,8 @@ "ALL" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ], "settings": [ @@ -1767,7 +1776,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ], "settings": [ @@ -1945,7 +1955,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -1956,7 +1967,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ], "leadingComments": [ @@ -2078,7 +2090,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -2089,7 +2102,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -2228,7 +2242,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ], "leadingComments": [ diff --git a/tests/clickhouse-reference/02911_join_on_nullsafe_optimization.sql.expected.formatted.sql b/tests/clickhouse-reference/02911_join_on_nullsafe_optimization.sql.expected.formatted.sql index e1902338b..223a36fc9 100644 --- a/tests/clickhouse-reference/02911_join_on_nullsafe_optimization.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02911_join_on_nullsafe_optimization.sql.expected.formatted.sql @@ -52,7 +52,7 @@ INNER JOIN t2 ON (t1.x <=> t2.x OR (isNull(t1.x) AND isNull(t2.x))) -ORDER BY t1.x ASC; +ORDER BY t1.x ASC NULLS LAST; SELECT * FROM @@ -62,7 +62,7 @@ INNER JOIN t2 OR isNull(t1.x) AND isNull(t2.x))) OR t1.y <=> t2.y -ORDER BY t1.x ASC; +ORDER BY t1.x ASC NULLS LAST; SELECT * FROM @@ -91,7 +91,7 @@ INNER JOIN t2 OR isNull(t1.x) AND isNull(t2.x))) AND t1.y <=> t2.y -ORDER BY t1.x ASC; +ORDER BY t1.x ASC NULLS LAST; SELECT * FROM @@ -103,7 +103,7 @@ INNER JOIN t2 AND isNull(t2.x)) OR (isNull(t1.y) AND isNull(t2.y))) -ORDER BY t1.x ASC; +ORDER BY t1.x ASC NULLS LAST; SELECT * FROM @@ -116,13 +116,13 @@ INNER JOIN t2 OR (isNull(t1.y) AND isNull(t2.y)))) AND COALESCE(t1.x, 0) != 2 -ORDER BY t1.x ASC; +ORDER BY t1.x ASC NULLS LAST; SELECT x = y OR (isNull(x) AND isNull(y)) FROM t1 -ORDER BY x ASC; +ORDER BY x ASC NULLS LAST; SELECT * FROM @@ -133,7 +133,7 @@ INNER JOIN t2 AND (isNotNull(t1.x))))) OR ((isNull(t2.x)) AND (isNull(t1.x))) -ORDER BY t1.x ASC; +ORDER BY t1.x ASC NULLS LAST; SELECT * FROM @@ -145,7 +145,7 @@ INNER JOIN t2 OR (t2.x <> t1.x AND (isNull(t2.x)) AND (isNull(t1.x))) -ORDER BY t1.x ASC; +ORDER BY t1.x ASC NULLS LAST; SELECT * FROM @@ -156,7 +156,7 @@ INNER JOIN t2 AND (isNotNull(t1.x))))) OR (t2.x <> t1.x AND t2.x <> t1.x) -ORDER BY `ALL` ASC +ORDER BY `ALL` ASC NULLS LAST SETTINGS query_plan_use_new_logical_join_step = 0; SELECT * @@ -169,7 +169,7 @@ INNER JOIN t2 OR (t2.x <> t1.x AND (isNull(t2.x)) AND (isNull(t2.x))) -ORDER BY t1.x ASC +ORDER BY t1.x ASC NULLS LAST SETTINGS query_plan_use_new_logical_join_step = 0, use_join_disjunctions_push_down = 0; @@ -188,8 +188,8 @@ FULL JOIN t2 OR ((isNull(t2.x)) AND (isNull(t1.x))) AS e2) ORDER BY - t1.x ASC, - t2.x ASC; + t1.x ASC NULLS LAST, + t2.x ASC NULLS LAST; SELECT *, @@ -202,8 +202,8 @@ FULL JOIN t2 AND (((isNotNull(t2.x)) AND (isNotNull(t1.x))))) AS e2) ORDER BY - t1.x ASC, - t2.x ASC; + t1.x ASC NULLS LAST, + t2.x ASC NULLS LAST; -- check for non-nullable columns for which `is null` is replaced with constant SELECT * @@ -215,7 +215,7 @@ INNER JOIN t2n AS t2 AND (isNotNull(t1.x))))) OR ((isNull(t2.x)) AND (isNull(t1.x))) -ORDER BY t1.x ASC; +ORDER BY t1.x ASC NULLS LAST; -- { echoOff } SELECT '--'; diff --git a/tests/clickhouse-reference/02915_analyzer_fuzz_5.sql.expected.ast.json b/tests/clickhouse-reference/02915_analyzer_fuzz_5.sql.expected.ast.json index 4fa8b52cd..86083a6a4 100644 --- a/tests/clickhouse-reference/02915_analyzer_fuzz_5.sql.expected.ast.json +++ b/tests/clickhouse-reference/02915_analyzer_fuzz_5.sql.expected.ast.json @@ -172,7 +172,8 @@ "number" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ], "settings": [ diff --git a/tests/clickhouse-reference/02915_analyzer_fuzz_5.sql.expected.formatted.sql b/tests/clickhouse-reference/02915_analyzer_fuzz_5.sql.expected.formatted.sql index 574603943..95f8f9efc 100644 --- a/tests/clickhouse-reference/02915_analyzer_fuzz_5.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02915_analyzer_fuzz_5.sql.expected.formatted.sql @@ -18,5 +18,5 @@ GROUP BY number WITH ROLLUP ORDER BY count() ASC, - number DESC + number DESC NULLS LAST SETTINGS limit = 2; \ No newline at end of file diff --git a/tests/clickhouse-reference/02915_analyzer_fuzz_6.sql.expected.ast.json b/tests/clickhouse-reference/02915_analyzer_fuzz_6.sql.expected.ast.json index 356cbfb38..b99120dab 100644 --- a/tests/clickhouse-reference/02915_analyzer_fuzz_6.sql.expected.ast.json +++ b/tests/clickhouse-reference/02915_analyzer_fuzz_6.sql.expected.ast.json @@ -539,7 +539,8 @@ } ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -558,7 +559,8 @@ "k" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ], "format": "Null" @@ -920,7 +922,8 @@ } ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -939,7 +942,8 @@ "k" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ], "format": "Null" diff --git a/tests/clickhouse-reference/02915_analyzer_fuzz_6.sql.expected.formatted.sql b/tests/clickhouse-reference/02915_analyzer_fuzz_6.sql.expected.formatted.sql index 62400d387..b5e52226e 100644 --- a/tests/clickhouse-reference/02915_analyzer_fuzz_6.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02915_analyzer_fuzz_6.sql.expected.formatted.sql @@ -41,9 +41,9 @@ FROM t__fuzz_307 FINAL ORDER BY (toNullable('655.36'), 2, toNullable ('0.2147483648'), k2) ASC, - toNullable('102.3') DESC, + toNullable('102.3') DESC NULLS FIRST, '10.25' DESC, - k ASC + k ASC NULLS FIRST FORMAT Null; CREATE TABLE t__fuzz_282 @@ -67,7 +67,7 @@ SELECT FROM t__fuzz_282 FINAL ORDER BY (toNullable('655.36'), 2, toNullable('0.2147483648'), k2) ASC, - toNullable('102.3') DESC, + toNullable('102.3') DESC NULLS FIRST, '10.25' DESC, - k ASC + k ASC NULLS FIRST FORMAT Null; \ No newline at end of file diff --git a/tests/clickhouse-reference/02922_respect_nulls_Nullable.sql.expected.ast.json b/tests/clickhouse-reference/02922_respect_nulls_Nullable.sql.expected.ast.json index 8a2bfbc4e..c5779bbad 100644 --- a/tests/clickhouse-reference/02922_respect_nulls_Nullable.sql.expected.ast.json +++ b/tests/clickhouse-reference/02922_respect_nulls_Nullable.sql.expected.ast.json @@ -49,7 +49,8 @@ "cond" ] } - ] + ], + "nullsAction": "IGNORE NULLS" }, "alias": "any_ignore" }, @@ -71,7 +72,8 @@ "cond" ] } - ] + ], + "nullsAction": "RESPECT NULLS" }, "alias": "any_respect" }, @@ -93,7 +95,8 @@ "cond" ] } - ] + ], + "nullsAction": "IGNORE NULLS" }, "alias": "last_ignore" }, @@ -115,7 +118,8 @@ "cond" ] } - ] + ], + "nullsAction": "RESPECT NULLS" }, "alias": "last_respect" }, @@ -137,7 +141,8 @@ "cond" ] } - ] + ], + "nullsAction": "IGNORE NULLS" }, "alias": "any_nullable_ignore" }, @@ -159,7 +164,8 @@ "cond" ] } - ] + ], + "nullsAction": "RESPECT NULLS" }, "alias": "any_nullable_respect" }, @@ -181,7 +187,8 @@ "cond" ] } - ] + ], + "nullsAction": "IGNORE NULLS" }, "alias": "last_nullable_ignore" }, @@ -203,7 +210,8 @@ "cond" ] } - ] + ], + "nullsAction": "RESPECT NULLS" }, "alias": "last_nullable_respect" } @@ -606,7 +614,8 @@ "tp" ] } - ] + ], + "nullsAction": "RESPECT NULLS" }, "alias": "respect" }, @@ -1224,7 +1233,8 @@ "cond" ] } - ] + ], + "nullsAction": "RESPECT NULLS" }, { "kind": "functionCall", @@ -1242,7 +1252,8 @@ "cond" ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { diff --git a/tests/clickhouse-reference/02922_respect_nulls_Nullable.sql.expected.formatted.sql b/tests/clickhouse-reference/02922_respect_nulls_Nullable.sql.expected.formatted.sql index 8e164cbc5..7f1435d8b 100644 --- a/tests/clickhouse-reference/02922_respect_nulls_Nullable.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02922_respect_nulls_Nullable.sql.expected.formatted.sql @@ -4,14 +4,14 @@ SELECT FROM ( SELECT bl, - anyIf(n, cond) AS any_ignore, - anyIf(n, cond) AS any_respect, - anyLastIf(n, cond) AS last_ignore, - anyLastIf(n, cond) AS last_respect, - anyIf(nullable_n, cond) AS any_nullable_ignore, - anyIf(nullable_n, cond) AS any_nullable_respect, - anyLastIf(nullable_n, cond) AS last_nullable_ignore, - anyLastIf(nullable_n, cond) AS last_nullable_respect + anyIf(n, cond) IGNORE NULLS AS any_ignore, + anyIf(n, cond) RESPECT NULLS AS any_respect, + anyLastIf(n, cond) IGNORE NULLS AS last_ignore, + anyLastIf(n, cond) RESPECT NULLS AS last_respect, + anyIf(nullable_n, cond) IGNORE NULLS AS any_nullable_ignore, + anyIf(nullable_n, cond) RESPECT NULLS AS any_nullable_respect, + anyLastIf(nullable_n, cond) IGNORE NULLS AS last_nullable_ignore, + anyLastIf(nullable_n, cond) RESPECT NULLS AS last_nullable_respect FROM ( SELECT number AS n, @@ -41,7 +41,7 @@ FROM ( SELECT any(tp) AS default, toTypeName(default) AS default_type, - any(tp) AS `respect`, + any(tp) RESPECT NULLS AS `respect`, toTypeName(`respect`) AS respect_type FROM ( SELECT (toLowCardinality(number), number) AS tp @@ -111,8 +111,8 @@ FROM ( -- Assert sanitizer: passing NULL (not Nullable() with different values is accepted and ignored) SELECT - anyLastIf(n, cond), - anyLastIf(nullable_n, cond) + anyLastIf(n, cond) RESPECT NULLS, + anyLastIf(nullable_n, cond) RESPECT NULLS FROM ( SELECT number AS n, diff --git a/tests/clickhouse-reference/02922_respect_nulls_extensive.sql.expected.ast.json b/tests/clickhouse-reference/02922_respect_nulls_extensive.sql.expected.ast.json index 46a8647de..6c27aa67e 100644 --- a/tests/clickhouse-reference/02922_respect_nulls_extensive.sql.expected.ast.json +++ b/tests/clickhouse-reference/02922_respect_nulls_extensive.sql.expected.ast.json @@ -19,6 +19,7 @@ ] } ], + "nullsAction": "RESPECT NULLS", "window": { "orderBy": [ { @@ -167,6 +168,7 @@ ] } ], + "nullsAction": "RESPECT NULLS", "window": { "orderBy": [ { @@ -215,6 +217,7 @@ ] } ], + "nullsAction": "RESPECT NULLS", "window": { "orderBy": [ { @@ -263,6 +266,7 @@ ] } ], + "nullsAction": "RESPECT NULLS", "window": { "orderBy": [ { @@ -407,6 +411,7 @@ ] } ], + "nullsAction": "RESPECT NULLS", "window": { "orderBy": [ { @@ -455,6 +460,7 @@ ] } ], + "nullsAction": "IGNORE NULLS", "window": { "orderBy": [ { @@ -506,6 +512,7 @@ ] } ], + "nullsAction": "IGNORE NULLS", "window": { "orderBy": [ { @@ -547,7 +554,8 @@ "number" ] } - ] + ], + "nullsAction": "IGNORE NULLS" } ], "from": { @@ -622,7 +630,8 @@ "number" ] } - ] + ], + "nullsAction": "IGNORE NULLS" } ], "from": { @@ -738,7 +747,8 @@ } ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { @@ -857,7 +867,8 @@ } ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { @@ -941,7 +952,8 @@ } ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { @@ -1025,7 +1037,8 @@ } ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { @@ -1113,7 +1126,8 @@ } ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ] } @@ -1203,7 +1217,8 @@ } ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ] } @@ -1289,7 +1304,8 @@ } ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { @@ -1373,7 +1389,8 @@ } ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { @@ -1452,6 +1469,7 @@ ] } ], + "nullsAction": "RESPECT NULLS", "window": { "orderBy": [ { @@ -1506,6 +1524,7 @@ ] } ], + "nullsAction": "RESPECT NULLS", "window": { "orderBy": [ { @@ -1557,6 +1576,7 @@ ] } ], + "nullsAction": "RESPECT NULLS", "window": { "orderBy": [ { @@ -1611,6 +1631,7 @@ ] } ], + "nullsAction": "RESPECT NULLS", "window": { "orderBy": [ { @@ -1659,7 +1680,8 @@ "number" ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ] } @@ -1696,7 +1718,8 @@ "number" ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ] } @@ -1726,7 +1749,8 @@ "number" ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { @@ -1754,7 +1778,8 @@ "number" ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { @@ -1782,7 +1807,8 @@ "number" ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { @@ -1832,7 +1858,8 @@ "number" ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { @@ -1882,7 +1909,8 @@ "number" ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { @@ -1954,7 +1982,8 @@ "number" ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { @@ -2026,7 +2055,8 @@ "number" ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { @@ -2098,7 +2128,8 @@ "number" ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { @@ -2174,7 +2205,8 @@ "number" ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ] } @@ -2214,7 +2246,8 @@ "number" ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { diff --git a/tests/clickhouse-reference/02922_respect_nulls_extensive.sql.expected.formatted.sql b/tests/clickhouse-reference/02922_respect_nulls_extensive.sql.expected.formatted.sql index 56ecb90cc..e1a81ec87 100644 --- a/tests/clickhouse-reference/02922_respect_nulls_extensive.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02922_respect_nulls_extensive.sql.expected.formatted.sql @@ -2,7 +2,7 @@ -- The function name is case insensitive, with or without respect nulls and using any of the aliases SELECT number, - first_value(number) OVER (ORDER BY number ASC) + first_value(number) RESPECT NULLS OVER (ORDER BY number ASC) FROM numbers(1); SELECT @@ -17,17 +17,17 @@ FROM numbers(1); SELECT number, - any(number) OVER (ORDER BY number ASC) + any(number) RESPECT NULLS OVER (ORDER BY number ASC) FROM numbers(1); SELECT number, - any_value(number) OVER (ORDER BY number ASC) + any_value(number) RESPECT NULLS OVER (ORDER BY number ASC) FROM numbers(1); SELECT number, - last_value(number) OVER (ORDER BY number ASC) + last_value(number) RESPECT NULLS OVER (ORDER BY number ASC) FROM numbers(1); SELECT @@ -42,28 +42,28 @@ FROM numbers(1); SELECT number, - anyLast(number) OVER (ORDER BY number ASC) + anyLast(number) RESPECT NULLS OVER (ORDER BY number ASC) FROM numbers(1); -- IGNORE NULLS should be accepted too SELECT number, - FIRST_VALUE(number) OVER (ORDER BY number ASC) + FIRST_VALUE(number) IGNORE NULLS OVER (ORDER BY number ASC) FROM numbers(1); SELECT number, - LAST_VALUE(number) OVER (ORDER BY number ASC) + LAST_VALUE(number) IGNORE NULLS OVER (ORDER BY number ASC) FROM numbers(1); -- When applying IGNORE NULLs to first_value_respect_nulls we go back to the original function (any) -SELECT first_value_respect_nulls(number) +SELECT first_value_respect_nulls(number) IGNORE NULLS FROM ( SELECT if(number < 2, NULL, number) AS number FROM numbers(10) ); -SELECT last_value_respect_nulls(number) +SELECT last_value_respect_nulls(number) IGNORE NULLS FROM ( SELECT if(number < 2, NULL, number) AS number FROM numbers(10) @@ -71,50 +71,50 @@ FROM ( -- IGNORE/RESPECT NULLS should work with combinators because we can do it SELECT first_valueIf(number, NOT isNull(number) - AND (assumeNotNull(number) > 5)) + AND (assumeNotNull(number) > 5)) RESPECT NULLS FROM ( SELECT if(number < 2, NULL, number) AS number FROM numbers(10) ); SELECT last_valueIf(number, NOT isNull(number) - AND (assumeNotNull(number) > 5)) + AND (assumeNotNull(number) > 5)) RESPECT NULLS FROM ( SELECT if(number < 2, NULL, number) AS number FROM numbers(10) ); -SELECT first_valueIf(number, isNull(number)) +SELECT first_valueIf(number, isNull(number)) RESPECT NULLS FROM ( SELECT if(number > 8, NULL, number) AS number FROM numbers(10) ); -SELECT last_valueIf(number, isNull(number)) +SELECT last_valueIf(number, isNull(number)) RESPECT NULLS FROM ( SELECT if(number > 8, NULL, number) AS number FROM numbers(10) ); -SELECT toTypeName(first_valueIfState(number, isNull(number))) +SELECT toTypeName(first_valueIfState(number, isNull(number)) RESPECT NULLS) FROM ( SELECT if(number > 8, NULL, number) AS number FROM numbers(10) ); -SELECT toTypeName(last_valueIfState(number, isNull(number))) +SELECT toTypeName(last_valueIfState(number, isNull(number)) RESPECT NULLS) FROM ( SELECT if(number > 8, NULL, number) AS number FROM numbers(10) ); -SELECT anyIf(number, isNull(number)) +SELECT anyIf(number, isNull(number)) RESPECT NULLS FROM ( SELECT if(number > 8, NULL, number) AS number FROM numbers(10) ); -SELECT anyLastIf(number, isNull(number)) +SELECT anyLastIf(number, isNull(number)) RESPECT NULLS FROM ( SELECT if(number > 8, NULL, number) AS number FROM numbers(10) @@ -123,78 +123,78 @@ FROM ( -- Unsupported functions should throw in the server SELECT number, - sum(number) OVER (ORDER BY number ASC) + sum(number) RESPECT NULLS OVER (ORDER BY number ASC) FROM numbers(1); -- { serverError NOT_IMPLEMENTED } SELECT number, - avgIf(number) OVER (ORDER BY number ASC) + avgIf(number) RESPECT NULLS OVER (ORDER BY number ASC) FROM numbers(1); -- { serverError NOT_IMPLEMENTED } -- Same for double RESPECT NULLS SELECT number, - first_value_respect_nulls(number) OVER (ORDER BY number ASC) + first_value_respect_nulls(number) RESPECT NULLS OVER (ORDER BY number ASC) FROM numbers(1); -- { serverError NOT_IMPLEMENTED } SELECT number, - last_value_respect_nulls(number) OVER (ORDER BY number ASC) + last_value_respect_nulls(number) RESPECT NULLS OVER (ORDER BY number ASC) FROM numbers(1); -- { serverError NOT_IMPLEMENTED } -- Aggregate_functions_null_for_empty should work the same way -SELECT toTypeName(any(number)) +SELECT toTypeName(any(number) RESPECT NULLS) FROM numbers(1); -SELECT toTypeName(anyOrNull(number)) +SELECT toTypeName(anyOrNull(number) RESPECT NULLS) FROM numbers(1); -SELECT any(number) +SELECT any(number) RESPECT NULLS FROM numbers(0); -SELECT anyOrNull(number) +SELECT anyOrNull(number) RESPECT NULLS FROM numbers(0); -SELECT any(number) +SELECT any(number) RESPECT NULLS FROM ( SELECT NULL::Nullable(UInt8) AS number FROM numbers(10) ); -SELECT anyOrNull(number) +SELECT anyOrNull(number) RESPECT NULLS FROM ( SELECT NULL::Nullable(UInt8) AS number FROM numbers(10) ); -SELECT any(number) +SELECT any(number) RESPECT NULLS FROM ( SELECT if(number > 8, NULL, number) AS number FROM numbers(10) ); -SELECT anyOrNull(number) +SELECT anyOrNull(number) RESPECT NULLS FROM ( SELECT if(number > 8, NULL, number) AS number FROM numbers(10) ); -SELECT any(number) +SELECT any(number) RESPECT NULLS FROM ( SELECT if(number < 8, NULL, number) AS number FROM numbers(10) ); -SELECT anyOrNull(number) +SELECT anyOrNull(number) RESPECT NULLS FROM ( SELECT if(number < 8, NULL, number) AS number FROM numbers(10) ); -SELECT toTypeName(any(number)) +SELECT toTypeName(any(number) RESPECT NULLS) FROM numbers(1) SETTINGS aggregate_functions_null_for_empty = 1; -SELECT any(number) +SELECT any(number) RESPECT NULLS FROM numbers(0) SETTINGS aggregate_functions_null_for_empty = 1; \ No newline at end of file diff --git a/tests/clickhouse-reference/02922_respect_nulls_parser.sql.expected.ast.json b/tests/clickhouse-reference/02922_respect_nulls_parser.sql.expected.ast.json index 1da16795e..c091f3ccb 100644 --- a/tests/clickhouse-reference/02922_respect_nulls_parser.sql.expected.ast.json +++ b/tests/clickhouse-reference/02922_respect_nulls_parser.sql.expected.ast.json @@ -96,7 +96,8 @@ "name": "now", "args": [] } - ] + ], + "nullsAction": "RESPECT NULLS" }, "alias": "b" } @@ -122,7 +123,8 @@ "name": "now", "args": [] } - ] + ], + "nullsAction": "RESPECT NULLS" }, "alias": "b" } @@ -167,7 +169,8 @@ "value": "0", "parenthesized": true } - ] + ], + "nullsAction": "RESPECT NULLS" }, "trailingComments": [ "-- { serverError SYNTAX_ERROR }" @@ -206,7 +209,8 @@ "type": "UInt64", "value": "0" } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { @@ -265,7 +269,8 @@ "number" ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { @@ -324,7 +329,8 @@ "value": "1" } } - ] + ], + "nullsAction": "RESPECT NULLS" }, "trailingComments": [ "-- { serverError SYNTAX_ERROR }" @@ -407,7 +413,8 @@ ], "source": "[[3,4,5], [6,7], [2], [1,1]]" } - ] + ], + "nullsAction": "IGNORE NULLS" } ], "trailingComments": [ @@ -450,7 +457,8 @@ "number" ] } - ] + ], + "nullsAction": "RESPECT NULLS" }, "alias": "gr" } diff --git a/tests/clickhouse-reference/02922_respect_nulls_parser.sql.expected.formatted.sql b/tests/clickhouse-reference/02922_respect_nulls_parser.sql.expected.formatted.sql index 44f309220..151e4babe 100644 --- a/tests/clickhouse-reference/02922_respect_nulls_parser.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02922_respect_nulls_parser.sql.expected.formatted.sql @@ -10,32 +10,32 @@ SELECT formatQuery('SELECT LAST_VALUE(number) RESPECT NULLS from numbers(1)'); SELECT formatQuery('SELECT sum(number) RESPECT NULLS from numbers(1)'); -- Normal functions should throw in the server -SELECT toDateTimeNonExistingFunction(now()) AS b; -- { serverError UNKNOWN_FUNCTION } +SELECT toDateTimeNonExistingFunction(now()) RESPECT NULLS AS b; -- { serverError UNKNOWN_FUNCTION } -SELECT toDateTime(now()) AS b; -- { serverError SYNTAX_ERROR } +SELECT toDateTime(now()) RESPECT NULLS AS b; -- { serverError SYNTAX_ERROR } SELECT count() FROM numbers(10) -WHERE in(number, (0)); -- { serverError SYNTAX_ERROR } +WHERE in(number, (0)) RESPECT NULLS; -- { serverError SYNTAX_ERROR } -SELECT if(number > 0, number, 0) +SELECT if(number > 0, number, 0) RESPECT NULLS FROM numbers(0); -- { serverError SYNTAX_ERROR } WITH (x -> x + 1) AS lambda -SELECT lambda(number) +SELECT lambda(number) RESPECT NULLS FROM numbers(10) SETTINGS enable_analyzer = 1; -- { serverError SYNTAX_ERROR } SELECT * FROM `system`.one -WHERE indexHint(dummy = 1); -- { serverError SYNTAX_ERROR } +WHERE indexHint(dummy = 1) RESPECT NULLS; -- { serverError SYNTAX_ERROR } -SELECT arrayJoin([[3,4,5], [6,7], [2], [1,1]]); -- { serverError SYNTAX_ERROR } +SELECT arrayJoin([[3,4,5], [6,7], [2], [1,1]]) IGNORE NULLS; -- { serverError SYNTAX_ERROR } SELECT number, - grouping(number % 2, number) AS gr + grouping(number % 2, number) RESPECT NULLS AS gr FROM numbers(10) GROUP BY GROUPING SETS ((number), (number % 2)) SETTINGS force_grouping_standard_compatibility = 0; -- { serverError SYNTAX_ERROR } \ No newline at end of file diff --git a/tests/clickhouse-reference/02923_join_use_nulls_modulo.sql.expected.ast.json b/tests/clickhouse-reference/02923_join_use_nulls_modulo.sql.expected.ast.json index fd624febb..40f3e1396 100644 --- a/tests/clickhouse-reference/02923_join_use_nulls_modulo.sql.expected.ast.json +++ b/tests/clickhouse-reference/02923_join_use_nulls_modulo.sql.expected.ast.json @@ -216,7 +216,8 @@ "columns": [ "id" ] - } + }, + "strictness": "SEMI" }, "settings": [ { diff --git a/tests/clickhouse-reference/02923_join_use_nulls_modulo.sql.expected.formatted.sql b/tests/clickhouse-reference/02923_join_use_nulls_modulo.sql.expected.formatted.sql index d12a4361b..058e3310f 100644 --- a/tests/clickhouse-reference/02923_join_use_nulls_modulo.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02923_join_use_nulls_modulo.sql.expected.formatted.sql @@ -9,7 +9,7 @@ FROM toLowCardinality(9223372036854775807) AS value GROUP BY GROUPING SETS ((toLowCardinality(1024)), (id % 10.0001), ((id % 2147483646) != -9223372036854775807), ((id % -1) != 255)) ) AS a -LEFT JOIN ( +SEMI LEFT JOIN ( SELECT toLowCardinality(9223372036854775807) AS id WHERE (id % 2147483646) != NULL ) AS d diff --git a/tests/clickhouse-reference/02932_group_by_null_fuzzer.sql.expected.ast.json b/tests/clickhouse-reference/02932_group_by_null_fuzzer.sql.expected.ast.json index c326970de..f0138bf98 100644 --- a/tests/clickhouse-reference/02932_group_by_null_fuzzer.sql.expected.ast.json +++ b/tests/clickhouse-reference/02932_group_by_null_fuzzer.sql.expected.ast.json @@ -174,7 +174,8 @@ "columns": [ "key" ] - } + }, + "strictness": "ALL" } }, { @@ -365,7 +366,8 @@ "a", "b" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -375,7 +377,8 @@ "type": "Float64", "value": "nan" }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -384,7 +387,8 @@ "type": "String", "value": "9223372036854775807" }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -394,7 +398,8 @@ "a" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] } diff --git a/tests/clickhouse-reference/02932_group_by_null_fuzzer.sql.expected.formatted.sql b/tests/clickhouse-reference/02932_group_by_null_fuzzer.sql.expected.formatted.sql index 1fba5bb0e..e2f13db07 100644 --- a/tests/clickhouse-reference/02932_group_by_null_fuzzer.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02932_group_by_null_fuzzer.sql.expected.formatted.sql @@ -12,7 +12,7 @@ FROM NULL AS key GROUP BY GROUPING SETS ((NULL)) ) AS s1 -LEFT JOIN ( +ALL LEFT JOIN ( SELECT '' AS key, NULL AS value @@ -47,7 +47,7 @@ FROM GROUP BY GROUPING SETS ((0.0001)) WITH TOTALS ) AS js1 -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT NULL AS a, NULL AS b @@ -68,6 +68,6 @@ RIGHT JOIN ( ) AS js2 USING (a, b) ORDER BY - nan DESC, - '9223372036854775807' DESC, - a ASC; \ No newline at end of file + nan DESC NULLS LAST, + '9223372036854775807' DESC NULLS LAST, + a ASC NULLS LAST; \ No newline at end of file diff --git a/tests/clickhouse-reference/02932_parallel_replicas_fuzzer.sql.expected.ast.json b/tests/clickhouse-reference/02932_parallel_replicas_fuzzer.sql.expected.ast.json index e2a4dc6d1..a1d896fd4 100644 --- a/tests/clickhouse-reference/02932_parallel_replicas_fuzzer.sql.expected.ast.json +++ b/tests/clickhouse-reference/02932_parallel_replicas_fuzzer.sql.expected.ast.json @@ -275,7 +275,8 @@ "key" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -285,7 +286,8 @@ "value2" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ], "limit": { diff --git a/tests/clickhouse-reference/02932_parallel_replicas_fuzzer.sql.expected.formatted.sql b/tests/clickhouse-reference/02932_parallel_replicas_fuzzer.sql.expected.formatted.sql index 058acfb91..a3b6ec0fc 100644 --- a/tests/clickhouse-reference/02932_parallel_replicas_fuzzer.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02932_parallel_replicas_fuzzer.sql.expected.formatted.sql @@ -32,8 +32,8 @@ GROUP BY value2 WITH CUBE ORDER BY - key ASC, - value2 DESC + key ASC NULLS LAST, + value2 DESC NULLS LAST LIMIT 9223372036854775806 FORMAT Null SETTINGS max_parallel_replicas = 3, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_parallel_replicas = 1, use_hedged_requests = 0; diff --git a/tests/clickhouse-reference/02941_any_RESPECT_NULL_sparse_column.sql.expected.ast.json b/tests/clickhouse-reference/02941_any_RESPECT_NULL_sparse_column.sql.expected.ast.json index cd363f506..021058dff 100644 --- a/tests/clickhouse-reference/02941_any_RESPECT_NULL_sparse_column.sql.expected.ast.json +++ b/tests/clickhouse-reference/02941_any_RESPECT_NULL_sparse_column.sql.expected.ast.json @@ -70,7 +70,8 @@ "value" ] } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "from": { diff --git a/tests/clickhouse-reference/02941_any_RESPECT_NULL_sparse_column.sql.expected.formatted.sql b/tests/clickhouse-reference/02941_any_RESPECT_NULL_sparse_column.sql.expected.formatted.sql index 5159a7133..8b247523e 100644 --- a/tests/clickhouse-reference/02941_any_RESPECT_NULL_sparse_column.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02941_any_RESPECT_NULL_sparse_column.sql.expected.formatted.sql @@ -11,5 +11,5 @@ ORDER BY key; INSERT INTO data_sparse_column; -SELECT any(value) +SELECT any(value) RESPECT NULLS FROM data_sparse_column; \ No newline at end of file diff --git a/tests/clickhouse-reference/02943_order_by_all.sql.expected.ast.json b/tests/clickhouse-reference/02943_order_by_all.sql.expected.ast.json index f0efc802a..1b7136352 100644 --- a/tests/clickhouse-reference/02943_order_by_all.sql.expected.ast.json +++ b/tests/clickhouse-reference/02943_order_by_all.sql.expected.ast.json @@ -252,7 +252,8 @@ "ALL" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -285,7 +286,8 @@ "ALL" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, diff --git a/tests/clickhouse-reference/02943_order_by_all.sql.expected.formatted.sql b/tests/clickhouse-reference/02943_order_by_all.sql.expected.formatted.sql index 9b7c76f09..0aa431eeb 100644 --- a/tests/clickhouse-reference/02943_order_by_all.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02943_order_by_all.sql.expected.formatted.sql @@ -44,13 +44,13 @@ SELECT b, a FROM order_by_all -ORDER BY `ALL` ASC; +ORDER BY `ALL` ASC NULLS FIRST; SELECT b, a FROM order_by_all -ORDER BY `ALL` ASC; +ORDER BY `ALL` ASC NULLS LAST; SELECT * FROM order_by_all diff --git a/tests/clickhouse-reference/02954_analyzer_fuzz_i57086.sql.expected.ast.json b/tests/clickhouse-reference/02954_analyzer_fuzz_i57086.sql.expected.ast.json index fa506038c..3a5663fe6 100644 --- a/tests/clickhouse-reference/02954_analyzer_fuzz_i57086.sql.expected.ast.json +++ b/tests/clickhouse-reference/02954_analyzer_fuzz_i57086.sql.expected.ast.json @@ -112,7 +112,8 @@ "number" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ], "settings": [ diff --git a/tests/clickhouse-reference/02954_analyzer_fuzz_i57086.sql.expected.formatted.sql b/tests/clickhouse-reference/02954_analyzer_fuzz_i57086.sql.expected.formatted.sql index 253716c4e..368444bb2 100644 --- a/tests/clickhouse-reference/02954_analyzer_fuzz_i57086.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02954_analyzer_fuzz_i57086.sql.expected.formatted.sql @@ -11,7 +11,7 @@ GROUP BY number WITH ROLLUP ORDER BY count() ASC, - number DESC + number DESC NULLS LAST SETTINGS limit = 2, enable_analyzer = 1; \ No newline at end of file diff --git a/tests/clickhouse-reference/02968_full_sorting_join_fuzz.sql.expected.ast.json b/tests/clickhouse-reference/02968_full_sorting_join_fuzz.sql.expected.ast.json index 033f2e05e..2a93044df 100644 --- a/tests/clickhouse-reference/02968_full_sorting_join_fuzz.sql.expected.ast.json +++ b/tests/clickhouse-reference/02968_full_sorting_join_fuzz.sql.expected.ast.json @@ -383,7 +383,8 @@ ] } } - } + }, + "strictness": "ALL" }, "prewhere": { "kind": "literal", diff --git a/tests/clickhouse-reference/02968_full_sorting_join_fuzz.sql.expected.formatted.sql b/tests/clickhouse-reference/02968_full_sorting_join_fuzz.sql.expected.formatted.sql index 3e794ec27..d33c734ac 100644 --- a/tests/clickhouse-reference/02968_full_sorting_join_fuzz.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02968_full_sorting_join_fuzz.sql.expected.formatted.sql @@ -37,7 +37,7 @@ SELECT count(materialize(NULL)) FROM t1 -INNER JOIN t2 +ALL INNER JOIN t2 ON t1.key = t2.key PREWHERE 10 WHERE t2.key != 0 diff --git a/tests/clickhouse-reference/02989_variant_comparison.sql.expected.ast.json b/tests/clickhouse-reference/02989_variant_comparison.sql.expected.ast.json index 11b21bc99..42b9fc9e7 100644 --- a/tests/clickhouse-reference/02989_variant_comparison.sql.expected.ast.json +++ b/tests/clickhouse-reference/02989_variant_comparison.sql.expected.ast.json @@ -363,7 +363,8 @@ "v1" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -390,7 +391,8 @@ "v1" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -417,7 +419,8 @@ "v2" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -444,7 +447,8 @@ "v2" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -478,7 +482,8 @@ "v2" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -512,7 +517,8 @@ "v2" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -546,7 +552,8 @@ "v1" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -580,7 +587,8 @@ "v1" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, diff --git a/tests/clickhouse-reference/02989_variant_comparison.sql.expected.formatted.sql b/tests/clickhouse-reference/02989_variant_comparison.sql.expected.formatted.sql index 0a6cada2f..6f3dd6541 100644 --- a/tests/clickhouse-reference/02989_variant_comparison.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02989_variant_comparison.sql.expected.formatted.sql @@ -57,43 +57,43 @@ INSERT INTO test; SELECT v1 FROM test -ORDER BY v1 ASC; +ORDER BY v1 ASC NULLS FIRST; SELECT v1 FROM test -ORDER BY v1 ASC; +ORDER BY v1 ASC NULLS LAST; SELECT v2 FROM test -ORDER BY v2 ASC; +ORDER BY v2 ASC NULLS FIRST; SELECT v2 FROM test -ORDER BY v2 ASC; +ORDER BY v2 ASC NULLS LAST; SELECT * FROM test ORDER BY v1 ASC, - v2 ASC; + v2 ASC NULLS FIRST; SELECT * FROM test ORDER BY v1 ASC, - v2 ASC; + v2 ASC NULLS LAST; SELECT * FROM test ORDER BY v2 ASC, - v1 ASC; + v1 ASC NULLS FIRST; SELECT * FROM test ORDER BY v2 ASC, - v1 ASC; + v1 ASC NULLS LAST; SELECT v1, diff --git a/tests/clickhouse-reference/02998_operator_respect_nulls.sql.expected.ast.json b/tests/clickhouse-reference/02998_operator_respect_nulls.sql.expected.ast.json index 8aeb2c060..546fab138 100644 --- a/tests/clickhouse-reference/02998_operator_respect_nulls.sql.expected.ast.json +++ b/tests/clickhouse-reference/02998_operator_respect_nulls.sql.expected.ast.json @@ -16,7 +16,8 @@ "type": "UInt64", "value": "1" } - ] + ], + "nullsAction": "RESPECT NULLS" } ], "trailingComments": [ diff --git a/tests/clickhouse-reference/02998_operator_respect_nulls.sql.expected.formatted.sql b/tests/clickhouse-reference/02998_operator_respect_nulls.sql.expected.formatted.sql index c63486ff7..e88ce4db6 100644 --- a/tests/clickhouse-reference/02998_operator_respect_nulls.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02998_operator_respect_nulls.sql.expected.formatted.sql @@ -1 +1 @@ -SELECT plus(1, 1); -- { serverError SYNTAX_ERROR } \ No newline at end of file +SELECT plus(1, 1) RESPECT NULLS; -- { serverError SYNTAX_ERROR } \ No newline at end of file diff --git a/tests/clickhouse-reference/02999_scalar_subqueries_bug_1.sql.expected.ast.json b/tests/clickhouse-reference/02999_scalar_subqueries_bug_1.sql.expected.ast.json index 15d0b6e78..0fb83c1a7 100644 --- a/tests/clickhouse-reference/02999_scalar_subqueries_bug_1.sql.expected.ast.json +++ b/tests/clickhouse-reference/02999_scalar_subqueries_bug_1.sql.expected.ast.json @@ -236,7 +236,8 @@ ] } } - } + }, + "global": true }, "settings": [ { diff --git a/tests/clickhouse-reference/02999_scalar_subqueries_bug_1.sql.expected.formatted.sql b/tests/clickhouse-reference/02999_scalar_subqueries_bug_1.sql.expected.formatted.sql index 1557dd5eb..df41d7f8d 100644 --- a/tests/clickhouse-reference/02999_scalar_subqueries_bug_1.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/02999_scalar_subqueries_bug_1.sql.expected.formatted.sql @@ -20,7 +20,7 @@ SELECT b.id FROM remote('127.0.0.{1,2}', currentDatabase(), t_table_select) AS a -LEFT JOIN ( +GLOBAL LEFT JOIN ( SELECT id FROM remote('127.0.0.{1,2}', currentDatabase(), t_table_select) AS b WHERE (b.id % 10) = 0 diff --git a/tests/clickhouse-reference/03006_buffer_overflow_join.sql.expected.ast.json b/tests/clickhouse-reference/03006_buffer_overflow_join.sql.expected.ast.json index 2f15e02a5..9c52c3134 100644 --- a/tests/clickhouse-reference/03006_buffer_overflow_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/03006_buffer_overflow_join.sql.expected.ast.json @@ -208,7 +208,8 @@ "a" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ], "format": "Null" diff --git a/tests/clickhouse-reference/03006_buffer_overflow_join.sql.expected.formatted.sql b/tests/clickhouse-reference/03006_buffer_overflow_join.sql.expected.formatted.sql index 7b1dbd81d..2b81104a2 100644 --- a/tests/clickhouse-reference/03006_buffer_overflow_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03006_buffer_overflow_join.sql.expected.formatted.sql @@ -25,5 +25,5 @@ FROM `03006_buffer_overflow_l` RIGHT JOIN `03006_buffer_overflow_r` USING (a) -ORDER BY a ASC +ORDER BY a ASC NULLS FIRST FORMAT Null; \ No newline at end of file diff --git a/tests/clickhouse-reference/03007_column_nullable_uninitialzed_value.sql.expected.ast.json b/tests/clickhouse-reference/03007_column_nullable_uninitialzed_value.sql.expected.ast.json index ee1ef93d3..cc4aeba6d 100644 --- a/tests/clickhouse-reference/03007_column_nullable_uninitialzed_value.sql.expected.ast.json +++ b/tests/clickhouse-reference/03007_column_nullable_uninitialzed_value.sql.expected.ast.json @@ -14,7 +14,8 @@ "type": "NULL", "value": "NULL" } - ] + ], + "nullsAction": "IGNORE NULLS" }, "right": { "kind": "functionCall", @@ -31,7 +32,8 @@ } ] } - ] + ], + "nullsAction": "IGNORE NULLS" } }, { diff --git a/tests/clickhouse-reference/03007_column_nullable_uninitialzed_value.sql.expected.formatted.sql b/tests/clickhouse-reference/03007_column_nullable_uninitialzed_value.sql.expected.formatted.sql index be25ff094..6fcb73ac1 100644 --- a/tests/clickhouse-reference/03007_column_nullable_uninitialzed_value.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03007_column_nullable_uninitialzed_value.sql.expected.formatted.sql @@ -1,5 +1,5 @@ SELECT - count(NULL) > avg(toDecimal32(NULL)), + count(NULL) IGNORE NULLS > avg(toDecimal32(NULL)) IGNORE NULLS, count() FROM numbers(1000) WITH TOTALS diff --git a/tests/clickhouse-reference/03010_sum_to_to_count_if_nullable.sql.expected.ast.json b/tests/clickhouse-reference/03010_sum_to_to_count_if_nullable.sql.expected.ast.json index 53c5e02f3..036f30302 100644 --- a/tests/clickhouse-reference/03010_sum_to_to_count_if_nullable.sql.expected.ast.json +++ b/tests/clickhouse-reference/03010_sum_to_to_count_if_nullable.sql.expected.ast.json @@ -235,7 +235,8 @@ } ] } - ] + ], + "nullsAction": "IGNORE NULLS" } ] }, @@ -500,7 +501,8 @@ } ] } - ] + ], + "nullsAction": "IGNORE NULLS" } ] }, diff --git a/tests/clickhouse-reference/03015_aggregator_empty_data_multiple_blocks.sql.expected.ast.json b/tests/clickhouse-reference/03015_aggregator_empty_data_multiple_blocks.sql.expected.ast.json index 30d540ec9..49d12873c 100644 --- a/tests/clickhouse-reference/03015_aggregator_empty_data_multiple_blocks.sql.expected.ast.json +++ b/tests/clickhouse-reference/03015_aggregator_empty_data_multiple_blocks.sql.expected.ast.json @@ -99,7 +99,8 @@ ] } } - } + }, + "strictness": "ANTI" }, "groupBy": { "kind": "expressions", diff --git a/tests/clickhouse-reference/03015_aggregator_empty_data_multiple_blocks.sql.expected.formatted.sql b/tests/clickhouse-reference/03015_aggregator_empty_data_multiple_blocks.sql.expected.formatted.sql index 95283f81d..66c7c8419 100644 --- a/tests/clickhouse-reference/03015_aggregator_empty_data_multiple_blocks.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03015_aggregator_empty_data_multiple_blocks.sql.expected.formatted.sql @@ -11,6 +11,6 @@ LIMIT 1000; SELECT radians(t1.c0) FROM `03015_aggregator_empty_data_multiple_blocks` AS t1 -RIGHT JOIN `03015_aggregator_empty_data_multiple_blocks` AS right_0 +ANTI RIGHT JOIN `03015_aggregator_empty_data_multiple_blocks` AS right_0 ON t1.c0 = right_0.c0 GROUP BY t1.c0; \ No newline at end of file diff --git a/tests/clickhouse-reference/03015_with_fill_invalid_expression.sql.expected.ast.json b/tests/clickhouse-reference/03015_with_fill_invalid_expression.sql.expected.ast.json index 689c9973f..29d7f79c7 100644 --- a/tests/clickhouse-reference/03015_with_fill_invalid_expression.sql.expected.ast.json +++ b/tests/clickhouse-reference/03015_with_fill_invalid_expression.sql.expected.ast.json @@ -87,6 +87,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -107,6 +108,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", diff --git a/tests/clickhouse-reference/03023_group_by_use_nulls_analyzer_crashes.sql.expected.ast.json b/tests/clickhouse-reference/03023_group_by_use_nulls_analyzer_crashes.sql.expected.ast.json index a5b1c33c1..e637afeee 100644 --- a/tests/clickhouse-reference/03023_group_by_use_nulls_analyzer_crashes.sql.expected.ast.json +++ b/tests/clickhouse-reference/03023_group_by_use_nulls_analyzer_crashes.sql.expected.ast.json @@ -1396,7 +1396,8 @@ "c" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ], "settings": [ diff --git a/tests/clickhouse-reference/03023_group_by_use_nulls_analyzer_crashes.sql.expected.formatted.sql b/tests/clickhouse-reference/03023_group_by_use_nulls_analyzer_crashes.sql.expected.formatted.sql index 4b48151e1..a898023e7 100644 --- a/tests/clickhouse-reference/03023_group_by_use_nulls_analyzer_crashes.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03023_group_by_use_nulls_analyzer_crashes.sql.expected.formatted.sql @@ -127,7 +127,7 @@ FROM ( ) GROUP BY GROUPING SETS ((toLowCardinality(0)), (toLowCardinality(toNullable(28))), (1)) HAVING nullIf(c, 10) < 50 -ORDER BY c ASC +ORDER BY c ASC NULLS FIRST SETTINGS group_by_use_nulls = 1; -- { serverError ILLEGAL_AGGREGATION } SELECT arraySplit(x -> 0, []) diff --git a/tests/clickhouse-reference/03033_with_fill_interpolate.sql.expected.ast.json b/tests/clickhouse-reference/03033_with_fill_interpolate.sql.expected.ast.json index c4c6e550b..41d650894 100644 --- a/tests/clickhouse-reference/03033_with_fill_interpolate.sql.expected.ast.json +++ b/tests/clickhouse-reference/03033_with_fill_interpolate.sql.expected.ast.json @@ -95,6 +95,7 @@ ] }, "direction": "ASC", + "withFill": true, "interpolate": [ { "col": "ColumnB", diff --git a/tests/clickhouse-reference/03034_recursive_cte_tree.sql.expected.ast.json b/tests/clickhouse-reference/03034_recursive_cte_tree.sql.expected.ast.json index 67c95cd10..e85536289 100644 --- a/tests/clickhouse-reference/03034_recursive_cte_tree.sql.expected.ast.json +++ b/tests/clickhouse-reference/03034_recursive_cte_tree.sql.expected.ast.json @@ -158,6 +158,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "search_tree", @@ -336,6 +337,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "search_tree", diff --git a/tests/clickhouse-reference/03034_recursive_cte_tree.sql.expected.formatted.sql b/tests/clickhouse-reference/03034_recursive_cte_tree.sql.expected.formatted.sql index 647c6a41b..eeefbd2fd 100644 --- a/tests/clickhouse-reference/03034_recursive_cte_tree.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03034_recursive_cte_tree.sql.expected.formatted.sql @@ -26,7 +26,7 @@ WITH RECURSIVE search_tree AS ( t.data FROM tree AS t - CROSS JOIN search_tree AS st + , search_tree AS st WHERE t.link = st.id ) @@ -51,7 +51,7 @@ WITH RECURSIVE search_tree AS ( arrayConcat(path, [t.id]) FROM tree AS t - CROSS JOIN search_tree AS st + , search_tree AS st WHERE t.link = st.id ) diff --git a/tests/clickhouse-reference/03034_recursive_cte_tree_merge_tree.sql.expected.ast.json b/tests/clickhouse-reference/03034_recursive_cte_tree_merge_tree.sql.expected.ast.json index 0f617704b..cfe6abc08 100644 --- a/tests/clickhouse-reference/03034_recursive_cte_tree_merge_tree.sql.expected.ast.json +++ b/tests/clickhouse-reference/03034_recursive_cte_tree_merge_tree.sql.expected.ast.json @@ -170,6 +170,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "search_tree", @@ -348,6 +349,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "search_tree", @@ -613,6 +615,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "subdepartment", @@ -753,6 +756,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "subdepartment", @@ -893,6 +897,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "subdepartment", diff --git a/tests/clickhouse-reference/03034_recursive_cte_tree_merge_tree.sql.expected.formatted.sql b/tests/clickhouse-reference/03034_recursive_cte_tree_merge_tree.sql.expected.formatted.sql index 5b016a4fa..1df8b664e 100644 --- a/tests/clickhouse-reference/03034_recursive_cte_tree_merge_tree.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03034_recursive_cte_tree_merge_tree.sql.expected.formatted.sql @@ -28,7 +28,7 @@ WITH RECURSIVE search_tree AS ( t.data FROM tree AS t - CROSS JOIN search_tree AS st + , search_tree AS st WHERE t.link = st.id ) @@ -53,7 +53,7 @@ WITH RECURSIVE search_tree AS ( arrayConcat(path, [t.id]) FROM tree AS t - CROSS JOIN search_tree AS st + , search_tree AS st WHERE t.link = st.id ) @@ -143,7 +143,7 @@ WITH RECURSIVE subdepartment AS ( d.* FROM department AS d - CROSS JOIN subdepartment AS sd + , subdepartment AS sd WHERE d.parent_department = sd.id ) @@ -166,7 +166,7 @@ WITH RECURSIVE subdepartment AS ( d.* FROM department AS d - CROSS JOIN subdepartment AS sd + , subdepartment AS sd WHERE d.parent_department = sd.id ) @@ -190,7 +190,7 @@ WITH RECURSIVE subdepartment AS ( d.* FROM department AS d - CROSS JOIN subdepartment AS sd + , subdepartment AS sd WHERE d.parent_department = sd.id ) diff --git a/tests/clickhouse-reference/03035_dynamic_sorting.sql.expected.ast.json b/tests/clickhouse-reference/03035_dynamic_sorting.sql.expected.ast.json index db5630143..9f003f195 100644 --- a/tests/clickhouse-reference/03035_dynamic_sorting.sql.expected.ast.json +++ b/tests/clickhouse-reference/03035_dynamic_sorting.sql.expected.ast.json @@ -139,7 +139,8 @@ "d1" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -190,7 +191,8 @@ "d1" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -241,7 +243,8 @@ "d2" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -292,7 +295,8 @@ "d2" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -383,7 +387,8 @@ "d2" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -474,7 +479,8 @@ "d2" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -565,7 +571,8 @@ "d1" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -656,7 +663,8 @@ "d1" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, diff --git a/tests/clickhouse-reference/03035_dynamic_sorting.sql.expected.formatted.sql b/tests/clickhouse-reference/03035_dynamic_sorting.sql.expected.formatted.sql index 1bf7f1b93..1905d9f2b 100644 --- a/tests/clickhouse-reference/03035_dynamic_sorting.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03035_dynamic_sorting.sql.expected.formatted.sql @@ -18,28 +18,28 @@ SELECT dynamicType(d1), isDynamicElementInSharedData(d1) FROM test -ORDER BY d1 ASC; +ORDER BY d1 ASC NULLS FIRST; SELECT d1, dynamicType(d1), isDynamicElementInSharedData(d1) FROM test -ORDER BY d1 ASC; +ORDER BY d1 ASC NULLS LAST; SELECT d2, dynamicType(d2), isDynamicElementInSharedData(d2) FROM test -ORDER BY d2 ASC; +ORDER BY d2 ASC NULLS FIRST; SELECT d2, dynamicType(d2), isDynamicElementInSharedData(d2) FROM test -ORDER BY d2 ASC; +ORDER BY d2 ASC NULLS LAST; SELECT d1, @@ -51,7 +51,7 @@ SELECT FROM test ORDER BY d1 ASC, - d2 ASC; + d2 ASC NULLS FIRST; SELECT d1, @@ -63,7 +63,7 @@ SELECT FROM test ORDER BY d1 ASC, - d2 ASC; + d2 ASC NULLS LAST; SELECT d1, @@ -75,7 +75,7 @@ SELECT FROM test ORDER BY d2 ASC, - d1 ASC; + d1 ASC NULLS FIRST; SELECT d1, @@ -87,6 +87,6 @@ SELECT FROM test ORDER BY d2 ASC, - d1 ASC; + d1 ASC NULLS LAST; DROP TABLE test; \ No newline at end of file diff --git a/tests/clickhouse-reference/03036_recursive_cte_postgres_2.sql.expected.ast.json b/tests/clickhouse-reference/03036_recursive_cte_postgres_2.sql.expected.ast.json index 920806ec1..75d63bb78 100644 --- a/tests/clickhouse-reference/03036_recursive_cte_postgres_2.sql.expected.ast.json +++ b/tests/clickhouse-reference/03036_recursive_cte_postgres_2.sql.expected.ast.json @@ -223,6 +223,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "subdepartment", @@ -363,6 +364,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "subdepartment", @@ -503,6 +505,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "subdepartment", diff --git a/tests/clickhouse-reference/03036_recursive_cte_postgres_2.sql.expected.formatted.sql b/tests/clickhouse-reference/03036_recursive_cte_postgres_2.sql.expected.formatted.sql index 94617157b..d62212217 100644 --- a/tests/clickhouse-reference/03036_recursive_cte_postgres_2.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03036_recursive_cte_postgres_2.sql.expected.formatted.sql @@ -81,7 +81,7 @@ WITH RECURSIVE subdepartment AS ( d.* FROM department AS d - CROSS JOIN subdepartment AS sd + , subdepartment AS sd WHERE d.parent_department = sd.id ) @@ -104,7 +104,7 @@ WITH RECURSIVE subdepartment AS ( d.* FROM department AS d - CROSS JOIN subdepartment AS sd + , subdepartment AS sd WHERE d.parent_department = sd.id ) @@ -128,7 +128,7 @@ WITH RECURSIVE subdepartment AS ( d.* FROM department AS d - CROSS JOIN subdepartment AS sd + , subdepartment AS sd WHERE d.parent_department = sd.id ) diff --git a/tests/clickhouse-reference/03038_recursive_cte_postgres_4.sql.expected.ast.json b/tests/clickhouse-reference/03038_recursive_cte_postgres_4.sql.expected.ast.json index 8eda8e109..351aecc81 100644 --- a/tests/clickhouse-reference/03038_recursive_cte_postgres_4.sql.expected.ast.json +++ b/tests/clickhouse-reference/03038_recursive_cte_postgres_4.sql.expected.ast.json @@ -239,6 +239,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "search_graph", @@ -455,6 +456,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "search_graph", diff --git a/tests/clickhouse-reference/03038_recursive_cte_postgres_4.sql.expected.formatted.sql b/tests/clickhouse-reference/03038_recursive_cte_postgres_4.sql.expected.formatted.sql index 7ef462271..25c5b3cb1 100644 --- a/tests/clickhouse-reference/03038_recursive_cte_postgres_4.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03038_recursive_cte_postgres_4.sql.expected.formatted.sql @@ -61,7 +61,7 @@ WITH RECURSIVE search_graph AS ( arrayConcat(sg.path, [tuple(g.f, g.t)]) FROM graph AS g - CROSS JOIN search_graph AS sg + , search_graph AS sg WHERE g.f = sg.t AND NOT is_cycle ) @@ -84,7 +84,7 @@ WITH RECURSIVE search_graph AS ( arrayConcat(sg.path, [tuple(g.f, g.t)]) FROM graph AS g - CROSS JOIN search_graph AS sg + , search_graph AS sg WHERE g.f = sg.t AND NOT is_cycle ) diff --git a/tests/clickhouse-reference/03042_not_found_column_c1.sql.expected.ast.json b/tests/clickhouse-reference/03042_not_found_column_c1.sql.expected.ast.json index 5f3e5aeca..3a9a887ca 100644 --- a/tests/clickhouse-reference/03042_not_found_column_c1.sql.expected.ast.json +++ b/tests/clickhouse-reference/03042_not_found_column_c1.sql.expected.ast.json @@ -244,6 +244,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t0" @@ -251,6 +252,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t1" @@ -258,6 +260,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -265,6 +268,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t4" diff --git a/tests/clickhouse-reference/03042_not_found_column_c1.sql.expected.formatted.sql b/tests/clickhouse-reference/03042_not_found_column_c1.sql.expected.formatted.sql index bc7990da2..3301dec6c 100644 --- a/tests/clickhouse-reference/03042_not_found_column_c1.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03042_not_found_column_c1.sql.expected.formatted.sql @@ -49,7 +49,7 @@ SELECT t4.c0 FROM t3 -CROSS JOIN t0 -CROSS JOIN t1 -CROSS JOIN t2 -CROSS JOIN t4; \ No newline at end of file +, t0 +, t1 +, t2 +, t4; \ No newline at end of file diff --git a/tests/clickhouse-reference/03043_group_array_result_is_expected.sql.expected.ast.json b/tests/clickhouse-reference/03043_group_array_result_is_expected.sql.expected.ast.json index a8ffb83ba..41ee2150b 100644 --- a/tests/clickhouse-reference/03043_group_array_result_is_expected.sql.expected.ast.json +++ b/tests/clickhouse-reference/03043_group_array_result_is_expected.sql.expected.ast.json @@ -254,6 +254,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "functionCall", "name": "toDate", diff --git a/tests/clickhouse-reference/03054_analyzer_join_alias.sql.expected.ast.json b/tests/clickhouse-reference/03054_analyzer_join_alias.sql.expected.ast.json index 5deafe258..0b7e7f414 100644 --- a/tests/clickhouse-reference/03054_analyzer_join_alias.sql.expected.ast.json +++ b/tests/clickhouse-reference/03054_analyzer_join_alias.sql.expected.ast.json @@ -106,7 +106,8 @@ ] } } - } + }, + "strictness": "ALL" } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/03054_analyzer_join_alias.sql.expected.formatted.sql b/tests/clickhouse-reference/03054_analyzer_join_alias.sql.expected.formatted.sql index f6f0681ff..5c84c4a67 100644 --- a/tests/clickhouse-reference/03054_analyzer_join_alias.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03054_analyzer_join_alias.sql.expected.formatted.sql @@ -7,7 +7,7 @@ FROM SELECT number AS key_1 FROM numbers(15) ) AS x -INNER JOIN ( +ALL INNER JOIN ( SELECT number AS key_1 FROM numbers(10) ) AS z diff --git a/tests/clickhouse-reference/03059_analyzer_join_engine_missing_column.sql.expected.ast.json b/tests/clickhouse-reference/03059_analyzer_join_engine_missing_column.sql.expected.ast.json index d6c2ac28f..8675d22b2 100644 --- a/tests/clickhouse-reference/03059_analyzer_join_engine_missing_column.sql.expected.ast.json +++ b/tests/clickhouse-reference/03059_analyzer_join_engine_missing_column.sql.expected.ast.json @@ -176,7 +176,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "settings": [ { @@ -212,7 +213,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "settings": [ { diff --git a/tests/clickhouse-reference/03059_analyzer_join_engine_missing_column.sql.expected.formatted.sql b/tests/clickhouse-reference/03059_analyzer_join_engine_missing_column.sql.expected.formatted.sql index 34797dc5f..01f21f300 100644 --- a/tests/clickhouse-reference/03059_analyzer_join_engine_missing_column.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03059_analyzer_join_engine_missing_column.sql.expected.formatted.sql @@ -27,13 +27,13 @@ SETTINGS join_use_nulls = 1; SELECT * FROM id_val -LEFT JOIN id_val_join0 +ANY LEFT JOIN id_val_join0 USING (id) SETTINGS join_use_nulls = 0; SELECT * FROM id_val -LEFT JOIN id_val_join1 +ANY LEFT JOIN id_val_join1 USING (id) SETTINGS join_use_nulls = 1; \ No newline at end of file diff --git a/tests/clickhouse-reference/03062_analyzer_join_engine_missing_column.sql.expected.ast.json b/tests/clickhouse-reference/03062_analyzer_join_engine_missing_column.sql.expected.ast.json index ab30b2f36..066d92a23 100644 --- a/tests/clickhouse-reference/03062_analyzer_join_engine_missing_column.sql.expected.ast.json +++ b/tests/clickhouse-reference/03062_analyzer_join_engine_missing_column.sql.expected.ast.json @@ -246,7 +246,8 @@ "TOPIC", "PARTITION" ] - } + }, + "strictness": "ANY" } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/03062_analyzer_join_engine_missing_column.sql.expected.formatted.sql b/tests/clickhouse-reference/03062_analyzer_join_engine_missing_column.sql.expected.formatted.sql index 7789a561c..7481a99b9 100644 --- a/tests/clickhouse-reference/03062_analyzer_join_engine_missing_column.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03062_analyzer_join_engine_missing_column.sql.expected.formatted.sql @@ -32,5 +32,5 @@ FROM test; SELECT * FROM test -LEFT JOIN test_join +ANY LEFT JOIN test_join USING (TOPIC, `PARTITION`); \ No newline at end of file diff --git a/tests/clickhouse-reference/03080_incorrect_join_with_merge.sql.expected.ast.json b/tests/clickhouse-reference/03080_incorrect_join_with_merge.sql.expected.ast.json index d95cea344..7c26e66c4 100644 --- a/tests/clickhouse-reference/03080_incorrect_join_with_merge.sql.expected.ast.json +++ b/tests/clickhouse-reference/03080_incorrect_join_with_merge.sql.expected.ast.json @@ -329,7 +329,9 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY", + "global": true }, "where": { "kind": "inExpr", @@ -400,7 +402,9 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY", + "global": true }, "where": { "kind": "inExpr", diff --git a/tests/clickhouse-reference/03080_incorrect_join_with_merge.sql.expected.formatted.sql b/tests/clickhouse-reference/03080_incorrect_join_with_merge.sql.expected.formatted.sql index 45e903234..d2cead3cb 100644 --- a/tests/clickhouse-reference/03080_incorrect_join_with_merge.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03080_incorrect_join_with_merge.sql.expected.formatted.sql @@ -57,7 +57,7 @@ ENGINE = Merge(currentDatabase(), '^(first_table)$'); SELECT count() FROM first_table AS s -INNER JOIN second_table AS f +GLOBAL ANY INNER JOIN second_table AS f USING (id) WHERE f.id2 GLOBAL IN ( SELECT id2 @@ -68,7 +68,7 @@ WHERE f.id2 GLOBAL IN ( SELECT count() FROM two_tables AS s -INNER JOIN second_table AS f +GLOBAL ANY INNER JOIN second_table AS f USING (id) WHERE f.id2 GLOBAL IN ( SELECT id2 diff --git a/tests/clickhouse-reference/03088_analyzer_ambiguous_column_multi_call.sql.expected.ast.json b/tests/clickhouse-reference/03088_analyzer_ambiguous_column_multi_call.sql.expected.ast.json index cc38af8aa..91a4a0ffb 100644 --- a/tests/clickhouse-reference/03088_analyzer_ambiguous_column_multi_call.sql.expected.ast.json +++ b/tests/clickhouse-reference/03088_analyzer_ambiguous_column_multi_call.sql.expected.ast.json @@ -89,6 +89,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "database": { diff --git a/tests/clickhouse-reference/03088_analyzer_ambiguous_column_multi_call.sql.expected.formatted.sql b/tests/clickhouse-reference/03088_analyzer_ambiguous_column_multi_call.sql.expected.formatted.sql index 0c233f963..5fef0a4a4 100644 --- a/tests/clickhouse-reference/03088_analyzer_ambiguous_column_multi_call.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03088_analyzer_ambiguous_column_multi_call.sql.expected.formatted.sql @@ -14,4 +14,4 @@ ENGINE = Log(); SELECT {CLICKHOUSE_DATABASE:Identifier}.a.i FROM {CLICKHOUSE_DATABASE:Identifier}.a -CROSS JOIN {CLICKHOUSE_DATABASE:Identifier}.a AS x; \ No newline at end of file +, {CLICKHOUSE_DATABASE:Identifier}.a AS x; \ No newline at end of file diff --git a/tests/clickhouse-reference/03093_with_fill_support_constant_expression.sql.expected.ast.json b/tests/clickhouse-reference/03093_with_fill_support_constant_expression.sql.expected.ast.json index 69d27600f..6bcf5d69c 100644 --- a/tests/clickhouse-reference/03093_with_fill_support_constant_expression.sql.expected.ast.json +++ b/tests/clickhouse-reference/03093_with_fill_support_constant_expression.sql.expected.ast.json @@ -58,6 +58,7 @@ "value": "1" }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "columnRef", "parts": [ @@ -132,6 +133,7 @@ "value": "1" }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "columnRef", "parts": [ diff --git a/tests/clickhouse-reference/03095_join_filter_push_down_right_stream_filled.sql.expected.ast.json b/tests/clickhouse-reference/03095_join_filter_push_down_right_stream_filled.sql.expected.ast.json index 81f57b323..78045a780 100644 --- a/tests/clickhouse-reference/03095_join_filter_push_down_right_stream_filled.sql.expected.ast.json +++ b/tests/clickhouse-reference/03095_join_filter_push_down_right_stream_filled.sql.expected.ast.json @@ -318,7 +318,8 @@ } ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -355,7 +356,8 @@ "x" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ] }, diff --git a/tests/clickhouse-reference/03095_join_filter_push_down_right_stream_filled.sql.expected.formatted.sql b/tests/clickhouse-reference/03095_join_filter_push_down_right_stream_filled.sql.expected.formatted.sql index a850c60b5..773185f52 100644 --- a/tests/clickhouse-reference/03095_join_filter_push_down_right_stream_filled.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03095_join_filter_push_down_right_stream_filled.sql.expected.formatted.sql @@ -34,9 +34,9 @@ LEFT JOIN left_join__fuzz_2 USING (x) WHERE pointInPolygon(materialize((-inf, 1023)), [(5, 0.9998999834060669), (1.1920928955078125e-7, 100.0000991821289), (1.000100016593933, 100.0000991821289)]) ORDER BY - toNullable('202.79.32.10') DESC, + toNullable('202.79.32.10') DESC NULLS LAST, toNullable(toLowCardinality(toUInt256(14))) ASC, - x DESC; + x DESC NULLS LAST; DROP TABLE t1__fuzz_0; diff --git a/tests/clickhouse-reference/03095_window_functions_qualify.sql.expected.ast.json b/tests/clickhouse-reference/03095_window_functions_qualify.sql.expected.ast.json index 8225449df..5c129d072 100644 --- a/tests/clickhouse-reference/03095_window_functions_qualify.sql.expected.ast.json +++ b/tests/clickhouse-reference/03095_window_functions_qualify.sql.expected.ast.json @@ -706,7 +706,8 @@ } ] } - ] + ], + "nullsAction": "IGNORE NULLS" } ], "from": { @@ -792,7 +793,8 @@ "type": "UInt64", "value": "4" } - ] + ], + "nullsAction": "IGNORE NULLS" }, { "kind": "alias", @@ -899,7 +901,8 @@ { "kind": "functionCall", "name": "count", - "args": [] + "args": [], + "nullsAction": "IGNORE NULLS" } ], "from": { diff --git a/tests/clickhouse-reference/03095_window_functions_qualify.sql.expected.formatted.sql b/tests/clickhouse-reference/03095_window_functions_qualify.sql.expected.formatted.sql index b0998f187..712724640 100644 --- a/tests/clickhouse-reference/03095_window_functions_qualify.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03095_window_functions_qualify.sql.expected.formatted.sql @@ -60,7 +60,7 @@ QUALIFY key = toNullable(toNullable(0)); -- { serverError NOT_IMPLEMENTED } SELECT number % 2 AS key, - count(materialize(5)) + count(materialize(5)) IGNORE NULLS FROM numbers(10) WHERE toLowCardinality(toLowCardinality(materialize(2))) GROUP BY key @@ -70,7 +70,7 @@ QUALIFY key = 0; -- { serverError NOT_IMPLEMENTED } SELECT 4, - count(4), + count(4) IGNORE NULLS, number % 2 AS key FROM numbers(10) GROUP BY key @@ -81,7 +81,7 @@ QUALIFY key = materialize(0); -- { serverError NOT_IMPLEMENTED } SELECT 3, number % toLowCardinality(2) AS key, - count() + count() IGNORE NULLS FROM numbers(10) GROUP BY key WITH ROLLUP diff --git a/tests/clickhouse-reference/03098_prefer_column_to_alias_subquery.sql.expected.ast.json b/tests/clickhouse-reference/03098_prefer_column_to_alias_subquery.sql.expected.ast.json index ab62d76de..98ffb91d1 100644 --- a/tests/clickhouse-reference/03098_prefer_column_to_alias_subquery.sql.expected.ast.json +++ b/tests/clickhouse-reference/03098_prefer_column_to_alias_subquery.sql.expected.ast.json @@ -257,7 +257,8 @@ "ALL" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ], "leadingComments": [ diff --git a/tests/clickhouse-reference/03098_prefer_column_to_alias_subquery.sql.expected.formatted.sql b/tests/clickhouse-reference/03098_prefer_column_to_alias_subquery.sql.expected.formatted.sql index ec53bb4dd..7319199c7 100644 --- a/tests/clickhouse-reference/03098_prefer_column_to_alias_subquery.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03098_prefer_column_to_alias_subquery.sql.expected.formatted.sql @@ -47,7 +47,7 @@ FROM ( GROUP BY id SETTINGS prefer_column_name_to_alias = 1 ) -ORDER BY `ALL` DESC; +ORDER BY `ALL` DESC NULLS LAST; SELECT '-------------------------'; diff --git a/tests/clickhouse-reference/03101_analyzer_identifiers_1.sql.expected.ast.json b/tests/clickhouse-reference/03101_analyzer_identifiers_1.sql.expected.ast.json index 07cb6c566..8d329b436 100644 --- a/tests/clickhouse-reference/03101_analyzer_identifiers_1.sql.expected.ast.json +++ b/tests/clickhouse-reference/03101_analyzer_identifiers_1.sql.expected.ast.json @@ -227,6 +227,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { diff --git a/tests/clickhouse-reference/03101_analyzer_identifiers_1.sql.expected.formatted.sql b/tests/clickhouse-reference/03101_analyzer_identifiers_1.sql.expected.formatted.sql index 68477cdaa..e1f2efaaa 100644 --- a/tests/clickhouse-reference/03101_analyzer_identifiers_1.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03101_analyzer_identifiers_1.sql.expected.formatted.sql @@ -38,7 +38,7 @@ FROM y FROM VALUES('x UInt16, y UInt16', (0,1)) ) AS t1 -CROSS JOIN ( +, ( SELECT x, z diff --git a/tests/clickhouse-reference/03101_analyzer_identifiers_3.sql.expected.ast.json b/tests/clickhouse-reference/03101_analyzer_identifiers_3.sql.expected.ast.json index 4559bb8eb..6fd45bbd7 100644 --- a/tests/clickhouse-reference/03101_analyzer_identifiers_3.sql.expected.ast.json +++ b/tests/clickhouse-reference/03101_analyzer_identifiers_3.sql.expected.ast.json @@ -295,6 +295,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -352,6 +353,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -403,6 +405,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -462,6 +465,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { diff --git a/tests/clickhouse-reference/03101_analyzer_identifiers_3.sql.expected.formatted.sql b/tests/clickhouse-reference/03101_analyzer_identifiers_3.sql.expected.formatted.sql index 84d9ee285..c2c085d34 100644 --- a/tests/clickhouse-reference/03101_analyzer_identifiers_3.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03101_analyzer_identifiers_3.sql.expected.formatted.sql @@ -56,7 +56,7 @@ FROM ( SELECT 1 AS a ) AS t -CROSS JOIN ( +, ( SELECT 2 AS b ) AS u; @@ -68,7 +68,7 @@ FROM ( SELECT 1 AS a ) AS t -CROSS JOIN ( +, ( SELECT 2 AS b ) AS u; @@ -77,7 +77,7 @@ FROM ( SELECT 1 AS a ) AS t -CROSS JOIN ( +, ( SELECT 1 AS a ) AS u; @@ -89,7 +89,7 @@ FROM ( SELECT 1 AS a ) AS t -CROSS JOIN ( +, ( SELECT 1 AS a ) AS u; diff --git a/tests/clickhouse-reference/03101_analyzer_identifiers_4.sql.expected.ast.json b/tests/clickhouse-reference/03101_analyzer_identifiers_4.sql.expected.ast.json index ca405e765..5bb47df84 100644 --- a/tests/clickhouse-reference/03101_analyzer_identifiers_4.sql.expected.ast.json +++ b/tests/clickhouse-reference/03101_analyzer_identifiers_4.sql.expected.ast.json @@ -385,6 +385,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "u" @@ -422,6 +423,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "u" diff --git a/tests/clickhouse-reference/03101_analyzer_identifiers_4.sql.expected.formatted.sql b/tests/clickhouse-reference/03101_analyzer_identifiers_4.sql.expected.formatted.sql index 6c6221c1a..f22304bf6 100644 --- a/tests/clickhouse-reference/03101_analyzer_identifiers_4.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03101_analyzer_identifiers_4.sql.expected.formatted.sql @@ -54,12 +54,12 @@ FROM t; SELECT t.COLUMNS('^c') FROM t -CROSS JOIN u; +, u; SELECT t.COLUMNS('^c') EXCEPT (test_hello, test_world) FROM t -CROSS JOIN u; +, u; SELECT * FROM ( diff --git a/tests/clickhouse-reference/03126_column_not_under_group_by.sql.expected.ast.json b/tests/clickhouse-reference/03126_column_not_under_group_by.sql.expected.ast.json index 2d197689f..e03a30c90 100644 --- a/tests/clickhouse-reference/03126_column_not_under_group_by.sql.expected.ast.json +++ b/tests/clickhouse-reference/03126_column_not_under_group_by.sql.expected.ast.json @@ -119,7 +119,8 @@ ] } } - } + }, + "strictness": "ANY" }, "groupBy": { "kind": "expressions", diff --git a/tests/clickhouse-reference/03126_column_not_under_group_by.sql.expected.formatted.sql b/tests/clickhouse-reference/03126_column_not_under_group_by.sql.expected.formatted.sql index 2a2d45e90..8f057f46d 100644 --- a/tests/clickhouse-reference/03126_column_not_under_group_by.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03126_column_not_under_group_by.sql.expected.formatted.sql @@ -10,7 +10,7 @@ FROM 1 AS x, 2 AS c ) AS v -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 1 AS x, 2 AS a diff --git a/tests/clickhouse-reference/03132_jit_sort_description_crash_fix.sql.expected.ast.json b/tests/clickhouse-reference/03132_jit_sort_description_crash_fix.sql.expected.ast.json index c6d60fb1f..69a817b2a 100644 --- a/tests/clickhouse-reference/03132_jit_sort_description_crash_fix.sql.expected.ast.json +++ b/tests/clickhouse-reference/03132_jit_sort_description_crash_fix.sql.expected.ast.json @@ -418,7 +418,8 @@ } ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -646,7 +647,8 @@ } ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, diff --git a/tests/clickhouse-reference/03132_jit_sort_description_crash_fix.sql.expected.formatted.sql b/tests/clickhouse-reference/03132_jit_sort_description_crash_fix.sql.expected.formatted.sql index 82d6dfb7d..de0878901 100644 --- a/tests/clickhouse-reference/03132_jit_sort_description_crash_fix.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03132_jit_sort_description_crash_fix.sql.expected.formatted.sql @@ -35,7 +35,7 @@ FROM test1_00395 WHERE toNullable(27) GROUP BY col1 ORDER BY - multiIf(27, 1, multiIf(materialize(1), toLowCardinality(2), 3, 1, 4), NULL, 4) ASC, + multiIf(27, 1, multiIf(materialize(1), toLowCardinality(2), 3, 1, 4), NULL, 4) ASC NULLS LAST, col1 DESC; SELECT '--'; @@ -47,7 +47,7 @@ FROM test1_00395 GROUP BY col1 WITH CUBE WITH TOTALS -ORDER BY multiIf(27, 1, multiIf(materialize(1), toLowCardinality(2), 3, 1, 4), NULL, 4) ASC; +ORDER BY multiIf(27, 1, multiIf(materialize(1), toLowCardinality(2), 3, 1, 4), NULL, 4) ASC NULLS LAST; SELECT col1 FROM test1_00395 diff --git a/tests/clickhouse-reference/03132_sqlancer_union_all.sql.expected.ast.json b/tests/clickhouse-reference/03132_sqlancer_union_all.sql.expected.ast.json index 9abab7b2c..424197eca 100644 --- a/tests/clickhouse-reference/03132_sqlancer_union_all.sql.expected.ast.json +++ b/tests/clickhouse-reference/03132_sqlancer_union_all.sql.expected.ast.json @@ -302,6 +302,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t1" @@ -344,6 +345,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t1" @@ -379,6 +381,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t1" diff --git a/tests/clickhouse-reference/03132_sqlancer_union_all.sql.expected.formatted.sql b/tests/clickhouse-reference/03132_sqlancer_union_all.sql.expected.formatted.sql index 8344a74a5..5e59adcb5 100644 --- a/tests/clickhouse-reference/03132_sqlancer_union_all.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03132_sqlancer_union_all.sql.expected.formatted.sql @@ -56,18 +56,18 @@ INSERT INTO t2 (c0); SELECT t1.c1 FROM t3 -CROSS JOIN t1 +, t1 WHERE true AND t1.c2 UNION ALL SELECT t1.c1 FROM t3 -CROSS JOIN t1 +, t1 WHERE NOT t1.c2 UNION ALL SELECT t1.c1 FROM t3 -CROSS JOIN t1 +, t1 WHERE isNull(t1.c2); \ No newline at end of file diff --git a/tests/clickhouse-reference/03142_window_function_limit_by.sql.expected.ast.json b/tests/clickhouse-reference/03142_window_function_limit_by.sql.expected.ast.json index 4cf8dee55..0dbbf7400 100644 --- a/tests/clickhouse-reference/03142_window_function_limit_by.sql.expected.ast.json +++ b/tests/clickhouse-reference/03142_window_function_limit_by.sql.expected.ast.json @@ -194,7 +194,8 @@ { "kind": "asterisk" } - ] + ], + "windowName": "w" }, "alias": "count_rows_w" } diff --git a/tests/clickhouse-reference/03142_window_function_limit_by.sql.expected.formatted.sql b/tests/clickhouse-reference/03142_window_function_limit_by.sql.expected.formatted.sql index c3cd3dea2..d9cc0288c 100644 --- a/tests/clickhouse-reference/03142_window_function_limit_by.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03142_window_function_limit_by.sql.expected.formatted.sql @@ -15,7 +15,7 @@ FROM VALUES(('a', 2, 4), ('a', 4, 2), ('a', 6, 3), ('a', 8, 4)); SELECT k, `in` / out AS ratio, - count(*) AS count_rows_w + count(*) OVER w AS count_rows_w FROM error_win_func ORDER BY `ALL` ASC LIMIT 1 BY k diff --git a/tests/clickhouse-reference/03143_asof_join_ddb_long.sql.expected.ast.json b/tests/clickhouse-reference/03143_asof_join_ddb_long.sql.expected.ast.json index 703242481..f44a04a05 100644 --- a/tests/clickhouse-reference/03143_asof_join_ddb_long.sql.expected.ast.json +++ b/tests/clickhouse-reference/03143_asof_join_ddb_long.sql.expected.ast.json @@ -475,7 +475,8 @@ "key", "begin" ] - } + }, + "strictness": "ASOF" } }, { @@ -520,7 +521,8 @@ "key", "begin" ] - } + }, + "strictness": "ASOF" }, "settings": [ { diff --git a/tests/clickhouse-reference/03143_asof_join_ddb_long.sql.expected.formatted.sql b/tests/clickhouse-reference/03143_asof_join_ddb_long.sql.expected.formatted.sql index 3af047bdf..485c3e9d9 100644 --- a/tests/clickhouse-reference/03143_asof_join_ddb_long.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03143_asof_join_ddb_long.sql.expected.formatted.sql @@ -45,7 +45,7 @@ SELECT COUNT(*) FROM skewed_probe -INNER JOIN build +ASOF INNER JOIN build USING (key, begin); SELECT @@ -53,6 +53,6 @@ SELECT COUNT(*) FROM skewed_probe -INNER JOIN build +ASOF INNER JOIN build USING (key, begin) SETTINGS join_algorithm = 'full_sorting_merge'; \ No newline at end of file diff --git a/tests/clickhouse-reference/03144_asof_join_ddb_doubles.sql.expected.ast.json b/tests/clickhouse-reference/03144_asof_join_ddb_doubles.sql.expected.ast.json index 3ffee45c0..97a7f2e6f 100644 --- a/tests/clickhouse-reference/03144_asof_join_ddb_doubles.sql.expected.ast.json +++ b/tests/clickhouse-reference/03144_asof_join_ddb_doubles.sql.expected.ast.json @@ -161,7 +161,8 @@ ] } } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -258,7 +259,8 @@ ] } } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -437,6 +439,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -544,7 +547,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -653,7 +657,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -676,7 +681,8 @@ "ts" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] } diff --git a/tests/clickhouse-reference/03144_asof_join_ddb_doubles.sql.expected.formatted.sql b/tests/clickhouse-reference/03144_asof_join_ddb_doubles.sql.expected.formatted.sql index cc8021e78..fba59a800 100644 --- a/tests/clickhouse-reference/03144_asof_join_ddb_doubles.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03144_asof_join_ddb_doubles.sql.expected.formatted.sql @@ -22,7 +22,7 @@ FROM SELECT number::Float64 AS ts FROM numbers(10) ) AS p -INNER JOIN events0 AS e +ASOF INNER JOIN events0 AS e ON p.ts >= e.begin ORDER BY p.ts ASC; @@ -34,7 +34,7 @@ FROM SELECT number::Float64 AS ts FROM numbers(10) ) AS p -LEFT JOIN events0 AS e +ASOF LEFT JOIN events0 AS e ON p.ts >= e.begin ORDER BY p.ts ASC; @@ -66,7 +66,7 @@ SELECT ts.number FROM numbers(1, 2) AS key -CROSS JOIN numbers(10) AS ts +, numbers(10) AS ts SETTINGS join_algorithm = 'hash'; SELECT @@ -75,7 +75,7 @@ SELECT e.value FROM probes AS p -INNER JOIN events AS e +ASOF INNER JOIN events AS e ON p.key = e.key AND p.ts >= e.begin ORDER BY @@ -88,9 +88,9 @@ SELECT e.value FROM probes AS p -LEFT JOIN events AS e +ASOF LEFT JOIN events AS e ON p.key = e.key AND p.ts >= e.begin ORDER BY p.key ASC, - p.ts ASC; \ No newline at end of file + p.ts ASC NULLS FIRST; \ No newline at end of file diff --git a/tests/clickhouse-reference/03145_asof_join_ddb_inequalities.sql.expected.ast.json b/tests/clickhouse-reference/03145_asof_join_ddb_inequalities.sql.expected.ast.json index c2684aaec..1558304e7 100644 --- a/tests/clickhouse-reference/03145_asof_join_ddb_inequalities.sql.expected.ast.json +++ b/tests/clickhouse-reference/03145_asof_join_ddb_inequalities.sql.expected.ast.json @@ -360,7 +360,8 @@ ] } } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -434,7 +435,8 @@ ] } } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -508,7 +510,8 @@ ] } } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -582,7 +585,8 @@ ] } } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -656,7 +660,8 @@ ] } } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -730,7 +735,8 @@ ] } } - } + }, + "strictness": "ASOF" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/03145_asof_join_ddb_inequalities.sql.expected.formatted.sql b/tests/clickhouse-reference/03145_asof_join_ddb_inequalities.sql.expected.formatted.sql index ff7fffea5..24ab4e9d3 100644 --- a/tests/clickhouse-reference/03145_asof_join_ddb_inequalities.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03145_asof_join_ddb_inequalities.sql.expected.formatted.sql @@ -43,7 +43,7 @@ SELECT e.value FROM probe0 AS p -INNER JOIN events0 AS e +ASOF INNER JOIN events0 AS e ON p.begin > e.begin ORDER BY p.begin ASC; @@ -53,7 +53,7 @@ SELECT e.value FROM probe0 AS p -LEFT JOIN events0 AS e +ASOF LEFT JOIN events0 AS e ON p.begin > e.begin ORDER BY p.begin ASC; @@ -63,7 +63,7 @@ SELECT e.value FROM probe0 AS p -INNER JOIN events0 AS e +ASOF INNER JOIN events0 AS e ON p.begin <= e.begin ORDER BY p.begin ASC; @@ -73,7 +73,7 @@ SELECT e.value FROM probe0 AS p -LEFT JOIN events0 AS e +ASOF LEFT JOIN events0 AS e ON p.begin <= e.begin ORDER BY p.begin ASC; @@ -83,7 +83,7 @@ SELECT e.value FROM probe0 AS p -INNER JOIN events0 AS e +ASOF INNER JOIN events0 AS e ON p.begin < e.begin ORDER BY p.begin ASC; @@ -93,6 +93,6 @@ SELECT e.value FROM probe0 AS p -LEFT JOIN events0 AS e +ASOF LEFT JOIN events0 AS e ON p.begin < e.begin ORDER BY p.begin ASC; \ No newline at end of file diff --git a/tests/clickhouse-reference/03147_asof_join_ddb_missing.sql.expected.ast.json b/tests/clickhouse-reference/03147_asof_join_ddb_missing.sql.expected.ast.json index e9243246b..ae3278156 100644 --- a/tests/clickhouse-reference/03147_asof_join_ddb_missing.sql.expected.ast.json +++ b/tests/clickhouse-reference/03147_asof_join_ddb_missing.sql.expected.ast.json @@ -135,6 +135,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -266,7 +267,8 @@ "k", "t" ] - } + }, + "strictness": "ASOF" }, "leadingComments": [ "-- # 10 dates, 5 keys" @@ -356,6 +358,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -498,7 +501,8 @@ "k", "t" ] - } + }, + "strictness": "ASOF" }, "leadingComments": [ "-- # Coverage: Missing right side bin" @@ -575,6 +579,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -706,7 +711,8 @@ "k", "t" ] - } + }, + "strictness": "ASOF" }, "leadingComments": [ "-- # 20 dates, 5 keys" @@ -783,6 +789,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -914,7 +921,8 @@ "k", "t" ] - } + }, + "strictness": "ASOF" }, "leadingComments": [ "-- # 30 dates, 5 keys" @@ -991,6 +999,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -1122,7 +1131,8 @@ "k", "t" ] - } + }, + "strictness": "ASOF" }, "leadingComments": [ "-- # 50 dates, 5 keys" @@ -1199,6 +1209,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -1330,7 +1341,8 @@ "k", "t" ] - } + }, + "strictness": "ASOF" }, "leadingComments": [ "-- # 100 dates, 5 keys" @@ -1407,6 +1419,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -1538,7 +1551,8 @@ "k", "t" ] - } + }, + "strictness": "ASOF" }, "leadingComments": [ "-- # 100 dates, 50 keys" @@ -1615,6 +1629,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -1746,7 +1761,8 @@ "k", "t" ] - } + }, + "strictness": "ASOF" }, "leadingComments": [ "-- # 1000 dates, 5 keys" @@ -1823,6 +1839,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -1954,7 +1971,8 @@ "k", "t" ] - } + }, + "strictness": "ASOF" }, "leadingComments": [ "-- # 1000 dates, 50 keys" @@ -2031,6 +2049,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -2162,7 +2181,8 @@ "k", "t" ] - } + }, + "strictness": "ASOF" }, "leadingComments": [ "-- # 10000 dates, 50 keys" diff --git a/tests/clickhouse-reference/03147_asof_join_ddb_missing.sql.expected.formatted.sql b/tests/clickhouse-reference/03147_asof_join_ddb_missing.sql.expected.formatted.sql index 049cbd678..ce863fc87 100644 --- a/tests/clickhouse-reference/03147_asof_join_ddb_missing.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03147_asof_join_ddb_missing.sql.expected.formatted.sql @@ -16,7 +16,7 @@ WITH build AS ( number AS v FROM numbers(10) - CROSS JOIN ( + , ( SELECT number AS k FROM numbers(5) ) @@ -33,7 +33,7 @@ probe AS ( SELECT SUM(v) FROM probe -INNER JOIN build +ASOF INNER JOIN build USING (k, t); -- # Coverage: Missing right side bin @@ -44,7 +44,7 @@ WITH build AS ( number AS v FROM numbers(10) - CROSS JOIN ( + , ( SELECT number AS k FROM numbers(5) ) @@ -63,7 +63,7 @@ SELECT COUNT(*) FROM probe -INNER JOIN build +ASOF INNER JOIN build USING (k, t); -- # 20 dates, 5 keys @@ -74,7 +74,7 @@ WITH build AS ( number AS v FROM numbers(20) - CROSS JOIN ( + , ( SELECT number AS k FROM numbers(5) ) @@ -91,7 +91,7 @@ probe AS ( SELECT SUM(v) FROM probe -INNER JOIN build +ASOF INNER JOIN build USING (k, t); -- # 30 dates, 5 keys @@ -102,7 +102,7 @@ WITH build AS ( number AS v FROM numbers(30) - CROSS JOIN ( + , ( SELECT number AS k FROM numbers(5) ) @@ -119,7 +119,7 @@ probe AS ( SELECT SUM(v) FROM probe -INNER JOIN build +ASOF INNER JOIN build USING (k, t); -- # 50 dates, 5 keys @@ -130,7 +130,7 @@ WITH build AS ( number AS v FROM numbers(50) - CROSS JOIN ( + , ( SELECT number AS k FROM numbers(5) ) @@ -147,7 +147,7 @@ probe AS ( SELECT SUM(v) FROM probe -INNER JOIN build +ASOF INNER JOIN build USING (k, t); -- # 100 dates, 5 keys @@ -158,7 +158,7 @@ WITH build AS ( number AS v FROM numbers(100) - CROSS JOIN ( + , ( SELECT number AS k FROM numbers(5) ) @@ -175,7 +175,7 @@ probe AS ( SELECT SUM(v) FROM probe -INNER JOIN build +ASOF INNER JOIN build USING (k, t); -- # 100 dates, 50 keys @@ -186,7 +186,7 @@ WITH build AS ( number AS v FROM numbers(100) - CROSS JOIN ( + , ( SELECT number AS k FROM numbers(50) ) @@ -203,7 +203,7 @@ probe AS ( SELECT SUM(v) FROM probe -INNER JOIN build +ASOF INNER JOIN build USING (k, t); -- # 1000 dates, 5 keys @@ -214,7 +214,7 @@ WITH build AS ( number AS v FROM numbers(1000) - CROSS JOIN ( + , ( SELECT number AS k FROM numbers(5) ) @@ -231,7 +231,7 @@ probe AS ( SELECT SUM(v) FROM probe -INNER JOIN build +ASOF INNER JOIN build USING (k, t); -- # 1000 dates, 50 keys @@ -242,7 +242,7 @@ WITH build AS ( number AS v FROM numbers(1000) - CROSS JOIN ( + , ( SELECT number AS k FROM numbers(50) ) @@ -259,7 +259,7 @@ probe AS ( SELECT SUM(v) FROM probe -INNER JOIN build +ASOF INNER JOIN build USING (k, t); -- # 10000 dates, 50 keys @@ -270,7 +270,7 @@ WITH build AS ( number AS v FROM numbers(10000) - CROSS JOIN ( + , ( SELECT number AS k FROM numbers(50) ) @@ -287,5 +287,5 @@ probe AS ( SELECT SUM(v) FROM probe -INNER JOIN build +ASOF INNER JOIN build USING (k, t); \ No newline at end of file diff --git a/tests/clickhouse-reference/03148_asof_join_ddb_subquery.sql.expected.ast.json b/tests/clickhouse-reference/03148_asof_join_ddb_subquery.sql.expected.ast.json index 2380c1ae2..2701e9c99 100644 --- a/tests/clickhouse-reference/03148_asof_join_ddb_subquery.sql.expected.ast.json +++ b/tests/clickhouse-reference/03148_asof_join_ddb_subquery.sql.expected.ast.json @@ -238,7 +238,8 @@ "columns": [ "begin" ] - } + }, + "strictness": "ASOF" } } } diff --git a/tests/clickhouse-reference/03148_asof_join_ddb_subquery.sql.expected.formatted.sql b/tests/clickhouse-reference/03148_asof_join_ddb_subquery.sql.expected.formatted.sql index 105f595b5..7213f45e1 100644 --- a/tests/clickhouse-reference/03148_asof_join_ddb_subquery.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03148_asof_join_ddb_subquery.sql.expected.formatted.sql @@ -26,7 +26,7 @@ SELECT FROM events AS e1 WHERE e1.value = events.value ) AS e1 - INNER JOIN ( + ASOF INNER JOIN ( SELECT number::Float64 AS begin FROM numbers(10) WHERE number >= 1 diff --git a/tests/clickhouse-reference/03149_analyzer_window_redefinition.sql.expected.ast.json b/tests/clickhouse-reference/03149_analyzer_window_redefinition.sql.expected.ast.json index 93492bf16..7776cf311 100644 --- a/tests/clickhouse-reference/03149_analyzer_window_redefinition.sql.expected.ast.json +++ b/tests/clickhouse-reference/03149_analyzer_window_redefinition.sql.expected.ast.json @@ -81,7 +81,8 @@ { "kind": "asterisk" } - ] + ], + "windowName": "w" } ], "from": { diff --git a/tests/clickhouse-reference/03149_analyzer_window_redefinition.sql.expected.formatted.sql b/tests/clickhouse-reference/03149_analyzer_window_redefinition.sql.expected.formatted.sql index 2d0cdd075..5ff1a3ec9 100644 --- a/tests/clickhouse-reference/03149_analyzer_window_redefinition.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03149_analyzer_window_redefinition.sql.expected.formatted.sql @@ -13,7 +13,7 @@ INSERT INTO users; INSERT INTO users; -SELECT count(*) +SELECT count(*) OVER w FROM users WINDOW w AS (ORDER BY uid ASC), diff --git a/tests/clickhouse-reference/03149_asof_join_ddb_timestamps.sql.expected.ast.json b/tests/clickhouse-reference/03149_asof_join_ddb_timestamps.sql.expected.ast.json index 256eb55d7..1515a3f37 100644 --- a/tests/clickhouse-reference/03149_asof_join_ddb_timestamps.sql.expected.ast.json +++ b/tests/clickhouse-reference/03149_asof_join_ddb_timestamps.sql.expected.ast.json @@ -332,7 +332,8 @@ ] } } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -384,7 +385,8 @@ "columns": [ "begin" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -461,7 +463,8 @@ ] } } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -513,7 +516,8 @@ "columns": [ "begin" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -590,7 +594,8 @@ ] } } - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -645,7 +650,8 @@ "columns": [ "begin" ] - } + }, + "strictness": "ASOF" }, "orderBy": [ { @@ -786,7 +792,8 @@ } } } - } + }, + "strictness": "ASOF" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/03149_asof_join_ddb_timestamps.sql.expected.formatted.sql b/tests/clickhouse-reference/03149_asof_join_ddb_timestamps.sql.expected.formatted.sql index 8888907a8..0ace29020 100644 --- a/tests/clickhouse-reference/03149_asof_join_ddb_timestamps.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03149_asof_join_ddb_timestamps.sql.expected.formatted.sql @@ -33,7 +33,7 @@ SELECT e.value FROM probe0 AS p -INNER JOIN events0 AS e +ASOF INNER JOIN events0 AS e ON p.begin >= e.begin ORDER BY p.begin ASC; @@ -42,7 +42,7 @@ SELECT e.value FROM probe0 AS p -INNER JOIN events0 AS e +ASOF INNER JOIN events0 AS e USING (begin) ORDER BY p.begin ASC SETTINGS join_use_nulls = 0; @@ -52,7 +52,7 @@ SELECT e.value FROM probe0 AS p -LEFT JOIN events0 AS e +ASOF LEFT JOIN events0 AS e ON p.begin >= e.begin ORDER BY p.begin ASC; @@ -61,7 +61,7 @@ SELECT e.value FROM probe0 AS p -LEFT JOIN events0 AS e +ASOF LEFT JOIN events0 AS e USING (begin) ORDER BY p.begin ASC SETTINGS join_use_nulls = 0; @@ -71,7 +71,7 @@ SELECT e.value FROM probe0 AS p -RIGHT JOIN events0 AS e +ASOF RIGHT JOIN events0 AS e ON p.begin >= e.begin ORDER BY e.begin ASC; -- { serverError NOT_IMPLEMENTED} @@ -80,7 +80,7 @@ SELECT e.value FROM probe0 AS p -RIGHT JOIN events0 AS e +ASOF RIGHT JOIN events0 AS e USING (begin) ORDER BY e.begin ASC; -- { serverError NOT_IMPLEMENTED} @@ -89,7 +89,7 @@ SELECT e.value FROM probe0 AS p -LEFT JOIN ( +ASOF LEFT JOIN ( SELECT * FROM events0 WHERE log(value + 5) > 10 diff --git a/tests/clickhouse-reference/03151_redundant_distinct_with_window.sql.expected.ast.json b/tests/clickhouse-reference/03151_redundant_distinct_with_window.sql.expected.ast.json index a5f5fd837..94177ab03 100644 --- a/tests/clickhouse-reference/03151_redundant_distinct_with_window.sql.expected.ast.json +++ b/tests/clickhouse-reference/03151_redundant_distinct_with_window.sql.expected.ast.json @@ -173,7 +173,8 @@ "sval" ] } - ] + ], + "windowName": "w" }, "alias": "lval" } diff --git a/tests/clickhouse-reference/03151_redundant_distinct_with_window.sql.expected.formatted.sql b/tests/clickhouse-reference/03151_redundant_distinct_with_window.sql.expected.formatted.sql index 1e318df0c..f06957c79 100644 --- a/tests/clickhouse-reference/03151_redundant_distinct_with_window.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03151_redundant_distinct_with_window.sql.expected.formatted.sql @@ -20,7 +20,7 @@ SELECT t1.type AS type, sum(t1.val) AS sval, toStartOfDay(t1.dt) AS sday, - anyLast(sval) AS lval + anyLast(sval) OVER w AS lval FROM tab AS t1 GROUP BY type, diff --git a/tests/clickhouse-reference/03154_recursive_cte_distributed.sql.expected.ast.json b/tests/clickhouse-reference/03154_recursive_cte_distributed.sql.expected.ast.json index e5691997f..eda9dcf46 100644 --- a/tests/clickhouse-reference/03154_recursive_cte_distributed.sql.expected.ast.json +++ b/tests/clickhouse-reference/03154_recursive_cte_distributed.sql.expected.ast.json @@ -221,6 +221,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "search_tree", @@ -470,6 +471,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "search_tree", @@ -709,6 +711,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "search_tree", diff --git a/tests/clickhouse-reference/03154_recursive_cte_distributed.sql.expected.formatted.sql b/tests/clickhouse-reference/03154_recursive_cte_distributed.sql.expected.formatted.sql index 4bb5f4001..942acce87 100644 --- a/tests/clickhouse-reference/03154_recursive_cte_distributed.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03154_recursive_cte_distributed.sql.expected.formatted.sql @@ -32,7 +32,7 @@ WITH RECURSIVE search_tree AS ( depth + 1 FROM test_table AS t - CROSS JOIN search_tree AS st + , search_tree AS st WHERE t.parent_id = st.id ) @@ -60,7 +60,7 @@ WITH RECURSIVE search_tree AS ( depth + 1 FROM remote('127.0.0.1', currentDatabase(), test_table) AS t - CROSS JOIN search_tree AS st + , search_tree AS st WHERE t.parent_id = st.id ) @@ -86,7 +86,7 @@ WITH RECURSIVE search_tree AS ( depth + 1 FROM remote('127.0.0.{1,2}', currentDatabase(), test_table) AS t - CROSS JOIN search_tree AS st + , search_tree AS st WHERE t.parent_id = st.id ) diff --git a/tests/clickhouse-reference/03155_analyzer_interpolate.sql.expected.ast.json b/tests/clickhouse-reference/03155_analyzer_interpolate.sql.expected.ast.json index 37cc19a42..9c511f548 100644 --- a/tests/clickhouse-reference/03155_analyzer_interpolate.sql.expected.ast.json +++ b/tests/clickhouse-reference/03155_analyzer_interpolate.sql.expected.ast.json @@ -142,6 +142,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -328,6 +329,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -460,6 +462,7 @@ ] }, "direction": "ASC", + "withFill": true, "interpolate": [ { "col": "s", @@ -536,6 +539,7 @@ } }, "direction": "ASC", + "withFill": true, "interpolate": [ { "col": "pd", diff --git a/tests/clickhouse-reference/03156_nullable_number_tips.sql.expected.ast.json b/tests/clickhouse-reference/03156_nullable_number_tips.sql.expected.ast.json index b3e3de039..75966574e 100644 --- a/tests/clickhouse-reference/03156_nullable_number_tips.sql.expected.ast.json +++ b/tests/clickhouse-reference/03156_nullable_number_tips.sql.expected.ast.json @@ -286,7 +286,8 @@ "ALL" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ], "limit": { @@ -318,7 +319,8 @@ "ALL" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ], "limit": { @@ -350,7 +352,8 @@ "ALL" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ], "limit": { diff --git a/tests/clickhouse-reference/03156_nullable_number_tips.sql.expected.formatted.sql b/tests/clickhouse-reference/03156_nullable_number_tips.sql.expected.formatted.sql index db60eb853..062aca9c2 100644 --- a/tests/clickhouse-reference/03156_nullable_number_tips.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03156_nullable_number_tips.sql.expected.formatted.sql @@ -31,19 +31,19 @@ FROM test; SELECT * FROM test -ORDER BY `ALL` DESC +ORDER BY `ALL` DESC NULLS LAST LIMIT 1 FORMAT PRETTY; SELECT * FROM test -ORDER BY `ALL` ASC +ORDER BY `ALL` ASC NULLS LAST LIMIT 1 FORMAT PRETTY; SELECT * FROM test -ORDER BY `ALL` ASC +ORDER BY `ALL` ASC NULLS FIRST LIMIT 1 FORMAT PrettySpace; diff --git a/tests/clickhouse-reference/03164_optimize_read_in_order_nullable.sql.expected.ast.json b/tests/clickhouse-reference/03164_optimize_read_in_order_nullable.sql.expected.ast.json index 81f1cb359..871668816 100644 --- a/tests/clickhouse-reference/03164_optimize_read_in_order_nullable.sql.expected.ast.json +++ b/tests/clickhouse-reference/03164_optimize_read_in_order_nullable.sql.expected.ast.json @@ -141,7 +141,8 @@ "uid" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ], "limit": { @@ -292,7 +293,8 @@ "c1" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -302,7 +304,8 @@ "c2" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ], "settings": [ @@ -345,7 +348,8 @@ "c1" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -355,7 +359,8 @@ "c2" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ], "settings": [ @@ -398,7 +403,8 @@ "c1" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -408,7 +414,8 @@ "c2" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ], "settings": [ @@ -451,7 +458,8 @@ "c1" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -461,7 +469,8 @@ "c2" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ], "settings": [ diff --git a/tests/clickhouse-reference/03164_optimize_read_in_order_nullable.sql.expected.formatted.sql b/tests/clickhouse-reference/03164_optimize_read_in_order_nullable.sql.expected.formatted.sql index 3ccb356be..d8bdcafb2 100644 --- a/tests/clickhouse-reference/03164_optimize_read_in_order_nullable.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03164_optimize_read_in_order_nullable.sql.expected.formatted.sql @@ -23,7 +23,7 @@ SELECT '-- Reproducer result:'; SELECT * FROM `03164_users` -ORDER BY uid ASC +ORDER BY uid ASC NULLS FIRST LIMIT 10 SETTINGS optimize_read_in_order = 1; @@ -48,8 +48,8 @@ SELECT c2 FROM `03164_multi_key` ORDER BY - c1 ASC, - c2 ASC + c1 ASC NULLS LAST, + c2 ASC NULLS LAST SETTINGS optimize_read_in_order = 1; SELECT @@ -57,8 +57,8 @@ SELECT c2 FROM `03164_multi_key` ORDER BY - c1 ASC, - c2 ASC + c1 ASC NULLS LAST, + c2 ASC NULLS FIRST SETTINGS optimize_read_in_order = 1; SELECT @@ -66,8 +66,8 @@ SELECT c2 FROM `03164_multi_key` ORDER BY - c1 ASC, - c2 ASC + c1 ASC NULLS FIRST, + c2 ASC NULLS LAST SETTINGS optimize_read_in_order = 1; SELECT @@ -75,6 +75,6 @@ SELECT c2 FROM `03164_multi_key` ORDER BY - c1 DESC, - c2 DESC + c1 DESC NULLS FIRST, + c2 DESC NULLS LAST SETTINGS optimize_read_in_order = 1; \ No newline at end of file diff --git a/tests/clickhouse-reference/03171_condition_pushdown.sql.expected.ast.json b/tests/clickhouse-reference/03171_condition_pushdown.sql.expected.ast.json index 61e8ee282..50ac849be 100644 --- a/tests/clickhouse-reference/03171_condition_pushdown.sql.expected.ast.json +++ b/tests/clickhouse-reference/03171_condition_pushdown.sql.expected.ast.json @@ -48,6 +48,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { diff --git a/tests/clickhouse-reference/03171_condition_pushdown.sql.expected.formatted.sql b/tests/clickhouse-reference/03171_condition_pushdown.sql.expected.formatted.sql index 6c69b4507..7d2ca58d1 100644 --- a/tests/clickhouse-reference/03171_condition_pushdown.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03171_condition_pushdown.sql.expected.formatted.sql @@ -7,7 +7,7 @@ FROM SELECT * FROM numbers(1e19) ) AS t1 -CROSS JOIN ( +, ( SELECT * FROM numbers(1e19) ) AS t2 diff --git a/tests/clickhouse-reference/03173_distinct_combinator_alignment.sql.expected.ast.json b/tests/clickhouse-reference/03173_distinct_combinator_alignment.sql.expected.ast.json index 97a1a50b5..20a4cfee4 100644 --- a/tests/clickhouse-reference/03173_distinct_combinator_alignment.sql.expected.ast.json +++ b/tests/clickhouse-reference/03173_distinct_combinator_alignment.sql.expected.ast.json @@ -35,7 +35,8 @@ } ] } - ] + ], + "nullsAction": "IGNORE NULLS" } ] } diff --git a/tests/clickhouse-reference/03173_distinct_combinator_alignment.sql.expected.formatted.sql b/tests/clickhouse-reference/03173_distinct_combinator_alignment.sql.expected.formatted.sql index c50f11443..c24f7d9a0 100644 --- a/tests/clickhouse-reference/03173_distinct_combinator_alignment.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03173_distinct_combinator_alignment.sql.expected.formatted.sql @@ -1,4 +1,4 @@ -SELECT toTypeName(topKDistinctState(toNullable(10))(toString(number))) +SELECT toTypeName(topKDistinctState(toNullable(10))(toString(number)) IGNORE NULLS) FROM numbers(100) GROUP BY tuple((map((materialize(toNullable(1)), 2), 4, (3, 4), 5), 3)), diff --git a/tests/clickhouse-reference/03199_join_with_materialized_column.sql.expected.ast.json b/tests/clickhouse-reference/03199_join_with_materialized_column.sql.expected.ast.json index f3972070f..eee7d3f8a 100644 --- a/tests/clickhouse-reference/03199_join_with_materialized_column.sql.expected.ast.json +++ b/tests/clickhouse-reference/03199_join_with_materialized_column.sql.expected.ast.json @@ -79,6 +79,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "table_with_materialized" diff --git a/tests/clickhouse-reference/03199_join_with_materialized_column.sql.expected.formatted.sql b/tests/clickhouse-reference/03199_join_with_materialized_column.sql.expected.formatted.sql index 3f859a717..e8cd1b3da 100644 --- a/tests/clickhouse-reference/03199_join_with_materialized_column.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03199_join_with_materialized_column.sql.expected.formatted.sql @@ -12,6 +12,6 @@ ENGINE = Memory; SELECT number FROM numbers(1) AS n -CROSS JOIN table_with_materialized; +, table_with_materialized; DROP TABLE table_with_materialized; \ No newline at end of file diff --git a/tests/clickhouse-reference/03199_queries_with_new_analyzer.sql.expected.ast.json b/tests/clickhouse-reference/03199_queries_with_new_analyzer.sql.expected.ast.json index 3c13f2366..83f49859b 100644 --- a/tests/clickhouse-reference/03199_queries_with_new_analyzer.sql.expected.ast.json +++ b/tests/clickhouse-reference/03199_queries_with_new_analyzer.sql.expected.ast.json @@ -473,6 +473,7 @@ } }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", diff --git a/tests/clickhouse-reference/03205_column_type_check.sql.expected.ast.json b/tests/clickhouse-reference/03205_column_type_check.sql.expected.ast.json index 964e2970f..f4ef830c5 100644 --- a/tests/clickhouse-reference/03205_column_type_check.sql.expected.ast.json +++ b/tests/clickhouse-reference/03205_column_type_check.sql.expected.ast.json @@ -29,6 +29,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -284,6 +285,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { diff --git a/tests/clickhouse-reference/03205_column_type_check.sql.expected.formatted.sql b/tests/clickhouse-reference/03205_column_type_check.sql.expected.formatted.sql index 1b356ef95..08d118f7f 100644 --- a/tests/clickhouse-reference/03205_column_type_check.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03205_column_type_check.sql.expected.formatted.sql @@ -3,7 +3,7 @@ FROM ( SELECT toUInt256(1) ) AS t -CROSS JOIN ( +, ( SELECT greatCircleAngle(toLowCardinality(toNullable(toUInt256(1048575))), 257, -9223372036854775808, 1048576), 1048575, @@ -37,7 +37,7 @@ FROM GROUP BY greatCircleAngle(toNullable(1048575), 257, toInt128(-9223372036854775808), materialize(1048576)) WITH TOTALS ) AS t -CROSS JOIN ( +, ( SELECT greatCircleAngle(toUInt256(1048575), 257, toNullable(-9223372036854775808), 1048576), 1048575, diff --git a/tests/clickhouse-reference/03208_buffer_over_distributed_type_mismatch.sql.expected.ast.json b/tests/clickhouse-reference/03208_buffer_over_distributed_type_mismatch.sql.expected.ast.json index 16926f1b2..717989ca6 100644 --- a/tests/clickhouse-reference/03208_buffer_over_distributed_type_mismatch.sql.expected.ast.json +++ b/tests/clickhouse-reference/03208_buffer_over_distributed_type_mismatch.sql.expected.ast.json @@ -1374,7 +1374,8 @@ "ALL" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ], "format": "Null" diff --git a/tests/clickhouse-reference/03208_buffer_over_distributed_type_mismatch.sql.expected.formatted.sql b/tests/clickhouse-reference/03208_buffer_over_distributed_type_mismatch.sql.expected.formatted.sql index 43aa9ef4d..0b5e5bffb 100644 --- a/tests/clickhouse-reference/03208_buffer_over_distributed_type_mismatch.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03208_buffer_over_distributed_type_mismatch.sql.expected.formatted.sql @@ -147,5 +147,5 @@ GROUP BY materialize(toLowCardinality(-127)), intDivOrZero(0, 0) = toLowCardinality(toLowCardinality(0)) WITH TOTALS -ORDER BY `ALL` DESC +ORDER BY `ALL` DESC NULLS FIRST FORMAT Null; \ No newline at end of file diff --git a/tests/clickhouse-reference/03208_multiple_joins_with_storage_join.sql.expected.ast.json b/tests/clickhouse-reference/03208_multiple_joins_with_storage_join.sql.expected.ast.json index b34e3c6ee..2b1396284 100644 --- a/tests/clickhouse-reference/03208_multiple_joins_with_storage_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/03208_multiple_joins_with_storage_join.sql.expected.ast.json @@ -438,7 +438,8 @@ ] } } - } + }, + "strictness": "ANY" }, "kind": "joinExpr", "joinType": "LEFT", @@ -466,7 +467,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -520,7 +522,8 @@ ] } } - } + }, + "strictness": "ANY" }, "kind": "joinExpr", "joinType": "RIGHT", @@ -547,7 +550,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -905,7 +909,8 @@ ] } } - } + }, + "strictness": "ANY" }, "kind": "joinExpr", "joinType": "LEFT", @@ -934,7 +939,8 @@ ] } } - } + }, + "strictness": "ANY" }, "kind": "joinExpr", "joinType": "LEFT", @@ -963,7 +969,8 @@ ] } } - } + }, + "strictness": "ANY" }, "kind": "joinExpr", "joinType": "LEFT", @@ -992,7 +999,8 @@ ] } } - } + }, + "strictness": "ANY" }, "kind": "joinExpr", "joinType": "RIGHT", @@ -1021,7 +1029,8 @@ ] } } - } + }, + "strictness": "ANY" }, "kind": "joinExpr", "joinType": "LEFT", @@ -1050,7 +1059,8 @@ ] } } - } + }, + "strictness": "ANY" }, "kind": "joinExpr", "joinType": "LEFT", @@ -1079,7 +1089,8 @@ ] } } - } + }, + "strictness": "ANY" } } } diff --git a/tests/clickhouse-reference/03208_multiple_joins_with_storage_join.sql.expected.formatted.sql b/tests/clickhouse-reference/03208_multiple_joins_with_storage_join.sql.expected.formatted.sql index 07cf65cef..01ef1cf86 100644 --- a/tests/clickhouse-reference/03208_multiple_joins_with_storage_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03208_multiple_joins_with_storage_join.sql.expected.formatted.sql @@ -66,18 +66,18 @@ SELECT '-----'; SELECT * FROM tab -LEFT JOIN mem +ANY LEFT JOIN mem ON k1 = mem.k -LEFT JOIN mem AS t +ANY LEFT JOIN mem AS t ON k2 = t.k ORDER BY tab.v ASC; SELECT * FROM tab -LEFT JOIN mem +ANY LEFT JOIN mem ON k1 = mem.k -RIGHT JOIN mem2 +ANY RIGHT JOIN mem2 ON k2 = mem2.k ORDER BY tab.v ASC; @@ -117,19 +117,19 @@ FROM ( SELECT * FROM tab - LEFT JOIN mem AS t1 + ANY LEFT JOIN mem AS t1 ON tab.k = t1.k - LEFT JOIN mem AS t2 + ANY LEFT JOIN mem AS t2 ON tab.k = t2.k - LEFT JOIN mem AS t3 + ANY LEFT JOIN mem AS t3 ON tab.k = t3.k - LEFT JOIN mem AS t4 + ANY LEFT JOIN mem AS t4 ON tab.k = t4.k - RIGHT JOIN mem2 AS t5 + ANY RIGHT JOIN mem2 AS t5 ON tab.k = t5.k - LEFT JOIN mem AS t6 + ANY LEFT JOIN mem AS t6 ON tab.k = t6.k - LEFT JOIN mem AS t7 + ANY LEFT JOIN mem AS t7 ON tab.k = t7.k ) WHERE like(`explain`, '%FilledJoin%'); \ No newline at end of file diff --git a/tests/clickhouse-reference/03210_convert_outer_join_to_inner_join_any_join.sql.expected.ast.json b/tests/clickhouse-reference/03210_convert_outer_join_to_inner_join_any_join.sql.expected.ast.json index ec35060f4..5d9f8749b 100644 --- a/tests/clickhouse-reference/03210_convert_outer_join_to_inner_join_any_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/03210_convert_outer_join_to_inner_join_any_join.sql.expected.ast.json @@ -160,7 +160,8 @@ "columns": [ "user_id" ] - } + }, + "strictness": "ANY" }, "where": { "kind": "naryExpr", diff --git a/tests/clickhouse-reference/03210_convert_outer_join_to_inner_join_any_join.sql.expected.formatted.sql b/tests/clickhouse-reference/03210_convert_outer_join_to_inner_join_any_join.sql.expected.formatted.sql index de51c3427..c0891abe7 100644 --- a/tests/clickhouse-reference/03210_convert_outer_join_to_inner_join_any_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03210_convert_outer_join_to_inner_join_any_join.sql.expected.formatted.sql @@ -29,7 +29,7 @@ INSERT INTO user_transactions (user_id, transaction_id); SELECT * FROM user_transactions -LEFT JOIN user_country +ANY LEFT JOIN user_country USING (user_id) WHERE user_id = 1 AND country = 'US' diff --git a/tests/clickhouse-reference/03210_lag_lead_inframe_types.sql.expected.ast.json b/tests/clickhouse-reference/03210_lag_lead_inframe_types.sql.expected.ast.json index 3b7b606a5..d23942b56 100644 --- a/tests/clickhouse-reference/03210_lag_lead_inframe_types.sql.expected.ast.json +++ b/tests/clickhouse-reference/03210_lag_lead_inframe_types.sql.expected.ast.json @@ -27,7 +27,8 @@ "number" ] } - ] + ], + "windowName": "w" } ], "from": { @@ -89,7 +90,8 @@ "number" ] } - ] + ], + "windowName": "w" } ], "from": { @@ -151,7 +153,8 @@ "number" ] } - ] + ], + "windowName": "w" } ], "from": { @@ -213,7 +216,8 @@ "number" ] } - ] + ], + "windowName": "w" } ], "from": { @@ -443,7 +447,9 @@ } ] } - ] + ], + "nullsAction": "IGNORE NULLS", + "windowName": "w" }, { "kind": "literal", @@ -544,7 +550,8 @@ ] } } - ] + ], + "windowName": "w" }, "alias": "lag2" }, @@ -591,7 +598,8 @@ "value": "11" } } - ] + ], + "windowName": "w" }, "alias": "lag" }, @@ -638,7 +646,8 @@ "value": "11" } } - ] + ], + "windowName": "w" }, "alias": "lead" } @@ -728,7 +737,8 @@ "number" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ], "windows": [ @@ -752,7 +762,8 @@ "number" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ], "frame": { diff --git a/tests/clickhouse-reference/03210_lag_lead_inframe_types.sql.expected.formatted.sql b/tests/clickhouse-reference/03210_lag_lead_inframe_types.sql.expected.formatted.sql index c8adf3d8c..5b3e803cb 100644 --- a/tests/clickhouse-reference/03210_lag_lead_inframe_types.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03210_lag_lead_inframe_types.sql.expected.formatted.sql @@ -1,27 +1,27 @@ -SELECT lagInFrame(2::UInt128, 2, number) +SELECT lagInFrame(2::UInt128, 2, number) OVER w FROM numbers(10) WINDOW w AS (ORDER BY number ASC); -SELECT leadInFrame(2::UInt128, 2, number) +SELECT leadInFrame(2::UInt128, 2, number) OVER w FROM numbers(10) WINDOW w AS (ORDER BY number ASC); -SELECT lagInFrame(2::UInt64, 2, number) +SELECT lagInFrame(2::UInt64, 2, number) OVER w FROM numbers(10) WINDOW w AS (ORDER BY number ASC); -SELECT leadInFrame(2::UInt64, 2, number) +SELECT leadInFrame(2::UInt64, 2, number) OVER w FROM numbers(10) WINDOW w AS (ORDER BY number ASC); SELECT number, - YYYYMMDDToDate(1, toLowCardinality(11), max(YYYYMMDDToDate(YYYYMMDDToDate(toLowCardinality(1), 11, materialize(NULL), 19700101.1, 1, 27, 7, materialize(toUInt256(37)), 9, 19, 9), 1, toUInt128(11), NULL, 19700101.1, 1, 27, 7, 37, 9, 19, 9), toUInt256(30)), NULL, 19700101.1, toNullable(1), 27, materialize(7), 37, 9, 19, 9), + YYYYMMDDToDate(1, toLowCardinality(11), max(YYYYMMDDToDate(YYYYMMDDToDate(toLowCardinality(1), 11, materialize(NULL), 19700101.1, 1, 27, 7, materialize(toUInt256(37)), 9, 19, 9), 1, toUInt128(11), NULL, 19700101.1, 1, 27, 7, 37, 9, 19, 9), toUInt256(30)) IGNORE NULLS OVER w, NULL, 19700101.1, toNullable(1), 27, materialize(7), 37, 9, 19, 9), p, pp, - lagInFrame(number, number - pp) AS lag2, - lagInFrame(number, number - pp, number * 11) AS lag, - leadInFrame(number, number - pp, number * 11) AS lead + lagInFrame(number, number - pp) OVER w AS lag2, + lagInFrame(number, number - pp, number * 11) OVER w AS lag, + leadInFrame(number, number - pp, number * 11) OVER w AS lead FROM ( SELECT number, @@ -30,5 +30,5 @@ FROM ( FROM numbers(16) ) WHERE toLowCardinality(1) -ORDER BY number DESC -WINDOW w AS (PARTITION BY p ORDER BY number ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED PRECEDING); \ No newline at end of file +ORDER BY number DESC NULLS LAST +WINDOW w AS (PARTITION BY p ORDER BY number ASC NULLS FIRST ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED PRECEDING); \ No newline at end of file diff --git a/tests/clickhouse-reference/03211_convert_outer_join_to_inner_join_anti_join.sql.expected.ast.json b/tests/clickhouse-reference/03211_convert_outer_join_to_inner_join_anti_join.sql.expected.ast.json index e05a047a3..1a73b811f 100644 --- a/tests/clickhouse-reference/03211_convert_outer_join_to_inner_join_anti_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/03211_convert_outer_join_to_inner_join_anti_join.sql.expected.ast.json @@ -132,7 +132,8 @@ }, "parenthesized": true } - } + }, + "strictness": "ANTI" }, "where": { "kind": "functionCall", @@ -262,7 +263,8 @@ }, "parenthesized": true } - } + }, + "strictness": "ANTI" } } } @@ -339,7 +341,8 @@ }, "parenthesized": true } - } + }, + "strictness": "ANTI" } }, { @@ -414,7 +417,8 @@ }, "parenthesized": true } - } + }, + "strictness": "ANTI" }, "where": { "kind": "binaryExpr", diff --git a/tests/clickhouse-reference/03211_convert_outer_join_to_inner_join_anti_join.sql.expected.formatted.sql b/tests/clickhouse-reference/03211_convert_outer_join_to_inner_join_anti_join.sql.expected.formatted.sql index adfbe3801..af6f6a78c 100644 --- a/tests/clickhouse-reference/03211_convert_outer_join_to_inner_join_anti_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03211_convert_outer_join_to_inner_join_anti_join.sql.expected.formatted.sql @@ -17,7 +17,7 @@ FORMAT PrettyMonoBlock; SELECT `left`.c2 FROM t0 AS `left` -LEFT JOIN t0 AS right_0 +ANTI LEFT JOIN t0 AS right_0 ON ((`left`.c0) = (right_0.c1)) WHERE (abs((negate((sign(right_0.c1)))))); @@ -26,20 +26,20 @@ FROM ( SELECT (abs((negate((sign(right_0.c1)))))) AS check FROM t0 AS `left` - LEFT JOIN t0 AS right_0 + ANTI LEFT JOIN t0 AS right_0 ON ((`left`.c0) = (right_0.c1)) ); SELECT (abs((negate((sign(right_0.c1)))))) AS check FROM t0 AS `left` -LEFT JOIN t0 AS right_0 +ANTI LEFT JOIN t0 AS right_0 ON ((`left`.c0) = (right_0.c1)); SELECT (abs((negate((sign(right_0.c1)))))) AS check FROM t0 AS `left` -LEFT JOIN t0 AS right_0 +ANTI LEFT JOIN t0 AS right_0 ON ((`left`.c0) = (right_0.c1)) WHERE check <> 0; diff --git a/tests/clickhouse-reference/03213_denseRank_percentRank_alias.sql.expected.ast.json b/tests/clickhouse-reference/03213_denseRank_percentRank_alias.sql.expected.ast.json index eeacfdc95..14eb370e4 100644 --- a/tests/clickhouse-reference/03213_denseRank_percentRank_alias.sql.expected.ast.json +++ b/tests/clickhouse-reference/03213_denseRank_percentRank_alias.sql.expected.ast.json @@ -42,22 +42,26 @@ { "kind": "asterisk" } - ] + ], + "windowName": "w" }, { "kind": "functionCall", "name": "rank", - "args": [] + "args": [], + "windowName": "w" }, { "kind": "functionCall", "name": "denseRank", - "args": [] + "args": [], + "windowName": "w" }, { "kind": "functionCall", "name": "row_number", - "args": [] + "args": [], + "windowName": "w" } ], "from": { diff --git a/tests/clickhouse-reference/03213_denseRank_percentRank_alias.sql.expected.formatted.sql b/tests/clickhouse-reference/03213_denseRank_percentRank_alias.sql.expected.formatted.sql index 12ed3a6b7..2f45e9a4d 100644 --- a/tests/clickhouse-reference/03213_denseRank_percentRank_alias.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03213_denseRank_percentRank_alias.sql.expected.formatted.sql @@ -7,10 +7,10 @@ SELECT number, p, o, - count(*), - rank(), - denseRank(), - row_number() + count(*) OVER w, + rank() OVER w, + denseRank() OVER w, + row_number() OVER w FROM ( SELECT number, diff --git a/tests/clickhouse-reference/03214_join_on_tuple_comparison_elimination_bug.sql.expected.ast.json b/tests/clickhouse-reference/03214_join_on_tuple_comparison_elimination_bug.sql.expected.ast.json index 22b91c758..2e88ae061 100644 --- a/tests/clickhouse-reference/03214_join_on_tuple_comparison_elimination_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/03214_join_on_tuple_comparison_elimination_bug.sql.expected.ast.json @@ -163,7 +163,8 @@ ] } } - } + }, + "strictness": "SEMI" }, "orderBy": [ { @@ -221,7 +222,8 @@ ] } } - } + }, + "strictness": "SEMI" }, "orderBy": [ { @@ -291,7 +293,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/03214_join_on_tuple_comparison_elimination_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/03214_join_on_tuple_comparison_elimination_bug.sql.expected.formatted.sql index fc1df12fe..003f34dba 100644 --- a/tests/clickhouse-reference/03214_join_on_tuple_comparison_elimination_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03214_join_on_tuple_comparison_elimination_bug.sql.expected.formatted.sql @@ -23,20 +23,20 @@ INSERT INTO b; SELECT a.key FROM a -LEFT JOIN b +SEMI LEFT JOIN b ON tuple(a.key) = tuple(b.key) ORDER BY a.key ASC; SELECT a.key FROM a -LEFT JOIN b +SEMI LEFT JOIN b ON a.key <=> b.key ORDER BY a.key ASC; SELECT a.key FROM a -LEFT JOIN b +ANY LEFT JOIN b ON tuple(a.key) = tuple(b.key) ORDER BY a.key ASC; \ No newline at end of file diff --git a/tests/clickhouse-reference/03215_view_with_recursive.sql.expected.ast.json b/tests/clickhouse-reference/03215_view_with_recursive.sql.expected.ast.json index 4184fe554..f771fd115 100644 --- a/tests/clickhouse-reference/03215_view_with_recursive.sql.expected.ast.json +++ b/tests/clickhouse-reference/03215_view_with_recursive.sql.expected.ast.json @@ -245,6 +245,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "rtq", diff --git a/tests/clickhouse-reference/03215_view_with_recursive.sql.expected.formatted.sql b/tests/clickhouse-reference/03215_view_with_recursive.sql.expected.formatted.sql index bbdf8c2d9..46ea4e346 100644 --- a/tests/clickhouse-reference/03215_view_with_recursive.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03215_view_with_recursive.sql.expected.formatted.sql @@ -37,7 +37,7 @@ rtq AS ( t.parent_id FROM task AS t - CROSS JOIN rtq AS r + , rtq AS r WHERE t.parent_id = r.task_id ) diff --git a/tests/clickhouse-reference/03222_ignore_nulls_query_tree_elimination.sql.expected.ast.json b/tests/clickhouse-reference/03222_ignore_nulls_query_tree_elimination.sql.expected.ast.json index 8d470c005..85121220d 100644 --- a/tests/clickhouse-reference/03222_ignore_nulls_query_tree_elimination.sql.expected.ast.json +++ b/tests/clickhouse-reference/03222_ignore_nulls_query_tree_elimination.sql.expected.ast.json @@ -90,7 +90,8 @@ "expr": { "kind": "functionCall", "name": "count", - "args": [] + "args": [], + "nullsAction": "IGNORE NULLS" }, "direction": "ASC" }, @@ -109,6 +110,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toIntervalDay", @@ -149,7 +151,8 @@ "d32" ] } - ] + ], + "nullsAction": "RESPECT NULLS" }, "direction": "ASC" }, @@ -184,6 +187,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toIntervalDay", @@ -240,7 +244,8 @@ "d32" ] } - ] + ], + "nullsAction": "IGNORE NULLS" }, "direction": "ASC" }, @@ -256,7 +261,8 @@ "d32" ] } - ] + ], + "nullsAction": "RESPECT NULLS" }, "direction": "ASC" }, @@ -272,7 +278,8 @@ "d32" ] } - ] + ], + "nullsAction": "IGNORE NULLS" }, "direction": "ASC" }, @@ -320,7 +327,8 @@ "d33" ] } - ] + ], + "nullsAction": "IGNORE NULLS" }, "direction": "ASC" }, @@ -339,6 +347,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "functionCall", "name": "toIntervalDay", diff --git a/tests/clickhouse-reference/03222_ignore_nulls_query_tree_elimination.sql.expected.formatted.sql b/tests/clickhouse-reference/03222_ignore_nulls_query_tree_elimination.sql.expected.formatted.sql index b91492752..08d25f82f 100644 --- a/tests/clickhouse-reference/03222_ignore_nulls_query_tree_elimination.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03222_ignore_nulls_query_tree_elimination.sql.expected.formatted.sql @@ -15,13 +15,13 @@ SELECT count() FROM with_fill_date__fuzz_0 ORDER BY count() ASC, - count() ASC, + count() IGNORE NULLS ASC, max(d) ASC WITH FILL STEP toIntervalDay(10); SELECT count() FROM with_fill_date__fuzz_0 ORDER BY - any(d32) ASC, + any(d32) RESPECT NULLS ASC, any_respect_nulls(d32) ASC, max(d) ASC WITH FILL STEP toIntervalDay(10); @@ -29,10 +29,10 @@ SELECT count() FROM with_fill_date__fuzz_0 ORDER BY any(d32) ASC, - any(d32) ASC, - any(d32) ASC, - any_respect_nulls(d32) ASC, + any(d32) IGNORE NULLS ASC, + any(d32) RESPECT NULLS ASC, + any_respect_nulls(d32) IGNORE NULLS ASC, any_respect_nulls(d32) ASC, sum(d33) ASC, - sum(d33) ASC, + sum(d33) IGNORE NULLS ASC, max(d) ASC WITH FILL STEP toIntervalDay(10); \ No newline at end of file diff --git a/tests/clickhouse-reference/03222_pr_asan_index_granularity.sql.expected.ast.json b/tests/clickhouse-reference/03222_pr_asan_index_granularity.sql.expected.ast.json index eec60cc09..ace3cd3fc 100644 --- a/tests/clickhouse-reference/03222_pr_asan_index_granularity.sql.expected.ast.json +++ b/tests/clickhouse-reference/03222_pr_asan_index_granularity.sql.expected.ast.json @@ -203,7 +203,8 @@ "k" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ], "offset": { diff --git a/tests/clickhouse-reference/03222_pr_asan_index_granularity.sql.expected.formatted.sql b/tests/clickhouse-reference/03222_pr_asan_index_granularity.sql.expected.formatted.sql index e4a0ce457..5df34c136 100644 --- a/tests/clickhouse-reference/03222_pr_asan_index_granularity.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03222_pr_asan_index_granularity.sql.expected.formatted.sql @@ -23,7 +23,7 @@ SELECT FROM test PREWHERE toNullable(toNullable(11)) WHERE toNullable(11) -ORDER BY k DESC +ORDER BY k DESC NULLS LAST LIMIT 100, 100 SETTINGS optimize_read_in_order = 1, diff --git a/tests/clickhouse-reference/03228_variant_permutation_issue.sql.expected.ast.json b/tests/clickhouse-reference/03228_variant_permutation_issue.sql.expected.ast.json index edc1d45c1..9e4e2ad4e 100644 --- a/tests/clickhouse-reference/03228_variant_permutation_issue.sql.expected.ast.json +++ b/tests/clickhouse-reference/03228_variant_permutation_issue.sql.expected.ast.json @@ -313,7 +313,8 @@ "id" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] } diff --git a/tests/clickhouse-reference/03228_variant_permutation_issue.sql.expected.formatted.sql b/tests/clickhouse-reference/03228_variant_permutation_issue.sql.expected.formatted.sql index c639fb78f..1c31fabdb 100644 --- a/tests/clickhouse-reference/03228_variant_permutation_issue.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03228_variant_permutation_issue.sql.expected.formatted.sql @@ -41,4 +41,4 @@ SELECT * FROM test_new_json_type FINAL PREWHERE isNotNull(data.foo2) WHERE isNotNull(data.foo2) -ORDER BY id ASC; \ No newline at end of file +ORDER BY id ASC NULLS FIRST; \ No newline at end of file diff --git a/tests/clickhouse-reference/03234_evaluate_constant_analyzer.sql.expected.ast.json b/tests/clickhouse-reference/03234_evaluate_constant_analyzer.sql.expected.ast.json index cc8b01d41..57902db75 100644 --- a/tests/clickhouse-reference/03234_evaluate_constant_analyzer.sql.expected.ast.json +++ b/tests/clickhouse-reference/03234_evaluate_constant_analyzer.sql.expected.ast.json @@ -111,6 +111,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -126,6 +127,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", diff --git a/tests/clickhouse-reference/03234_evaluate_constant_analyzer.sql.expected.formatted.sql b/tests/clickhouse-reference/03234_evaluate_constant_analyzer.sql.expected.formatted.sql index 7269fef02..09079d5fe 100644 --- a/tests/clickhouse-reference/03234_evaluate_constant_analyzer.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03234_evaluate_constant_analyzer.sql.expected.formatted.sql @@ -1,8 +1,8 @@ SELECT count() FROM numbers(cityHash64(materialize(toLowCardinality(toNullable(0))) GLOBAL IN (NULL, -2147483648, -9223372036854775808), nan, 1024, NULL, materialize(1.000100016593933), 0, NULL), 4) AS n1 -CROSS JOIN numbers(3) AS n2 -CROSS JOIN numbers(6) AS n3 +, numbers(3) AS n2 +, numbers(6) AS n3 GROUP BY (NULL, cityHash64(inf, -2147483648, toLowCardinality(16), NULL, 10.000100135803223), cityHash64(1.1754943508222875e-38, NULL, NULL, NULL), 2147483647), cityHash64(0., 3, NULL, NULL, 10000000000., NULL, NULL) diff --git a/tests/clickhouse-reference/03239_nan_with_fill.sql.expected.ast.json b/tests/clickhouse-reference/03239_nan_with_fill.sql.expected.ast.json index 23f9d8f28..c1c893d2c 100644 --- a/tests/clickhouse-reference/03239_nan_with_fill.sql.expected.ast.json +++ b/tests/clickhouse-reference/03239_nan_with_fill.sql.expected.ast.json @@ -16,7 +16,8 @@ "type": "UInt64", "value": "1" }, - "direction": "ASC" + "direction": "ASC", + "withFill": true } ] }, @@ -37,7 +38,8 @@ "type": "UInt64", "value": "1" }, - "direction": "ASC" + "direction": "ASC", + "withFill": true } ] }, @@ -67,7 +69,8 @@ "type": "UInt64", "value": "1" }, - "direction": "ASC" + "direction": "ASC", + "withFill": true } ] }, @@ -89,6 +92,7 @@ "value": "nan" }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -158,7 +162,8 @@ "c0" ] }, - "direction": "ASC" + "direction": "ASC", + "withFill": true } ] } diff --git a/tests/clickhouse-reference/03239_nan_with_fill.sql.expected.formatted.sql b/tests/clickhouse-reference/03239_nan_with_fill.sql.expected.formatted.sql index f19de6ef1..f5489a370 100644 --- a/tests/clickhouse-reference/03239_nan_with_fill.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03239_nan_with_fill.sql.expected.formatted.sql @@ -1,11 +1,11 @@ SELECT nan -ORDER BY 1 ASC; +ORDER BY 1 ASC WITH FILL; SELECT -nan -ORDER BY 1 ASC; +ORDER BY 1 ASC WITH FILL; SELECT 0. / 0. -ORDER BY 1 ASC; +ORDER BY 1 ASC WITH FILL; SELECT 1 ORDER BY nan ASC WITH FILL FROM 1; @@ -20,4 +20,4 @@ INSERT INTO t0 (c0); SELECT 1 FROM t0 -ORDER BY t0.c0 ASC; \ No newline at end of file +ORDER BY t0.c0 ASC WITH FILL; \ No newline at end of file diff --git a/tests/clickhouse-reference/03248_with_fill_string_crash.sql.expected.ast.json b/tests/clickhouse-reference/03248_with_fill_string_crash.sql.expected.ast.json index 92dbd7a8b..6ec4f63e8 100644 --- a/tests/clickhouse-reference/03248_with_fill_string_crash.sql.expected.ast.json +++ b/tests/clickhouse-reference/03248_with_fill_string_crash.sql.expected.ast.json @@ -74,6 +74,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillTo": { "kind": "literal", "type": "String", diff --git a/tests/clickhouse-reference/03257_reverse_sorting_key.sql.expected.ast.json b/tests/clickhouse-reference/03257_reverse_sorting_key.sql.expected.ast.json index fbcff5456..97821e946 100644 --- a/tests/clickhouse-reference/03257_reverse_sorting_key.sql.expected.ast.json +++ b/tests/clickhouse-reference/03257_reverse_sorting_key.sql.expected.ast.json @@ -279,7 +279,8 @@ "i" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ], "limit": { @@ -351,7 +352,8 @@ "i" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ], "limit": { @@ -918,7 +920,8 @@ "j" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ], "limit": { @@ -1000,7 +1003,8 @@ "j" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ], "limit": { diff --git a/tests/clickhouse-reference/03257_reverse_sorting_key.sql.expected.formatted.sql b/tests/clickhouse-reference/03257_reverse_sorting_key.sql.expected.formatted.sql index be0c7f1aa..26e680ce5 100644 --- a/tests/clickhouse-reference/03257_reverse_sorting_key.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03257_reverse_sorting_key.sql.expected.formatted.sql @@ -33,7 +33,7 @@ FROM ( EXPLAIN actions = 1 SELECT * FROM x1 - ORDER BY i DESC + ORDER BY i DESC NULLS FIRST LIMIT 5 ) WHERE ilike(`explain`, '%sort%') @@ -44,7 +44,7 @@ SETTINGS EXPLAIN PIPELINE SELECT * FROM x1 -ORDER BY i DESC +ORDER BY i DESC NULLS FIRST LIMIT 5 SETTINGS max_threads = 1; @@ -110,7 +110,7 @@ FROM ( FROM x2 ORDER BY i ASC, - j DESC + j DESC NULLS FIRST LIMIT 5 ) WHERE ilike(`explain`, '%sort%') @@ -123,7 +123,7 @@ SELECT * FROM x2 ORDER BY i ASC, - j DESC + j DESC NULLS FIRST LIMIT 5 SETTINGS max_threads = 1; diff --git a/tests/clickhouse-reference/03257_scalar_in_format_table_expression.sql.expected.ast.json b/tests/clickhouse-reference/03257_scalar_in_format_table_expression.sql.expected.ast.json index 32d10525a..5b5773be5 100644 --- a/tests/clickhouse-reference/03257_scalar_in_format_table_expression.sql.expected.ast.json +++ b/tests/clickhouse-reference/03257_scalar_in_format_table_expression.sql.expected.ast.json @@ -577,7 +577,8 @@ } ] } - ] + ], + "nullsAction": "RESPECT NULLS" }, { "kind": "literal", diff --git a/tests/clickhouse-reference/03257_scalar_in_format_table_expression.sql.expected.formatted.sql b/tests/clickhouse-reference/03257_scalar_in_format_table_expression.sql.expected.formatted.sql index 3681324b9..285b1865e 100644 --- a/tests/clickhouse-reference/03257_scalar_in_format_table_expression.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03257_scalar_in_format_table_expression.sql.expected.formatted.sql @@ -74,7 +74,7 @@ FROM format(TSVRaw, ( WITH CUBE ), groupArray('some long string')), 'LowCardinality(String)') FROM numbers(10000) - )), toLowCardinality('some long string')), '\n'), 'LowCardinality(String)') + )), toLowCardinality('some long string')) RESPECT NULLS, '\n'), 'LowCardinality(String)') FROM numbers(10000) )) FORMAT TSVRaw; -- { serverError UNKNOWN_IDENTIFIER, ILLEGAL_TYPE_OF_ARGUMENT } diff --git a/tests/clickhouse-reference/03261_pr_semi_anti_join.sql.expected.ast.json b/tests/clickhouse-reference/03261_pr_semi_anti_join.sql.expected.ast.json index 8c3679f9c..38053ac88 100644 --- a/tests/clickhouse-reference/03261_pr_semi_anti_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/03261_pr_semi_anti_join.sql.expected.ast.json @@ -241,7 +241,8 @@ "columns": [ "x" ] - } + }, + "strictness": "SEMI" }, "orderBy": [ { @@ -322,7 +323,8 @@ "columns": [ "x" ] - } + }, + "strictness": "SEMI" }, "orderBy": [ { @@ -403,7 +405,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANTI" }, "orderBy": [ { @@ -484,7 +487,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANTI" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/03261_pr_semi_anti_join.sql.expected.formatted.sql b/tests/clickhouse-reference/03261_pr_semi_anti_join.sql.expected.formatted.sql index f45285ba0..6f858c486 100644 --- a/tests/clickhouse-reference/03261_pr_semi_anti_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03261_pr_semi_anti_join.sql.expected.formatted.sql @@ -31,7 +31,7 @@ SELECT t2.* FROM t1 -LEFT JOIN t2 +SEMI LEFT JOIN t2 USING (x) ORDER BY t1.x ASC, @@ -44,7 +44,7 @@ SELECT t2.* FROM t1 -RIGHT JOIN t2 +SEMI RIGHT JOIN t2 USING (x) ORDER BY t1.x ASC, @@ -57,7 +57,7 @@ SELECT t2.* FROM t1 -LEFT JOIN t2 +ANTI LEFT JOIN t2 USING (x) ORDER BY t1.x ASC, @@ -70,7 +70,7 @@ SELECT t2.* FROM t1 -RIGHT JOIN t2 +ANTI RIGHT JOIN t2 USING (x) ORDER BY t1.x ASC, diff --git a/tests/clickhouse-reference/03266_with_fill_staleness.sql.expected.ast.json b/tests/clickhouse-reference/03266_with_fill_staleness.sql.expected.ast.json index 34f3b98b6..8f373cb1f 100644 --- a/tests/clickhouse-reference/03266_with_fill_staleness.sql.expected.ast.json +++ b/tests/clickhouse-reference/03266_with_fill_staleness.sql.expected.ast.json @@ -199,6 +199,7 @@ ] }, "direction": "ASC", + "withFill": true, "interpolate": [ { "col": "c" @@ -246,6 +247,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStaleness": { "kind": "functionCall", "name": "toIntervalSecond", @@ -304,6 +306,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStaleness": { "kind": "functionCall", "name": "toIntervalSecond", @@ -362,6 +365,7 @@ ] }, "direction": "DESC", + "withFill": true, "fillStaleness": { "kind": "functionCall", "name": "toIntervalSecond", @@ -420,6 +424,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillTo": { "kind": "functionCall", "name": "toDateTime", @@ -500,6 +505,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStaleness": { "kind": "functionCall", "name": "toIntervalSecond", @@ -521,6 +527,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -584,6 +591,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStaleness": { "kind": "functionCall", "name": "toIntervalSecond", @@ -605,6 +613,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillTo": { "kind": "functionCall", "name": "toDateTime", diff --git a/tests/clickhouse-reference/03266_with_fill_staleness_cases.sql.expected.ast.json b/tests/clickhouse-reference/03266_with_fill_staleness_cases.sql.expected.ast.json index a0dc35d0f..af0bea063 100644 --- a/tests/clickhouse-reference/03266_with_fill_staleness_cases.sql.expected.ast.json +++ b/tests/clickhouse-reference/03266_with_fill_staleness_cases.sql.expected.ast.json @@ -121,6 +121,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillTo": { "kind": "literal", "type": "UInt64", @@ -146,6 +147,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillTo": { "kind": "literal", "type": "UInt64", @@ -267,7 +269,8 @@ "b" ] }, - "direction": "ASC" + "direction": "ASC", + "withFill": true } ] }, @@ -301,6 +304,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillTo": { "kind": "literal", "type": "UInt64", @@ -321,6 +325,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillTo": { "kind": "literal", "type": "UInt64", @@ -433,6 +438,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillTo": { "kind": "literal", "type": "UInt64", @@ -453,6 +459,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "Int64", diff --git a/tests/clickhouse-reference/03266_with_fill_staleness_cases.sql.expected.formatted.sql b/tests/clickhouse-reference/03266_with_fill_staleness_cases.sql.expected.formatted.sql index 6545838d6..943abcfc4 100644 --- a/tests/clickhouse-reference/03266_with_fill_staleness_cases.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03266_with_fill_staleness_cases.sql.expected.formatted.sql @@ -38,7 +38,7 @@ SELECT FROM test2 ORDER BY a ASC, - b ASC; + b ASC WITH FILL; SELECT *, diff --git a/tests/clickhouse-reference/03266_with_fill_staleness_errors.sql.expected.ast.json b/tests/clickhouse-reference/03266_with_fill_staleness_errors.sql.expected.ast.json index 1a777afdf..f1f044dda 100644 --- a/tests/clickhouse-reference/03266_with_fill_staleness_errors.sql.expected.ast.json +++ b/tests/clickhouse-reference/03266_with_fill_staleness_errors.sql.expected.ast.json @@ -41,6 +41,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "literal", "type": "UInt64", @@ -104,6 +105,7 @@ ] }, "direction": "DESC", + "withFill": true, "fillTo": { "kind": "literal", "type": "UInt64", @@ -162,6 +164,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillTo": { "kind": "literal", "type": "UInt64", diff --git a/tests/clickhouse-reference/03274_philipzucker.sql.expected.ast.json b/tests/clickhouse-reference/03274_philipzucker.sql.expected.ast.json index 49372796d..4f27ea922 100644 --- a/tests/clickhouse-reference/03274_philipzucker.sql.expected.ast.json +++ b/tests/clickhouse-reference/03274_philipzucker.sql.expected.ast.json @@ -186,6 +186,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "digits", @@ -194,6 +195,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "digits", @@ -202,6 +204,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "digits", @@ -210,6 +213,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "digits", @@ -218,6 +222,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "digits", @@ -226,6 +231,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "digits", @@ -234,6 +240,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "digits", diff --git a/tests/clickhouse-reference/03274_philipzucker.sql.expected.formatted.sql b/tests/clickhouse-reference/03274_philipzucker.sql.expected.formatted.sql index 28eb7db0e..a3e83e7c9 100644 --- a/tests/clickhouse-reference/03274_philipzucker.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03274_philipzucker.sql.expected.formatted.sql @@ -20,13 +20,13 @@ SELECT y.digit AS Y FROM digits AS s -CROSS JOIN digits AS e -CROSS JOIN digits AS n -CROSS JOIN digits AS d -CROSS JOIN digits AS m -CROSS JOIN digits AS o -CROSS JOIN digits AS r -CROSS JOIN digits AS y +, digits AS e +, digits AS n +, digits AS d +, digits AS m +, digits AS o +, digits AS r +, digits AS y WHERE s.digit <> e.digit AND s.digit <> n.digit AND s.digit <> d.digit diff --git a/tests/clickhouse-reference/03274_with_fill_dup_sort_bug.sql.expected.ast.json b/tests/clickhouse-reference/03274_with_fill_dup_sort_bug.sql.expected.ast.json index fbd27bc10..b20d7bc1f 100644 --- a/tests/clickhouse-reference/03274_with_fill_dup_sort_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/03274_with_fill_dup_sort_bug.sql.expected.ast.json @@ -50,6 +50,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillTo": { "kind": "literal", "type": "UInt64", diff --git a/tests/clickhouse-reference/03275_pr_any_join.sql.expected.ast.json b/tests/clickhouse-reference/03275_pr_any_join.sql.expected.ast.json index fa0d0083e..73fa87646 100644 --- a/tests/clickhouse-reference/03275_pr_any_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/03275_pr_any_join.sql.expected.ast.json @@ -228,7 +228,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -287,7 +288,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -346,7 +348,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -405,7 +408,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -464,7 +468,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -523,7 +528,8 @@ "columns": [ "x" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/03275_pr_any_join.sql.expected.formatted.sql b/tests/clickhouse-reference/03275_pr_any_join.sql.expected.formatted.sql index 568ab2deb..958d7bd91 100644 --- a/tests/clickhouse-reference/03275_pr_any_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03275_pr_any_join.sql.expected.formatted.sql @@ -29,7 +29,7 @@ SELECT t2.* FROM t1 -LEFT JOIN t2 +ANY LEFT JOIN t2 USING (x) ORDER BY t1.x ASC, @@ -40,7 +40,7 @@ SELECT t2.* FROM t2 -LEFT JOIN t1 +ANY LEFT JOIN t1 USING (x) ORDER BY t1.x ASC, @@ -51,7 +51,7 @@ SELECT t2.* FROM t1 -INNER JOIN t2 +ANY INNER JOIN t2 USING (x) ORDER BY t1.x ASC, @@ -62,7 +62,7 @@ SELECT t2.* FROM t2 -INNER JOIN t1 +ANY INNER JOIN t1 USING (x) ORDER BY t1.x ASC, @@ -73,7 +73,7 @@ SELECT t2.* FROM t1 -RIGHT JOIN t2 +ANY RIGHT JOIN t2 USING (x) ORDER BY t1.x ASC, @@ -84,7 +84,7 @@ SELECT t2.* FROM t2 -RIGHT JOIN t1 +ANY RIGHT JOIN t1 USING (x) ORDER BY t1.x ASC, diff --git a/tests/clickhouse-reference/03279_join_choose_build_table.sql.expected.ast.json b/tests/clickhouse-reference/03279_join_choose_build_table.sql.expected.ast.json index 51379be8d..80607aa4a 100644 --- a/tests/clickhouse-reference/03279_join_choose_build_table.sql.expected.ast.json +++ b/tests/clickhouse-reference/03279_join_choose_build_table.sql.expected.ast.json @@ -370,6 +370,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "sales" @@ -440,6 +441,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "products" @@ -564,6 +566,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "sales" @@ -634,6 +637,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "products" diff --git a/tests/clickhouse-reference/03279_join_choose_build_table.sql.expected.formatted.sql b/tests/clickhouse-reference/03279_join_choose_build_table.sql.expected.formatted.sql index c9b2dc56e..10f0e1ec8 100644 --- a/tests/clickhouse-reference/03279_join_choose_build_table.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03279_join_choose_build_table.sql.expected.formatted.sql @@ -46,7 +46,7 @@ SET enable_join_runtime_filters = 0; SELECT * FROM products -CROSS JOIN sales +, sales WHERE sales.product_id = products.id AND date = '2024-05-07' SETTINGS log_comment = '03279_join_choose_build_table_no_idx' @@ -55,7 +55,7 @@ FORMAT Null; SELECT * FROM sales -CROSS JOIN products +, products WHERE sales.product_id = products.id AND date = '2024-05-07' SETTINGS log_comment = '03279_join_choose_build_table_no_idx' @@ -70,7 +70,7 @@ ALTER TABLE sales MATERIALIZE INDEX date_idx; SELECT * FROM products -CROSS JOIN sales +, sales WHERE sales.product_id = products.id AND date = '2024-05-07' SETTINGS log_comment = '03279_join_choose_build_table_idx' @@ -79,7 +79,7 @@ FORMAT Null; SELECT * FROM sales -CROSS JOIN products +, products WHERE sales.product_id = products.id AND date = '2024-05-07' SETTINGS log_comment = '03279_join_choose_build_table_idx' diff --git a/tests/clickhouse-reference/03279_join_choose_build_table_auto_statistics.sql.expected.ast.json b/tests/clickhouse-reference/03279_join_choose_build_table_auto_statistics.sql.expected.ast.json index 662a1f3ba..b51928529 100644 --- a/tests/clickhouse-reference/03279_join_choose_build_table_auto_statistics.sql.expected.ast.json +++ b/tests/clickhouse-reference/03279_join_choose_build_table_auto_statistics.sql.expected.ast.json @@ -394,6 +394,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "sales" @@ -464,6 +465,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "products" diff --git a/tests/clickhouse-reference/03279_join_choose_build_table_auto_statistics.sql.expected.formatted.sql b/tests/clickhouse-reference/03279_join_choose_build_table_auto_statistics.sql.expected.formatted.sql index 59e748e97..69d2470ee 100644 --- a/tests/clickhouse-reference/03279_join_choose_build_table_auto_statistics.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03279_join_choose_build_table_auto_statistics.sql.expected.formatted.sql @@ -49,7 +49,7 @@ SET enable_join_runtime_filters = 0; SELECT * FROM products -CROSS JOIN sales +, sales WHERE sales.product_id = products.id AND date = '2024-05-07' SETTINGS log_comment = '03279_join_choose_build_table_stats' @@ -58,7 +58,7 @@ FORMAT Null; SELECT * FROM sales -CROSS JOIN products +, products WHERE sales.product_id = products.id AND date = '2024-05-07' SETTINGS log_comment = '03279_join_choose_build_table_stats' diff --git a/tests/clickhouse-reference/03279_join_choose_build_table_statistics.sql.expected.ast.json b/tests/clickhouse-reference/03279_join_choose_build_table_statistics.sql.expected.ast.json index b06f628ef..364940912 100644 --- a/tests/clickhouse-reference/03279_join_choose_build_table_statistics.sql.expected.ast.json +++ b/tests/clickhouse-reference/03279_join_choose_build_table_statistics.sql.expected.ast.json @@ -394,6 +394,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "sales" @@ -464,6 +465,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "products" @@ -584,6 +586,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "sales" @@ -654,6 +657,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "products" diff --git a/tests/clickhouse-reference/03279_join_choose_build_table_statistics.sql.expected.formatted.sql b/tests/clickhouse-reference/03279_join_choose_build_table_statistics.sql.expected.formatted.sql index 7ee4eb168..904564e4d 100644 --- a/tests/clickhouse-reference/03279_join_choose_build_table_statistics.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03279_join_choose_build_table_statistics.sql.expected.formatted.sql @@ -49,7 +49,7 @@ SET enable_join_runtime_filters = 0; SELECT * FROM products -CROSS JOIN sales +, sales WHERE sales.product_id = products.id AND date = '2024-05-07' SETTINGS log_comment = '03279_join_choose_build_table_no_stats' @@ -58,7 +58,7 @@ FORMAT Null; SELECT * FROM sales -CROSS JOIN products +, products WHERE sales.product_id = products.id AND date = '2024-05-07' SETTINGS log_comment = '03279_join_choose_build_table_no_stats' @@ -73,7 +73,7 @@ ALTER TABLE sales MATERIALIZE STATISTICS date; SELECT * FROM products -CROSS JOIN sales +, sales WHERE sales.product_id = products.id AND date = '2024-05-07' SETTINGS log_comment = '03279_join_choose_build_table_stats' @@ -82,7 +82,7 @@ FORMAT Null; SELECT * FROM sales -CROSS JOIN products +, products WHERE sales.product_id = products.id AND date = '2024-05-07' SETTINGS log_comment = '03279_join_choose_build_table_stats' diff --git a/tests/clickhouse-reference/03282_join_distributed_no_columns.sql.expected.ast.json b/tests/clickhouse-reference/03282_join_distributed_no_columns.sql.expected.ast.json index 31716915d..13264ab40 100644 --- a/tests/clickhouse-reference/03282_join_distributed_no_columns.sql.expected.ast.json +++ b/tests/clickhouse-reference/03282_join_distributed_no_columns.sql.expected.ast.json @@ -250,7 +250,8 @@ ] } } - } + }, + "global": true } }, { @@ -299,7 +300,8 @@ ] } } - } + }, + "global": true } }, { @@ -349,7 +351,8 @@ ] } } - } + }, + "global": true } }, { @@ -399,7 +402,8 @@ ] } } - } + }, + "global": true } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/03282_join_distributed_no_columns.sql.expected.formatted.sql b/tests/clickhouse-reference/03282_join_distributed_no_columns.sql.expected.formatted.sql index b299937d1..dbd13671a 100644 --- a/tests/clickhouse-reference/03282_join_distributed_no_columns.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03282_join_distributed_no_columns.sql.expected.formatted.sql @@ -37,23 +37,23 @@ ENGINE = Distributed('test_shard_localhost', currentDatabase(), source_table2); SELECT 1 FROM distributed_table1 AS t1 -INNER JOIN distributed_table2 AS t2 +GLOBAL INNER JOIN distributed_table2 AS t2 ON materialize(42) = t1.a; SELECT count() FROM distributed_table1 AS t1 -INNER JOIN distributed_table2 AS t2 +GLOBAL INNER JOIN distributed_table2 AS t2 ON materialize(42) = t1.a; SELECT t1.* FROM distributed_table1 AS t1 -INNER JOIN distributed_table2 AS t2 +GLOBAL INNER JOIN distributed_table2 AS t2 ON materialize(42) = t1.a; SELECT t2.* FROM distributed_table1 AS t1 -INNER JOIN distributed_table2 AS t2 +GLOBAL INNER JOIN distributed_table2 AS t2 ON materialize(42) = t1.a; \ No newline at end of file diff --git a/tests/clickhouse-reference/03286_parallel_replicas_cross_join_bug.sql.expected.ast.json b/tests/clickhouse-reference/03286_parallel_replicas_cross_join_bug.sql.expected.ast.json index cf36f133e..46c48b34f 100644 --- a/tests/clickhouse-reference/03286_parallel_replicas_cross_join_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/03286_parallel_replicas_cross_join_bug.sql.expected.ast.json @@ -120,6 +120,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "tab", @@ -213,6 +214,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "tab", diff --git a/tests/clickhouse-reference/03286_parallel_replicas_cross_join_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/03286_parallel_replicas_cross_join_bug.sql.expected.formatted.sql index f45ea16a5..6d5890a9d 100644 --- a/tests/clickhouse-reference/03286_parallel_replicas_cross_join_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03286_parallel_replicas_cross_join_bug.sql.expected.formatted.sql @@ -15,7 +15,7 @@ SET enable_parallel_replicas = 1, max_parallel_replicas = 3, cluster_for_paralle SELECT * FROM tab AS l -CROSS JOIN tab AS r +, tab AS r WHERE l.x < r.x AND r.x < 2; @@ -26,7 +26,7 @@ FROM ( SELECT * FROM tab AS l - CROSS JOIN tab AS r + , tab AS r WHERE r.x < 2 AND l.x < 3 ); \ No newline at end of file diff --git a/tests/clickhouse-reference/03289_explain_syntax_statistics.sql.expected.ast.json b/tests/clickhouse-reference/03289_explain_syntax_statistics.sql.expected.ast.json index 51e7af18b..bf507d4e9 100644 --- a/tests/clickhouse-reference/03289_explain_syntax_statistics.sql.expected.ast.json +++ b/tests/clickhouse-reference/03289_explain_syntax_statistics.sql.expected.ast.json @@ -122,7 +122,8 @@ { "kind": "functionCall", "name": "count", - "args": [] + "args": [], + "nullsAction": "IGNORE NULLS" } ], "from": { diff --git a/tests/clickhouse-reference/03289_explain_syntax_statistics.sql.expected.formatted.sql b/tests/clickhouse-reference/03289_explain_syntax_statistics.sql.expected.formatted.sql index 3881e3625..6316fb9c3 100644 --- a/tests/clickhouse-reference/03289_explain_syntax_statistics.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03289_explain_syntax_statistics.sql.expected.formatted.sql @@ -14,7 +14,7 @@ EXPLAIN SYNTAX SELECT 'Get hierarchy', toNullable(13), - count() + count() IGNORE NULLS FROM dist_01247 GROUP BY number WITH CUBE diff --git a/tests/clickhouse-reference/03300_msan_nullable_serialized_aggregation.sql.expected.ast.json b/tests/clickhouse-reference/03300_msan_nullable_serialized_aggregation.sql.expected.ast.json index 7bf9a5a04..5d570a7cb 100644 --- a/tests/clickhouse-reference/03300_msan_nullable_serialized_aggregation.sql.expected.ast.json +++ b/tests/clickhouse-reference/03300_msan_nullable_serialized_aggregation.sql.expected.ast.json @@ -878,7 +878,8 @@ "t" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ], "leadingComments": [ diff --git a/tests/clickhouse-reference/03300_msan_nullable_serialized_aggregation.sql.expected.formatted.sql b/tests/clickhouse-reference/03300_msan_nullable_serialized_aggregation.sql.expected.formatted.sql index 83f2458fb..29592b087 100644 --- a/tests/clickhouse-reference/03300_msan_nullable_serialized_aggregation.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03300_msan_nullable_serialized_aggregation.sql.expected.formatted.sql @@ -62,4 +62,4 @@ FROM ( FROM numbers(10) ) GROUP BY t -ORDER BY t ASC; \ No newline at end of file +ORDER BY t ASC NULLS FIRST; \ No newline at end of file diff --git a/tests/clickhouse-reference/03312_explain_syntax_analyzer.sql.expected.ast.json b/tests/clickhouse-reference/03312_explain_syntax_analyzer.sql.expected.ast.json index ee4bc34a4..8eb7ed0fd 100644 --- a/tests/clickhouse-reference/03312_explain_syntax_analyzer.sql.expected.ast.json +++ b/tests/clickhouse-reference/03312_explain_syntax_analyzer.sql.expected.ast.json @@ -32,6 +32,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "database": "system", @@ -41,6 +42,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "database": "system", @@ -166,6 +168,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "database": "system", @@ -175,6 +178,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "database": "system", @@ -300,6 +304,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "database": "system", @@ -309,6 +314,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "database": "system", @@ -434,6 +440,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "database": "system", @@ -443,6 +450,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "database": "system", @@ -576,6 +584,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "database": "system", @@ -585,6 +594,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "database": "system", @@ -718,6 +728,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "database": "system", @@ -727,6 +738,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "database": "system", @@ -860,6 +872,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "database": "system", @@ -869,6 +882,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "database": "system", diff --git a/tests/clickhouse-reference/03312_explain_syntax_analyzer.sql.expected.formatted.sql b/tests/clickhouse-reference/03312_explain_syntax_analyzer.sql.expected.formatted.sql index 919c102a7..4f9d5b462 100644 --- a/tests/clickhouse-reference/03312_explain_syntax_analyzer.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03312_explain_syntax_analyzer.sql.expected.formatted.sql @@ -4,8 +4,8 @@ EXPLAIN SYNTAX SELECT * FROM `system`.numbers AS a -CROSS JOIN `system`.numbers AS b -CROSS JOIN `system`.numbers AS c +, `system`.numbers AS b +, `system`.numbers AS c WHERE a.number == 1 OR a.number == 2 OR a.number == 3 @@ -16,8 +16,8 @@ EXPLAIN SYNTAX oneline = 1 SELECT * FROM `system`.numbers AS a -CROSS JOIN `system`.numbers AS b -CROSS JOIN `system`.numbers AS c +, `system`.numbers AS b +, `system`.numbers AS c WHERE a.number == 1 OR a.number == 2 OR a.number == 3 @@ -28,8 +28,8 @@ EXPLAIN SYNTAX run_query_tree_passes = 0 SELECT * FROM `system`.numbers AS a -CROSS JOIN `system`.numbers AS b -CROSS JOIN `system`.numbers AS c +, `system`.numbers AS b +, `system`.numbers AS c WHERE a.number == 1 OR a.number == 2 OR a.number == 3 @@ -40,8 +40,8 @@ EXPLAIN SYNTAX run_query_tree_passes = 1 SELECT * FROM `system`.numbers AS a -CROSS JOIN `system`.numbers AS b -CROSS JOIN `system`.numbers AS c +, `system`.numbers AS b +, `system`.numbers AS c WHERE a.number == 1 OR a.number == 2 OR a.number == 3 @@ -52,8 +52,8 @@ EXPLAIN SYNTAX run_query_tree_passes = 1, query_tree_passes = 1 SELECT * FROM `system`.numbers AS a -CROSS JOIN `system`.numbers AS b -CROSS JOIN `system`.numbers AS c +, `system`.numbers AS b +, `system`.numbers AS c WHERE a.number == 1 OR a.number == 2 OR a.number == 3 @@ -64,8 +64,8 @@ EXPLAIN SYNTAX run_query_tree_passes = 1, query_tree_passes = 0 SELECT * FROM `system`.numbers AS a -CROSS JOIN `system`.numbers AS b -CROSS JOIN `system`.numbers AS c +, `system`.numbers AS b +, `system`.numbers AS c WHERE a.number == 1 OR a.number == 2 OR a.number == 3 @@ -77,8 +77,8 @@ EXPLAIN SYNTAX run_query_tree_passes = 1, oneline = 1 SELECT * FROM `system`.numbers AS a -CROSS JOIN `system`.numbers AS b -CROSS JOIN `system`.numbers AS c +, `system`.numbers AS b +, `system`.numbers AS c WHERE a.number == 1 OR a.number == 2 OR a.number == 3 diff --git a/tests/clickhouse-reference/03314_analyzer_resolve_in_parent_scope.sql.expected.ast.json b/tests/clickhouse-reference/03314_analyzer_resolve_in_parent_scope.sql.expected.ast.json index 5d0c72807..ec9feed3a 100644 --- a/tests/clickhouse-reference/03314_analyzer_resolve_in_parent_scope.sql.expected.ast.json +++ b/tests/clickhouse-reference/03314_analyzer_resolve_in_parent_scope.sql.expected.ast.json @@ -46,6 +46,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { diff --git a/tests/clickhouse-reference/03314_analyzer_resolve_in_parent_scope.sql.expected.formatted.sql b/tests/clickhouse-reference/03314_analyzer_resolve_in_parent_scope.sql.expected.formatted.sql index 25e57c078..425a34007 100644 --- a/tests/clickhouse-reference/03314_analyzer_resolve_in_parent_scope.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03314_analyzer_resolve_in_parent_scope.sql.expected.formatted.sql @@ -6,7 +6,7 @@ WITH ws_wh AS ( 1 AS ws_order_number, 1 AS ws_warehouse_sk ) AS ws1 - CROSS JOIN ( + , ( SELECT 1 AS ws_order_number, 2 AS ws_warehouse_sk diff --git a/tests/clickhouse-reference/03318_ubsan_resample_arguments_count.sql.expected.ast.json b/tests/clickhouse-reference/03318_ubsan_resample_arguments_count.sql.expected.ast.json index 23de197e8..3786dc0d9 100644 --- a/tests/clickhouse-reference/03318_ubsan_resample_arguments_count.sql.expected.ast.json +++ b/tests/clickhouse-reference/03318_ubsan_resample_arguments_count.sql.expected.ast.json @@ -48,7 +48,8 @@ } ] } - ] + ], + "nullsAction": "IGNORE NULLS" } ], "from": { diff --git a/tests/clickhouse-reference/03318_ubsan_resample_arguments_count.sql.expected.formatted.sql b/tests/clickhouse-reference/03318_ubsan_resample_arguments_count.sql.expected.formatted.sql index d9385cfcf..22f5c6ac8 100644 --- a/tests/clickhouse-reference/03318_ubsan_resample_arguments_count.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03318_ubsan_resample_arguments_count.sql.expected.formatted.sql @@ -1,4 +1,4 @@ -SELECT quantileResampleMerge(0.5, 257, 65536, 1)(tuple(*).1) +SELECT quantileResampleMerge(0.5, 257, 65536, 1)(tuple(*).1) IGNORE NULLS FROM ( SELECT quantileResampleState(0.1, 1, 2, 42)(murmurHash3_128(88, NULL), number, number) FROM numbers(100) diff --git a/tests/clickhouse-reference/03322_unused_interpolate_expressions.sql.expected.ast.json b/tests/clickhouse-reference/03322_unused_interpolate_expressions.sql.expected.ast.json index eb6837d3e..e4821a82a 100644 --- a/tests/clickhouse-reference/03322_unused_interpolate_expressions.sql.expected.ast.json +++ b/tests/clickhouse-reference/03322_unused_interpolate_expressions.sql.expected.ast.json @@ -244,6 +244,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "literal", "type": "UInt64", @@ -389,6 +390,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "literal", "type": "UInt64", @@ -540,6 +542,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "literal", "type": "UInt64", diff --git a/tests/clickhouse-reference/03325_distributed_join_json_array_subcolumns.sql.expected.ast.json b/tests/clickhouse-reference/03325_distributed_join_json_array_subcolumns.sql.expected.ast.json index 47e7f5945..7213f133b 100644 --- a/tests/clickhouse-reference/03325_distributed_join_json_array_subcolumns.sql.expected.ast.json +++ b/tests/clickhouse-reference/03325_distributed_join_json_array_subcolumns.sql.expected.ast.json @@ -251,7 +251,8 @@ ] } } - } + }, + "global": true }, "where": { "kind": "naryExpr", @@ -350,7 +351,8 @@ ] } } - } + }, + "global": true }, "where": { "kind": "naryExpr", diff --git a/tests/clickhouse-reference/03325_distributed_join_json_array_subcolumns.sql.expected.formatted.sql b/tests/clickhouse-reference/03325_distributed_join_json_array_subcolumns.sql.expected.formatted.sql index 7e5a5bb67..af1038094 100644 --- a/tests/clickhouse-reference/03325_distributed_join_json_array_subcolumns.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03325_distributed_join_json_array_subcolumns.sql.expected.formatted.sql @@ -26,7 +26,7 @@ INSERT INTO test; SELECT count() FROM test_distr AS `left` -INNER JOIN test_distr AS `right` +GLOBAL INNER JOIN test_distr AS `right` ON `left`.id = `right`.id WHERE has(`right`.data.arr1, 's3') AND has(`right`.data.arr2, 42) @@ -35,7 +35,7 @@ SETTINGS serialize_query_plan = 0; SELECT count() FROM test_distr AS `left` -INNER JOIN test_distr AS `right` +GLOBAL INNER JOIN test_distr AS `right` ON `left`.id = `right`.id WHERE has(`right`.data.arr1, 's3') AND has(`right`.data.arr2, 42) diff --git a/tests/clickhouse-reference/03326_parallel_replicas_out_of_range.sql.expected.ast.json b/tests/clickhouse-reference/03326_parallel_replicas_out_of_range.sql.expected.ast.json index 683c91a8d..0af9ad6e5 100644 --- a/tests/clickhouse-reference/03326_parallel_replicas_out_of_range.sql.expected.ast.json +++ b/tests/clickhouse-reference/03326_parallel_replicas_out_of_range.sql.expected.ast.json @@ -46,7 +46,8 @@ } ] } - ] + ], + "nullsAction": "IGNORE NULLS" }, "alias": "num" }, diff --git a/tests/clickhouse-reference/03326_parallel_replicas_out_of_range.sql.expected.formatted.sql b/tests/clickhouse-reference/03326_parallel_replicas_out_of_range.sql.expected.formatted.sql index b80866b14..b13af7e19 100644 --- a/tests/clickhouse-reference/03326_parallel_replicas_out_of_range.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03326_parallel_replicas_out_of_range.sql.expected.formatted.sql @@ -5,7 +5,7 @@ SET enable_analyzer = 1; SYSTEM FLUSH LOGS query_log; SELECT - count(materialize(toLowCardinality(1))) AS num, + count(materialize(toLowCardinality(1))) IGNORE NULLS AS num, hostName() AS hostName FROM `system`.query_log AS a diff --git a/tests/clickhouse-reference/03352_distinct_sorted_bug.sql.expected.ast.json b/tests/clickhouse-reference/03352_distinct_sorted_bug.sql.expected.ast.json index ff0f46f61..2adaa43c2 100644 --- a/tests/clickhouse-reference/03352_distinct_sorted_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/03352_distinct_sorted_bug.sql.expected.ast.json @@ -322,6 +322,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { diff --git a/tests/clickhouse-reference/03352_distinct_sorted_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/03352_distinct_sorted_bug.sql.expected.formatted.sql index 03ae98179..a8c7cc7b8 100644 --- a/tests/clickhouse-reference/03352_distinct_sorted_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03352_distinct_sorted_bug.sql.expected.formatted.sql @@ -52,7 +52,7 @@ FROM 1 AS id, 2 AS value ) AS subquery_1 -CROSS JOIN ( +, ( SELECT 3 AS id, 4 diff --git a/tests/clickhouse-reference/03355_join_to_in_optimization.sql.expected.ast.json b/tests/clickhouse-reference/03355_join_to_in_optimization.sql.expected.ast.json index cf67d6225..bd999a652 100644 --- a/tests/clickhouse-reference/03355_join_to_in_optimization.sql.expected.ast.json +++ b/tests/clickhouse-reference/03355_join_to_in_optimization.sql.expected.ast.json @@ -217,6 +217,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -335,7 +336,8 @@ } ] } - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/03355_join_to_in_optimization.sql.expected.formatted.sql b/tests/clickhouse-reference/03355_join_to_in_optimization.sql.expected.formatted.sql index d381649c5..9c5ee8950 100644 --- a/tests/clickhouse-reference/03355_join_to_in_optimization.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03355_join_to_in_optimization.sql.expected.formatted.sql @@ -34,7 +34,7 @@ EXPLAIN actions = 1, optimize = 1, header = 1 SELECT t1.id FROM t1 -CROSS JOIN t2 +, t2 WHERE t1.id = t2.id SETTINGS query_plan_use_new_logical_join_step = true, @@ -45,7 +45,7 @@ SELECT t1.key2 FROM t1 -INNER JOIN t2 +ALL INNER JOIN t2 ON (t1.id = t2.id) AND (t2.key = t2.key2) ORDER BY diff --git a/tests/clickhouse-reference/03357_jit_strikes_again.sql.expected.ast.json b/tests/clickhouse-reference/03357_jit_strikes_again.sql.expected.ast.json index 9c4d467e3..20e04577b 100644 --- a/tests/clickhouse-reference/03357_jit_strikes_again.sql.expected.ast.json +++ b/tests/clickhouse-reference/03357_jit_strikes_again.sql.expected.ast.json @@ -516,7 +516,8 @@ "nn" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -526,7 +527,8 @@ "vv" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] } diff --git a/tests/clickhouse-reference/03357_jit_strikes_again.sql.expected.formatted.sql b/tests/clickhouse-reference/03357_jit_strikes_again.sql.expected.formatted.sql index 58ba9877f..78a45e72f 100644 --- a/tests/clickhouse-reference/03357_jit_strikes_again.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03357_jit_strikes_again.sql.expected.formatted.sql @@ -43,5 +43,5 @@ FROM ( ORDER BY tuple('Nullable(String)', 16, toNullable(16), materialize(16)) DESC, tuple(toLowCardinality('9279104477'), toNullable(10), 10, 10, 10, 10, 10, toUInt128(10), 10, 10, 10, 10, 10, 10, 10, 10, 10, 10) DESC, - nn ASC, - vv ASC; \ No newline at end of file + nn ASC NULLS FIRST, + vv ASC NULLS FIRST; \ No newline at end of file diff --git a/tests/clickhouse-reference/03358_block_structure_match.sql.expected.ast.json b/tests/clickhouse-reference/03358_block_structure_match.sql.expected.ast.json index 68e323f83..90e14ce59 100644 --- a/tests/clickhouse-reference/03358_block_structure_match.sql.expected.ast.json +++ b/tests/clickhouse-reference/03358_block_structure_match.sql.expected.ast.json @@ -245,7 +245,8 @@ } ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, diff --git a/tests/clickhouse-reference/03358_block_structure_match.sql.expected.formatted.sql b/tests/clickhouse-reference/03358_block_structure_match.sql.expected.formatted.sql index 70609db1a..5e174d7da 100644 --- a/tests/clickhouse-reference/03358_block_structure_match.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03358_block_structure_match.sql.expected.formatted.sql @@ -33,7 +33,7 @@ FROM ( GROUP BY 2 ) WHERE materialize(4) -ORDER BY materialize(4) ASC; +ORDER BY materialize(4) ASC NULLS LAST; SELECT * FROM ( diff --git a/tests/clickhouse-reference/03360_any_join_parallel_hash_bug.sql.expected.ast.json b/tests/clickhouse-reference/03360_any_join_parallel_hash_bug.sql.expected.ast.json index feff410f2..7440f2075 100644 --- a/tests/clickhouse-reference/03360_any_join_parallel_hash_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/03360_any_join_parallel_hash_bug.sql.expected.ast.json @@ -65,7 +65,8 @@ ] } } - } + }, + "strictness": "ANY" }, "limit": { "count": { diff --git a/tests/clickhouse-reference/03360_any_join_parallel_hash_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/03360_any_join_parallel_hash_bug.sql.expected.formatted.sql index 13dbfb369..9b0a10a8c 100644 --- a/tests/clickhouse-reference/03360_any_join_parallel_hash_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03360_any_join_parallel_hash_bug.sql.expected.formatted.sql @@ -7,7 +7,7 @@ SELECT number FROM `system`.numbers -INNER JOIN `system`.numbers AS alias277 +ANY INNER JOIN `system`.numbers AS alias277 ON number = alias277.number LIMIT 102400 FORMAT Null diff --git a/tests/clickhouse-reference/03364_with_fill_select_from_cluster_view.sql.expected.ast.json b/tests/clickhouse-reference/03364_with_fill_select_from_cluster_view.sql.expected.ast.json index db02c2baf..ef16be95d 100644 --- a/tests/clickhouse-reference/03364_with_fill_select_from_cluster_view.sql.expected.ast.json +++ b/tests/clickhouse-reference/03364_with_fill_select_from_cluster_view.sql.expected.ast.json @@ -101,6 +101,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillFrom": { "kind": "functionCall", "name": "toDate", diff --git a/tests/clickhouse-reference/03366_with_fill_dag.sql.expected.ast.json b/tests/clickhouse-reference/03366_with_fill_dag.sql.expected.ast.json index caf2b71cf..043c930b7 100644 --- a/tests/clickhouse-reference/03366_with_fill_dag.sql.expected.ast.json +++ b/tests/clickhouse-reference/03366_with_fill_dag.sql.expected.ast.json @@ -30,6 +30,7 @@ ] }, "direction": "ASC", + "withFill": true, "fillStep": { "kind": "literal", "type": "UInt64", diff --git a/tests/clickhouse-reference/03395_global_join_supported_kind.sql.expected.ast.json b/tests/clickhouse-reference/03395_global_join_supported_kind.sql.expected.ast.json index f4dc5f9b0..636b7d8c7 100644 --- a/tests/clickhouse-reference/03395_global_join_supported_kind.sql.expected.ast.json +++ b/tests/clickhouse-reference/03395_global_join_supported_kind.sql.expected.ast.json @@ -56,7 +56,8 @@ ] } } - } + }, + "global": true }, "settings": [ { diff --git a/tests/clickhouse-reference/03395_global_join_supported_kind.sql.expected.formatted.sql b/tests/clickhouse-reference/03395_global_join_supported_kind.sql.expected.formatted.sql index 8b2064397..79cb4ba84 100644 --- a/tests/clickhouse-reference/03395_global_join_supported_kind.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03395_global_join_supported_kind.sql.expected.formatted.sql @@ -1,6 +1,6 @@ SELECT t1.* FROM remote('127.1') AS t1 -FULL JOIN remote('127.1') AS t2 +GLOBAL FULL JOIN remote('127.1') AS t2 ON t1.dummy = t2.dummy SETTINGS allow_experimental_analyzer = 1; \ No newline at end of file diff --git a/tests/clickhouse-reference/03400_get_server_setting.sql.expected.ast.json b/tests/clickhouse-reference/03400_get_server_setting.sql.expected.ast.json index b232aabe8..3afc814bd 100644 --- a/tests/clickhouse-reference/03400_get_server_setting.sql.expected.ast.json +++ b/tests/clickhouse-reference/03400_get_server_setting.sql.expected.ast.json @@ -79,6 +79,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -179,6 +180,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { diff --git a/tests/clickhouse-reference/03400_get_server_setting.sql.expected.formatted.sql b/tests/clickhouse-reference/03400_get_server_setting.sql.expected.formatted.sql index b566cf10a..2c80cc4d3 100644 --- a/tests/clickhouse-reference/03400_get_server_setting.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03400_get_server_setting.sql.expected.formatted.sql @@ -5,7 +5,7 @@ FROM FROM `system`.server_settings WHERE name = 'allow_use_jemalloc_memory' ) AS t1 -CROSS JOIN ( +, ( SELECT getServerSetting('allow_use_jemalloc_memory') AS val ) AS t2; @@ -16,7 +16,7 @@ FROM FROM `system`.server_settings WHERE name = 'mark_cache_policy' ) AS t1 -CROSS JOIN ( +, ( SELECT getServerSetting('mark_cache_policy') AS val ) AS t2; diff --git a/tests/clickhouse-reference/03401_get_merge_tree_setting.sql.expected.ast.json b/tests/clickhouse-reference/03401_get_merge_tree_setting.sql.expected.ast.json index 3b37b9802..dc3c6312e 100644 --- a/tests/clickhouse-reference/03401_get_merge_tree_setting.sql.expected.ast.json +++ b/tests/clickhouse-reference/03401_get_merge_tree_setting.sql.expected.ast.json @@ -79,6 +79,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -191,6 +192,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { diff --git a/tests/clickhouse-reference/03401_get_merge_tree_setting.sql.expected.formatted.sql b/tests/clickhouse-reference/03401_get_merge_tree_setting.sql.expected.formatted.sql index dda92efe8..faf7e6ac1 100644 --- a/tests/clickhouse-reference/03401_get_merge_tree_setting.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03401_get_merge_tree_setting.sql.expected.formatted.sql @@ -5,7 +5,7 @@ FROM FROM `system`.merge_tree_settings WHERE name = 'index_granularity' ) AS t1 -CROSS JOIN ( +, ( SELECT toString(getMergeTreeSetting('index_granularity')) AS val ) AS t2; @@ -16,7 +16,7 @@ FROM FROM `system`.merge_tree_settings WHERE name = 'max_merge_selecting_sleep_ms' ) AS t1 -CROSS JOIN ( +, ( SELECT toString(getMergeTreeSetting('max_merge_selecting_sleep_ms')) AS val ) AS t2; diff --git a/tests/clickhouse-reference/03402_concurrent_right_full_join.sql.expected.ast.json b/tests/clickhouse-reference/03402_concurrent_right_full_join.sql.expected.ast.json index da35dd448..19ee68c1f 100644 --- a/tests/clickhouse-reference/03402_concurrent_right_full_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/03402_concurrent_right_full_join.sql.expected.ast.json @@ -587,7 +587,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { diff --git a/tests/clickhouse-reference/03402_concurrent_right_full_join.sql.expected.formatted.sql b/tests/clickhouse-reference/03402_concurrent_right_full_join.sql.expected.formatted.sql index 12ace7487..ab00fcb7e 100644 --- a/tests/clickhouse-reference/03402_concurrent_right_full_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03402_concurrent_right_full_join.sql.expected.formatted.sql @@ -94,7 +94,7 @@ SELECT countIf(isNull(l.value)) FROM t_l_any AS l -RIGHT JOIN t_r_any AS r +ANY RIGHT JOIN t_r_any AS r ON l.id = r.id; -- 4) RIGHT OUTER with additional ON filter diff --git a/tests/clickhouse-reference/03404_ubsan_distinct_join_const_column.sql.expected.ast.json b/tests/clickhouse-reference/03404_ubsan_distinct_join_const_column.sql.expected.ast.json index f2980a309..876d4487a 100644 --- a/tests/clickhouse-reference/03404_ubsan_distinct_join_const_column.sql.expected.ast.json +++ b/tests/clickhouse-reference/03404_ubsan_distinct_join_const_column.sql.expected.ast.json @@ -218,6 +218,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { diff --git a/tests/clickhouse-reference/03404_ubsan_distinct_join_const_column.sql.expected.formatted.sql b/tests/clickhouse-reference/03404_ubsan_distinct_join_const_column.sql.expected.formatted.sql index 09f03d894..02103f73d 100644 --- a/tests/clickhouse-reference/03404_ubsan_distinct_join_const_column.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03404_ubsan_distinct_join_const_column.sql.expected.formatted.sql @@ -4,7 +4,7 @@ FROM SELECT CAST('[(1, ''a'')]', 'String') AS t GROUP BY GROUPING SETS ((1), (printf(printf(NULL, 7, printf(isNullable(7), 7, '%%d: %d', 7, 7, 7, NULL), 7, materialize(toUInt256(7)), '%%d: %d', isNull(toNullable(7)), 7), materialize(toNullable(NULL)))), (isNull(isZeroOrNull(isNullable(7))))) ) AS na -CROSS JOIN ( +, ( SELECT CAST(toNullable('[(1, ''a'')]'), 'String') AS t GROUP BY 1, diff --git a/tests/clickhouse-reference/03405_merge_filter_into_join.sql.expected.ast.json b/tests/clickhouse-reference/03405_merge_filter_into_join.sql.expected.ast.json index 6d2600542..ff3d8e6d1 100644 --- a/tests/clickhouse-reference/03405_merge_filter_into_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/03405_merge_filter_into_join.sql.expected.ast.json @@ -497,7 +497,8 @@ "type": "UInt64", "value": "1" } - } + }, + "strictness": "SEMI" } } }, @@ -685,7 +686,8 @@ "type": "UInt64", "value": "1" } - } + }, + "strictness": "ANTI" } } }, diff --git a/tests/clickhouse-reference/03405_merge_filter_into_join.sql.expected.formatted.sql b/tests/clickhouse-reference/03405_merge_filter_into_join.sql.expected.formatted.sql index bb40a8c95..e558eb2a7 100644 --- a/tests/clickhouse-reference/03405_merge_filter_into_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03405_merge_filter_into_join.sql.expected.formatted.sql @@ -76,7 +76,7 @@ FROM ( SELECT * FROM users AS u1 - INNER JOIN users AS u2 + SEMI INNER JOIN users AS u2 ON 1 ) WHERE age = u2.age @@ -102,7 +102,7 @@ FROM ( SELECT * FROM users AS u1 - INNER JOIN users AS u2 + ANTI INNER JOIN users AS u2 ON 1 ) WHERE age = u2.age diff --git a/tests/clickhouse-reference/03444_explain_asterisk.sql.expected.ast.json b/tests/clickhouse-reference/03444_explain_asterisk.sql.expected.ast.json index 4e19829fd..0f236017f 100644 --- a/tests/clickhouse-reference/03444_explain_asterisk.sql.expected.ast.json +++ b/tests/clickhouse-reference/03444_explain_asterisk.sql.expected.ast.json @@ -148,6 +148,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" @@ -155,6 +156,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -358,7 +360,8 @@ "x" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -369,7 +372,8 @@ "a" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -380,7 +384,8 @@ "a" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ] } diff --git a/tests/clickhouse-reference/03444_explain_asterisk.sql.expected.formatted.sql b/tests/clickhouse-reference/03444_explain_asterisk.sql.expected.formatted.sql index 149254397..2e36628bc 100644 --- a/tests/clickhouse-reference/03444_explain_asterisk.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03444_explain_asterisk.sql.expected.formatted.sql @@ -29,8 +29,8 @@ EXPLAIN SYNTAX SELECT * FROM t1 -CROSS JOIN t2 -CROSS JOIN ( +, t2 +, ( SELECT toNullable(10), *, @@ -52,8 +52,8 @@ CROSS JOIN ( ) AS t3 WHERE if(t2.b > 0, t2.a, 0) = t1.a ORDER BY - t3.x ASC, - t2.a DESC, - t1.a DESC; + t3.x ASC NULLS FIRST, + t2.a DESC NULLS LAST, + t1.a DESC NULLS FIRST; SET enable_analyzer = 1; \ No newline at end of file diff --git a/tests/clickhouse-reference/03447_analyzer_correlated_subqueries_tpc_h.sql.expected.ast.json b/tests/clickhouse-reference/03447_analyzer_correlated_subqueries_tpc_h.sql.expected.ast.json index 71ad7c8a1..89bcfa434 100644 --- a/tests/clickhouse-reference/03447_analyzer_correlated_subqueries_tpc_h.sql.expected.ast.json +++ b/tests/clickhouse-reference/03447_analyzer_correlated_subqueries_tpc_h.sql.expected.ast.json @@ -1035,6 +1035,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "supplier" @@ -1042,6 +1043,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "partsupp" @@ -1049,6 +1051,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation" @@ -1056,6 +1059,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "region" @@ -1212,6 +1216,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "supplier" @@ -1219,6 +1224,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation" @@ -1226,6 +1232,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "region" @@ -1581,6 +1588,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "part" @@ -1725,6 +1733,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation" @@ -2033,6 +2042,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "lineitem", @@ -2041,6 +2051,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "orders" @@ -2048,6 +2059,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation" diff --git a/tests/clickhouse-reference/03447_analyzer_correlated_subqueries_tpc_h.sql.expected.formatted.sql b/tests/clickhouse-reference/03447_analyzer_correlated_subqueries_tpc_h.sql.expected.formatted.sql index 7dd7cc926..c42d26647 100644 --- a/tests/clickhouse-reference/03447_analyzer_correlated_subqueries_tpc_h.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03447_analyzer_correlated_subqueries_tpc_h.sql.expected.formatted.sql @@ -155,10 +155,10 @@ SELECT s_comment FROM part -CROSS JOIN supplier -CROSS JOIN partsupp -CROSS JOIN nation -CROSS JOIN region +, supplier +, partsupp +, nation +, region WHERE p_partkey = ps_partkey AND s_suppkey = ps_suppkey AND p_size = 15 @@ -170,9 +170,9 @@ WHERE p_partkey = ps_partkey SELECT min(ps_supplycost) FROM partsupp - CROSS JOIN supplier - CROSS JOIN nation - CROSS JOIN region + , supplier + , nation + , region WHERE p_partkey = ps_partkey AND s_suppkey = ps_suppkey AND s_nationkey = n_nationkey @@ -207,7 +207,7 @@ FORMAT Null; SELECT sum(l_extendedprice) / 7.0 AS avg_yearly FROM lineitem -CROSS JOIN part +, part WHERE p_partkey = l_partkey AND p_brand = 'Brand#23' AND p_container = 'MED BOX' @@ -224,7 +224,7 @@ SELECT s_address FROM supplier -CROSS JOIN nation +, nation WHERE s_suppkey IN ( SELECT ps_suppkey FROM partsupp @@ -253,9 +253,9 @@ SELECT count(*) AS numwait FROM supplier -CROSS JOIN lineitem AS l1 -CROSS JOIN orders -CROSS JOIN nation +, lineitem AS l1 +, orders +, nation WHERE s_suppkey = l1.l_suppkey AND o_orderkey = l1.l_orderkey AND o_orderstatus = 'F' diff --git a/tests/clickhouse-reference/03447_float_nan_order.sql.expected.ast.json b/tests/clickhouse-reference/03447_float_nan_order.sql.expected.ast.json index 38c381bb9..ed26834bf 100644 --- a/tests/clickhouse-reference/03447_float_nan_order.sql.expected.ast.json +++ b/tests/clickhouse-reference/03447_float_nan_order.sql.expected.ast.json @@ -63,7 +63,8 @@ "a" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -121,7 +122,8 @@ "a" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -179,7 +181,8 @@ "a" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ] }, @@ -237,7 +240,8 @@ "a" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ] }, @@ -295,7 +299,8 @@ "a" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -353,7 +358,8 @@ "a" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -411,7 +417,8 @@ "a" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ] }, @@ -469,7 +476,8 @@ "a" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ] }, @@ -527,7 +535,8 @@ "a" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -594,7 +603,8 @@ "a" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -661,7 +671,8 @@ "a" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -728,7 +739,8 @@ "a" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -795,7 +807,8 @@ "a" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -862,7 +875,8 @@ "a" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -929,7 +943,8 @@ "a" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -996,7 +1011,8 @@ "a" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false }, { "kind": "orderByItem", diff --git a/tests/clickhouse-reference/03447_float_nan_order.sql.expected.formatted.sql b/tests/clickhouse-reference/03447_float_nan_order.sql.expected.formatted.sql index 9e92ca504..3ac9a363e 100644 --- a/tests/clickhouse-reference/03447_float_nan_order.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03447_float_nan_order.sql.expected.formatted.sql @@ -2,80 +2,80 @@ SELECT '--- short array ASC NULLS FIRST'; SELECT number + number / number AS a FROM numbers(3) -ORDER BY a ASC; +ORDER BY a ASC NULLS FIRST; SELECT number + number / number AS a FROM numbers(3) -ORDER BY a ASC; +ORDER BY a ASC NULLS LAST; SELECT number + number / number AS a FROM numbers(3) -ORDER BY a DESC; +ORDER BY a DESC NULLS FIRST; SELECT number + number / number AS a FROM numbers(3) -ORDER BY a DESC; +ORDER BY a DESC NULLS LAST; SELECT number + number / number AS a FROM numbers(256) -ORDER BY a ASC; +ORDER BY a ASC NULLS FIRST; SELECT number + number / number AS a FROM numbers(256) -ORDER BY a ASC; +ORDER BY a ASC NULLS LAST; SELECT number + number / number AS a FROM numbers(256) -ORDER BY a DESC; +ORDER BY a DESC NULLS FIRST; SELECT number + number / number AS a FROM numbers(256) -ORDER BY a DESC; +ORDER BY a DESC NULLS LAST; SELECT number + number / number AS a FROM numbers(3) ORDER BY - a ASC, + a ASC NULLS FIRST, 1 ASC; SELECT number + number / number AS a FROM numbers(3) ORDER BY - a ASC, + a ASC NULLS LAST, 1 ASC; SELECT number + number / number AS a FROM numbers(3) ORDER BY - a DESC, + a DESC NULLS FIRST, 1 ASC; SELECT number + number / number AS a FROM numbers(3) ORDER BY - a DESC, + a DESC NULLS LAST, 1 ASC; SELECT number + number / number AS a FROM numbers(256) ORDER BY - a ASC, + a ASC NULLS FIRST, 1 ASC; SELECT number + number / number AS a FROM numbers(256) ORDER BY - a ASC, + a ASC NULLS LAST, 1 ASC; SELECT number + number / number AS a FROM numbers(256) ORDER BY - a DESC, + a DESC NULLS FIRST, 1 ASC; SELECT number + number / number AS a FROM numbers(256) ORDER BY - a DESC, + a DESC NULLS LAST, 1 ASC; \ No newline at end of file diff --git a/tests/clickhouse-reference/03448_analyzer_array_join_alias_in_join_using_bug.sql.expected.ast.json b/tests/clickhouse-reference/03448_analyzer_array_join_alias_in_join_using_bug.sql.expected.ast.json index be898e24b..50f7e14c4 100644 --- a/tests/clickhouse-reference/03448_analyzer_array_join_alias_in_join_using_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/03448_analyzer_array_join_alias_in_join_using_bug.sql.expected.ast.json @@ -660,7 +660,8 @@ "columns": [ "arr_item" ] - } + }, + "global": true }, "leadingComments": [ "-- Fuzzed" diff --git a/tests/clickhouse-reference/03448_analyzer_array_join_alias_in_join_using_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/03448_analyzer_array_join_alias_in_join_using_bug.sql.expected.formatted.sql index 68d18b886..ca76eeeee 100644 --- a/tests/clickhouse-reference/03448_analyzer_array_join_alias_in_join_using_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03448_analyzer_array_join_alias_in_join_using_bug.sql.expected.formatted.sql @@ -72,7 +72,7 @@ SELECT arr FROM remote('127.0.0.2', currentDatabase(), local_table) AS r ARRAY JOIN arr AS arr_item -RIGHT JOIN ( +GLOBAL RIGHT JOIN ( SELECT 1 AS arr_item ) AS foo USING (arr_item); \ No newline at end of file diff --git a/tests/clickhouse-reference/03449_window_cannot_find_column.sql.expected.ast.json b/tests/clickhouse-reference/03449_window_cannot_find_column.sql.expected.ast.json index fefb6d6cc..2b6147ea4 100644 --- a/tests/clickhouse-reference/03449_window_cannot_find_column.sql.expected.ast.json +++ b/tests/clickhouse-reference/03449_window_cannot_find_column.sql.expected.ast.json @@ -99,7 +99,8 @@ "expr": { "kind": "functionCall", "name": "rank", - "args": [] + "args": [], + "windowName": "w0" }, "alias": "c_2_c2398_0" } diff --git a/tests/clickhouse-reference/03449_window_cannot_find_column.sql.expected.formatted.sql b/tests/clickhouse-reference/03449_window_cannot_find_column.sql.expected.formatted.sql index c3b13d812..20848b67b 100644 --- a/tests/clickhouse-reference/03449_window_cannot_find_column.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03449_window_cannot_find_column.sql.expected.formatted.sql @@ -17,7 +17,7 @@ FROM t0 AS ref_0; INSERT INTO t0; WITH cte_4 AS ( - SELECT rank() AS c_2_c2398_0 + SELECT rank() OVER w0 AS c_2_c2398_0 FROM t3 AS ref_15 WINDOW w0 AS (PARTITION BY ref_15.c_2_c16_0 ORDER BY ref_15.c_2_c16_0 DESC) ) diff --git a/tests/clickhouse-reference/03454_global_join_index_subqueries.sql.expected.ast.json b/tests/clickhouse-reference/03454_global_join_index_subqueries.sql.expected.ast.json index ea01094af..16bf44f7e 100644 --- a/tests/clickhouse-reference/03454_global_join_index_subqueries.sql.expected.ast.json +++ b/tests/clickhouse-reference/03454_global_join_index_subqueries.sql.expected.ast.json @@ -80,7 +80,8 @@ ] } } - } + }, + "global": true } }, { diff --git a/tests/clickhouse-reference/03454_global_join_index_subqueries.sql.expected.formatted.sql b/tests/clickhouse-reference/03454_global_join_index_subqueries.sql.expected.formatted.sql index c5e9c9857..6bf4aedaa 100644 --- a/tests/clickhouse-reference/03454_global_join_index_subqueries.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03454_global_join_index_subqueries.sql.expected.formatted.sql @@ -1,7 +1,7 @@ SELECT * FROM cluster(test_cluster_two_shards, `system`.one) AS A -INNER JOIN ( +GLOBAL INNER JOIN ( SELECT * FROM cluster(test_cluster_two_shards, `system`.one) ) AS B diff --git a/tests/clickhouse-reference/03457_bitmapContains_nullable.sql.expected.ast.json b/tests/clickhouse-reference/03457_bitmapContains_nullable.sql.expected.ast.json index 978ec820f..135df7173 100644 --- a/tests/clickhouse-reference/03457_bitmapContains_nullable.sql.expected.ast.json +++ b/tests/clickhouse-reference/03457_bitmapContains_nullable.sql.expected.ast.json @@ -485,6 +485,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t" @@ -549,6 +550,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "t2" diff --git a/tests/clickhouse-reference/03457_bitmapContains_nullable.sql.expected.formatted.sql b/tests/clickhouse-reference/03457_bitmapContains_nullable.sql.expected.formatted.sql index 55863969a..5ab8ead0d 100644 --- a/tests/clickhouse-reference/03457_bitmapContains_nullable.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03457_bitmapContains_nullable.sql.expected.formatted.sql @@ -35,7 +35,7 @@ t2 AS ( AND (age <= hi), id, NULL)) AS bit_state FROM men - CROSS JOIN t + , t GROUP BY n ) @@ -44,5 +44,5 @@ SELECT sumIf(sal, bitmapContains(bit_state, id)) FROM men -CROSS JOIN t2 +, t2 GROUP BY name; -- { serverError ILLEGAL_TYPE_OF_ARGUMENT } \ No newline at end of file diff --git a/tests/clickhouse-reference/03513_read_in_order_nullable.sql.expected.ast.json b/tests/clickhouse-reference/03513_read_in_order_nullable.sql.expected.ast.json index 0b4b8717e..e79c706bc 100644 --- a/tests/clickhouse-reference/03513_read_in_order_nullable.sql.expected.ast.json +++ b/tests/clickhouse-reference/03513_read_in_order_nullable.sql.expected.ast.json @@ -124,7 +124,8 @@ "c0" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ] }, @@ -148,7 +149,8 @@ "c0" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ] }, @@ -172,7 +174,8 @@ "c0" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -196,7 +199,8 @@ "c0" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -298,7 +302,8 @@ "c0" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ] }, @@ -322,7 +327,8 @@ "c0" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ] }, @@ -346,7 +352,8 @@ "c0" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -370,7 +377,8 @@ "c0" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -444,7 +452,8 @@ "c0" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ] }, @@ -468,7 +477,8 @@ "c0" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ] }, @@ -492,7 +502,8 @@ "c0" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -516,7 +527,8 @@ "c0" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -602,7 +614,8 @@ "c0" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ] }, @@ -626,7 +639,8 @@ "c0" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ] }, @@ -650,7 +664,8 @@ "c0" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -674,7 +689,8 @@ "c0" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -788,7 +804,8 @@ "c0" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ] }, @@ -812,7 +829,8 @@ "c0" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ] }, @@ -836,7 +854,8 @@ "c0" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -860,7 +879,8 @@ "c0" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] } diff --git a/tests/clickhouse-reference/03513_read_in_order_nullable.sql.expected.formatted.sql b/tests/clickhouse-reference/03513_read_in_order_nullable.sql.expected.formatted.sql index ad893254d..1a50e02fd 100644 --- a/tests/clickhouse-reference/03513_read_in_order_nullable.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03513_read_in_order_nullable.sql.expected.formatted.sql @@ -18,19 +18,19 @@ SELECT '--- table asc, query desc, last'; SELECT * FROM t0 -ORDER BY c0 DESC; +ORDER BY c0 DESC NULLS LAST; SELECT * FROM t0 -ORDER BY c0 DESC; +ORDER BY c0 DESC NULLS FIRST; SELECT * FROM t0 -ORDER BY c0 ASC; +ORDER BY c0 ASC NULLS LAST; SELECT * FROM t0 -ORDER BY c0 ASC; +ORDER BY c0 ASC NULLS FIRST; CREATE TABLE t1 ( @@ -46,19 +46,19 @@ INSERT INTO t1; SELECT * FROM t1 -ORDER BY c0 DESC; +ORDER BY c0 DESC NULLS LAST; SELECT * FROM t1 -ORDER BY c0 DESC; +ORDER BY c0 DESC NULLS FIRST; SELECT * FROM t1 -ORDER BY c0 ASC; +ORDER BY c0 ASC NULLS LAST; SELECT * FROM t1 -ORDER BY c0 ASC; +ORDER BY c0 ASC NULLS FIRST; CREATE TABLE f0 ( @@ -73,19 +73,19 @@ INSERT INTO f0; SELECT * FROM f0 -ORDER BY c0 DESC; +ORDER BY c0 DESC NULLS LAST; SELECT * FROM f0 -ORDER BY c0 DESC; +ORDER BY c0 DESC NULLS FIRST; SELECT * FROM f0 -ORDER BY c0 ASC; +ORDER BY c0 ASC NULLS LAST; SELECT * FROM f0 -ORDER BY c0 ASC; +ORDER BY c0 ASC NULLS FIRST; CREATE TABLE f1 ( @@ -101,19 +101,19 @@ INSERT INTO f1; SELECT * FROM f1 -ORDER BY c0 DESC; +ORDER BY c0 DESC NULLS LAST; SELECT * FROM f1 -ORDER BY c0 DESC; +ORDER BY c0 DESC NULLS FIRST; SELECT * FROM f1 -ORDER BY c0 ASC; +ORDER BY c0 ASC NULLS LAST; SELECT * FROM f1 -ORDER BY c0 ASC; +ORDER BY c0 ASC NULLS FIRST; SET allow_suspicious_low_cardinality_types = 1; @@ -131,16 +131,16 @@ INSERT INTO lct0; SELECT * FROM lct0 -ORDER BY c0 DESC; +ORDER BY c0 DESC NULLS LAST; SELECT * FROM lct0 -ORDER BY c0 DESC; +ORDER BY c0 DESC NULLS FIRST; SELECT * FROM lct0 -ORDER BY c0 ASC; +ORDER BY c0 ASC NULLS LAST; SELECT * FROM lct0 -ORDER BY c0 ASC; \ No newline at end of file +ORDER BY c0 ASC NULLS FIRST; \ No newline at end of file diff --git a/tests/clickhouse-reference/03521_bitNot_String_NUL_terminated.sql.expected.ast.json b/tests/clickhouse-reference/03521_bitNot_String_NUL_terminated.sql.expected.ast.json index 3c3e0457c..bf0b61fde 100644 --- a/tests/clickhouse-reference/03521_bitNot_String_NUL_terminated.sql.expected.ast.json +++ b/tests/clickhouse-reference/03521_bitNot_String_NUL_terminated.sql.expected.ast.json @@ -18,7 +18,8 @@ } ] } - ] + ], + "nullsAction": "IGNORE NULLS" }, { "kind": "functionCall", @@ -36,7 +37,8 @@ } ] } - ] + ], + "nullsAction": "IGNORE NULLS" } ], "from": { diff --git a/tests/clickhouse-reference/03521_bitNot_String_NUL_terminated.sql.expected.formatted.sql b/tests/clickhouse-reference/03521_bitNot_String_NUL_terminated.sql.expected.formatted.sql index e634f8b11..64bd3aa3d 100644 --- a/tests/clickhouse-reference/03521_bitNot_String_NUL_terminated.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03521_bitNot_String_NUL_terminated.sql.expected.formatted.sql @@ -1,8 +1,8 @@ -- https://github.com/ClickHouse/ClickHouse/issues/80774 -- Regression for "Logical error: 'res.data[res.size] == '\0'" (in StringValueCompatibility) SELECT - uniqCombined64(bitNot(x)), - anyHeavy(bitNot(x)) + uniqCombined64(bitNot(x)) IGNORE NULLS, + anyHeavy(bitNot(x)) IGNORE NULLS FROM ( SELECT DISTINCT concat(2, number) AS x FROM numbers(10) diff --git a/tests/clickhouse-reference/03522_join_using_bug_78907.sql.expected.ast.json b/tests/clickhouse-reference/03522_join_using_bug_78907.sql.expected.ast.json index d5b31a9ef..84c4f4985 100644 --- a/tests/clickhouse-reference/03522_join_using_bug_78907.sql.expected.ast.json +++ b/tests/clickhouse-reference/03522_join_using_bug_78907.sql.expected.ast.json @@ -409,7 +409,9 @@ "columns": [ "a" ] - } + }, + "strictness": "ALL", + "global": true }, "orderBy": [ { diff --git a/tests/clickhouse-reference/03522_join_using_bug_78907.sql.expected.formatted.sql b/tests/clickhouse-reference/03522_join_using_bug_78907.sql.expected.formatted.sql index d31cbdc4b..19ab8bf12 100644 --- a/tests/clickhouse-reference/03522_join_using_bug_78907.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03522_join_using_bug_78907.sql.expected.formatted.sql @@ -29,7 +29,7 @@ SELECT b + 1 AS a FROM tb__fuzz_0 -INNER JOIN tabc__fuzz_21 +GLOBAL ALL INNER JOIN tabc__fuzz_21 USING (a) ORDER BY `ALL` DESC SETTINGS diff --git a/tests/clickhouse-reference/03522_window_table_arg.sql.expected.ast.json b/tests/clickhouse-reference/03522_window_table_arg.sql.expected.ast.json index aeb54df8a..5414eab85 100644 --- a/tests/clickhouse-reference/03522_window_table_arg.sql.expected.ast.json +++ b/tests/clickhouse-reference/03522_window_table_arg.sql.expected.ast.json @@ -31,7 +31,8 @@ { "kind": "functionCall", "name": "row_number", - "args": [] + "args": [], + "windowName": "w" } ], "from": { diff --git a/tests/clickhouse-reference/03522_window_table_arg.sql.expected.formatted.sql b/tests/clickhouse-reference/03522_window_table_arg.sql.expected.formatted.sql index 8690a8623..a795cc093 100644 --- a/tests/clickhouse-reference/03522_window_table_arg.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03522_window_table_arg.sql.expected.formatted.sql @@ -2,7 +2,7 @@ SET enable_analyzer = 1; SELECT * FROM view(( - SELECT row_number() + SELECT row_number() OVER w FROM numbers(3) WINDOW w AS () )); diff --git a/tests/clickhouse-reference/03532_window_function_and_null_source_max_threads.sql.expected.ast.json b/tests/clickhouse-reference/03532_window_function_and_null_source_max_threads.sql.expected.ast.json index ad7ead938..4ab154a12 100644 --- a/tests/clickhouse-reference/03532_window_function_and_null_source_max_threads.sql.expected.ast.json +++ b/tests/clickhouse-reference/03532_window_function_and_null_source_max_threads.sql.expected.ast.json @@ -90,6 +90,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "empty", @@ -456,6 +457,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "empty", @@ -782,6 +784,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "empty", diff --git a/tests/clickhouse-reference/03532_window_function_and_null_source_max_threads.sql.expected.formatted.sql b/tests/clickhouse-reference/03532_window_function_and_null_source_max_threads.sql.expected.formatted.sql index fe0f83f95..29e57a4ba 100644 --- a/tests/clickhouse-reference/03532_window_function_and_null_source_max_threads.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03532_window_function_and_null_source_max_threads.sql.expected.formatted.sql @@ -58,7 +58,7 @@ FROM ( n2.n AS b FROM empty AS n1 - CROSS JOIN empty AS n2 + , empty AS n2 WHERE (n1.n % 7) = (n2.n % 5) ), @@ -95,7 +95,7 @@ FROM ( n2.n AS b FROM empty AS n1 - CROSS JOIN empty AS n2 + , empty AS n2 WHERE (n1.n % 7) = (n2.n % 5) ), @@ -131,7 +131,7 @@ FROM ( n2.n AS b FROM empty AS n1 - CROSS JOIN empty AS n2 + , empty AS n2 WHERE (n1.n % 7) = (n2.n % 5) ), diff --git a/tests/clickhouse-reference/03533_analyzer_correlated_column_check.sql.expected.ast.json b/tests/clickhouse-reference/03533_analyzer_correlated_column_check.sql.expected.ast.json index 2d81ef06b..f9f76b6e1 100644 --- a/tests/clickhouse-reference/03533_analyzer_correlated_column_check.sql.expected.ast.json +++ b/tests/clickhouse-reference/03533_analyzer_correlated_column_check.sql.expected.ast.json @@ -141,7 +141,8 @@ } ] } - ] + ], + "nullsAction": "IGNORE NULLS" }, "alias": "rows" } @@ -168,7 +169,8 @@ { "kind": "asterisk" } - ] + ], + "nullsAction": "IGNORE NULLS" }, "alias": "rows" } @@ -436,7 +438,8 @@ } ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -460,7 +463,8 @@ "ALL" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ], "trailingComments": [ diff --git a/tests/clickhouse-reference/03533_analyzer_correlated_column_check.sql.expected.formatted.sql b/tests/clickhouse-reference/03533_analyzer_correlated_column_check.sql.expected.formatted.sql index f1ab53bc5..4406e4908 100644 --- a/tests/clickhouse-reference/03533_analyzer_correlated_column_check.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03533_analyzer_correlated_column_check.sql.expected.formatted.sql @@ -12,20 +12,20 @@ FROM ( UNION ALL SELECT 3, - deltaSumState(arrayJoin([4, 6])) AS `rows` + deltaSumState(arrayJoin([4, 6])) IGNORE NULLS AS `rows` WITH TOTALS UNION ALL SELECT DISTINCT 2, - deltaSumState(*) AS `rows` + deltaSumState(*) IGNORE NULLS AS `rows` QUALIFY delta_sum = ignore(ignore(materialize(1023), *, *, toUInt256(10), *, *, 10, *, toUInt256(toUInt128(10)), isNotNull(10), 10, 10, 10, 10, materialize(toNullable(toUInt128(10))), *, isNullable(NULL), 10)) ) ORDER BY 1 DESC, - ignore(*, *, 10, *, 10, 10, 10, 10, 10, *, toUInt128(10), 10, *, 10, isNull(NULL), 10, 10) ASC, + ignore(*, *, 10, *, 10, 10, 10, 10, 10, *, toUInt128(10), 10, *, 10, isNull(NULL), 10, 10) ASC NULLS FIRST, x ASC ) -ORDER BY `ALL` DESC; -- { serverError ILLEGAL_AGGREGATION } +ORDER BY `ALL` DESC NULLS FIRST; -- { serverError ILLEGAL_AGGREGATION } CREATE TABLE t ( diff --git a/tests/clickhouse-reference/03538_analyzer_filter_analysis_alias_columns.sql.expected.ast.json b/tests/clickhouse-reference/03538_analyzer_filter_analysis_alias_columns.sql.expected.ast.json index 949102324..1149987c1 100644 --- a/tests/clickhouse-reference/03538_analyzer_filter_analysis_alias_columns.sql.expected.ast.json +++ b/tests/clickhouse-reference/03538_analyzer_filter_analysis_alias_columns.sql.expected.ast.json @@ -227,6 +227,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "remote", diff --git a/tests/clickhouse-reference/03538_analyzer_filter_analysis_alias_columns.sql.expected.formatted.sql b/tests/clickhouse-reference/03538_analyzer_filter_analysis_alias_columns.sql.expected.formatted.sql index cdd431241..c05cb22e7 100644 --- a/tests/clickhouse-reference/03538_analyzer_filter_analysis_alias_columns.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03538_analyzer_filter_analysis_alias_columns.sql.expected.formatted.sql @@ -37,7 +37,7 @@ FROM SELECT 1 AS c0 FROM t0 - CROSS JOIN remote('localhost:9000', currentDatabase(), 't0') AS ty + , remote('localhost:9000', currentDatabase(), 't0') AS ty ) AS tx INNER JOIN t0 ON tx.c0 = t0.c0; diff --git a/tests/clickhouse-reference/03552_inconsistent_formatting_operator_as_table_function.sql.expected.ast.json b/tests/clickhouse-reference/03552_inconsistent_formatting_operator_as_table_function.sql.expected.ast.json index af3e1113e..4d517fbce 100644 --- a/tests/clickhouse-reference/03552_inconsistent_formatting_operator_as_table_function.sql.expected.ast.json +++ b/tests/clickhouse-reference/03552_inconsistent_formatting_operator_as_table_function.sql.expected.ast.json @@ -344,7 +344,8 @@ "ALL" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ], "trailingComments": [ diff --git a/tests/clickhouse-reference/03552_inconsistent_formatting_operator_as_table_function.sql.expected.formatted.sql b/tests/clickhouse-reference/03552_inconsistent_formatting_operator_as_table_function.sql.expected.formatted.sql index 10401b705..b67f13f70 100644 --- a/tests/clickhouse-reference/03552_inconsistent_formatting_operator_as_table_function.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03552_inconsistent_formatting_operator_as_table_function.sql.expected.formatted.sql @@ -28,7 +28,7 @@ PREWHERE *.1 WHERE (notLike('SELECT * FROM t_prewarm_add_column%', query)) AND (type = 'QueryFinish') AND (current_database = currentDatabase()) -ORDER BY `ALL` DESC; -- { serverError UNKNOWN_TABLE } +ORDER BY `ALL` DESC NULLS FIRST; -- { serverError UNKNOWN_TABLE } SELECT (((1), (2))); diff --git a/tests/clickhouse-reference/03569_max_joined_block_size_rows_bug.sql.expected.ast.json b/tests/clickhouse-reference/03569_max_joined_block_size_rows_bug.sql.expected.ast.json index 7f863aa14..a512505d9 100644 --- a/tests/clickhouse-reference/03569_max_joined_block_size_rows_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/03569_max_joined_block_size_rows_bug.sql.expected.ast.json @@ -27,6 +27,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "database": "system", @@ -68,6 +69,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "database": "system", diff --git a/tests/clickhouse-reference/03569_max_joined_block_size_rows_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/03569_max_joined_block_size_rows_bug.sql.expected.formatted.sql index a2ff572a7..00c632300 100644 --- a/tests/clickhouse-reference/03569_max_joined_block_size_rows_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03569_max_joined_block_size_rows_bug.sql.expected.formatted.sql @@ -3,7 +3,7 @@ SET enable_analyzer = 1; SELECT * FROM `system`.one -CROSS JOIN `system`.one +, `system`.one SETTINGS max_joined_block_size_rows = 0, joined_block_split_single_row = 0 @@ -12,7 +12,7 @@ FORMAT Null; SELECT * FROM `system`.one -CROSS JOIN `system`.one +, `system`.one SETTINGS max_joined_block_size_rows = 0, joined_block_split_single_row = 1 diff --git a/tests/clickhouse-reference/03570_limit_by_all.sql.expected.ast.json b/tests/clickhouse-reference/03570_limit_by_all.sql.expected.ast.json index 315ac62d0..9c7058c11 100644 --- a/tests/clickhouse-reference/03570_limit_by_all.sql.expected.ast.json +++ b/tests/clickhouse-reference/03570_limit_by_all.sql.expected.ast.json @@ -2497,7 +2497,8 @@ "category" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", diff --git a/tests/clickhouse-reference/03570_limit_by_all.sql.expected.formatted.sql b/tests/clickhouse-reference/03570_limit_by_all.sql.expected.formatted.sql index 6550263e2..da92b6725 100644 --- a/tests/clickhouse-reference/03570_limit_by_all.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03570_limit_by_all.sql.expected.formatted.sql @@ -387,7 +387,7 @@ SELECT FROM test_limit_by_all ORDER BY id ASC, - category ASC, + category ASC NULLS FIRST, value ASC LIMIT 1 BY ALL; diff --git a/tests/clickhouse-reference/03571_limit_by_all_old_planner.sql.expected.ast.json b/tests/clickhouse-reference/03571_limit_by_all_old_planner.sql.expected.ast.json index a96708482..5c1f1e265 100644 --- a/tests/clickhouse-reference/03571_limit_by_all_old_planner.sql.expected.ast.json +++ b/tests/clickhouse-reference/03571_limit_by_all_old_planner.sql.expected.ast.json @@ -1403,7 +1403,8 @@ "category" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", diff --git a/tests/clickhouse-reference/03571_limit_by_all_old_planner.sql.expected.formatted.sql b/tests/clickhouse-reference/03571_limit_by_all_old_planner.sql.expected.formatted.sql index 202675b4b..33d4f0afd 100644 --- a/tests/clickhouse-reference/03571_limit_by_all_old_planner.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03571_limit_by_all_old_planner.sql.expected.formatted.sql @@ -197,7 +197,7 @@ SELECT FROM test_limit_by_all_old_planner ORDER BY id ASC, - category ASC, + category ASC NULLS FIRST, value ASC LIMIT 1 BY id, category; diff --git a/tests/clickhouse-reference/03573_concurrent_hash_scatter_bug.sql.expected.ast.json b/tests/clickhouse-reference/03573_concurrent_hash_scatter_bug.sql.expected.ast.json index e3a74fb05..07415050e 100644 --- a/tests/clickhouse-reference/03573_concurrent_hash_scatter_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/03573_concurrent_hash_scatter_bug.sql.expected.ast.json @@ -211,7 +211,8 @@ ] } } - } + }, + "strictness": "ANY" } }, { @@ -292,7 +293,8 @@ "columns": [ "id" ] - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/03573_concurrent_hash_scatter_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/03573_concurrent_hash_scatter_bug.sql.expected.formatted.sql index 712bf1439..b0982e1bb 100644 --- a/tests/clickhouse-reference/03573_concurrent_hash_scatter_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03573_concurrent_hash_scatter_bug.sql.expected.formatted.sql @@ -37,7 +37,7 @@ SET join_algorithm = 'parallel_hash'; SELECT i FROM t0 -INNER JOIN ( +ANY INNER JOIN ( SELECT 3 AS k ) AS x ON x.k = j; @@ -51,7 +51,7 @@ WHERE number != 3; SELECT * FROM test_table_join_1 AS t1 -INNER JOIN test_table_join_2 AS t2 +ANY INNER JOIN test_table_join_2 AS t2 USING (id) ORDER BY id ASC, diff --git a/tests/clickhouse-reference/03576_analyzer_recursive_window.sql.expected.ast.json b/tests/clickhouse-reference/03576_analyzer_recursive_window.sql.expected.ast.json index 4a2ac3d82..39a32b5e1 100644 --- a/tests/clickhouse-reference/03576_analyzer_recursive_window.sql.expected.ast.json +++ b/tests/clickhouse-reference/03576_analyzer_recursive_window.sql.expected.ast.json @@ -25,7 +25,9 @@ "value": "1" } ], - "window": {} + "window": { + "baseWindow": "w0" + } }, "direction": "ASC" } @@ -73,7 +75,9 @@ "value": "1" } ], - "window": {} + "window": { + "baseWindow": "w0" + } }, "direction": "ASC" } diff --git a/tests/clickhouse-reference/03576_analyzer_recursive_window.sql.expected.formatted.sql b/tests/clickhouse-reference/03576_analyzer_recursive_window.sql.expected.formatted.sql index 3f7a94ae3..ae87d5f69 100644 --- a/tests/clickhouse-reference/03576_analyzer_recursive_window.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03576_analyzer_recursive_window.sql.expected.formatted.sql @@ -1,7 +1,7 @@ SELECT 1 -WINDOW w0 AS (ORDER BY min(1) OVER () ASC) +WINDOW w0 AS (ORDER BY min(1) OVER (w0) ASC) SETTINGS allow_experimental_analyzer = 1; -- { serverError UNSUPPORTED_METHOD } SELECT 1 -WINDOW w0 AS (ORDER BY min(1) OVER () ASC) +WINDOW w0 AS (ORDER BY min(1) OVER (w0) ASC) SETTINGS allow_experimental_analyzer = 0; -- { serverError ILLEGAL_AGGREGATION } \ No newline at end of file diff --git a/tests/clickhouse-reference/03577_server_constant_folding.sql.expected.ast.json b/tests/clickhouse-reference/03577_server_constant_folding.sql.expected.ast.json index 596463568..5b18baca5 100644 --- a/tests/clickhouse-reference/03577_server_constant_folding.sql.expected.ast.json +++ b/tests/clickhouse-reference/03577_server_constant_folding.sql.expected.ast.json @@ -1241,7 +1241,8 @@ ] } } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1377,7 +1378,8 @@ ] } } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -1521,7 +1523,9 @@ ] } } - } + }, + "strictness": "ALL", + "global": true }, "orderBy": [ { @@ -1657,7 +1661,9 @@ ] } } - } + }, + "strictness": "ALL", + "global": true }, "orderBy": [ { @@ -1852,7 +1858,8 @@ ] } } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -2043,7 +2050,8 @@ ] } } - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -2238,7 +2246,9 @@ ] } } - } + }, + "strictness": "ALL", + "global": true }, "orderBy": [ { @@ -2429,7 +2439,9 @@ ] } } - } + }, + "strictness": "ALL", + "global": true }, "orderBy": [ { diff --git a/tests/clickhouse-reference/03577_server_constant_folding.sql.expected.formatted.sql b/tests/clickhouse-reference/03577_server_constant_folding.sql.expected.formatted.sql index c341b17ac..5def9271c 100644 --- a/tests/clickhouse-reference/03577_server_constant_folding.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03577_server_constant_folding.sql.expected.formatted.sql @@ -135,7 +135,7 @@ SELECT tab.number FROM remote('127.0.0.{1..3}', numbers(100)) AS tab -INNER JOIN ( +ALL INNER JOIN ( SELECT number FROM numbers(10) WHERE number = shardNum() @@ -151,7 +151,7 @@ SELECT number FROM remote('127.0.0.{1..3}', numbers(100)) -INNER JOIN ( +ALL INNER JOIN ( SELECT number AS flt_number FROM numbers(10) WHERE number = shardNum() @@ -169,7 +169,7 @@ SELECT tab.number FROM remote('127.0.0.{1..3}', numbers(100)) AS tab -INNER JOIN ( +GLOBAL ALL INNER JOIN ( SELECT number FROM numbers(10) WHERE number = shardNum() @@ -185,7 +185,7 @@ SELECT number FROM remote('127.0.0.{1..3}', numbers(100)) -INNER JOIN ( +GLOBAL ALL INNER JOIN ( SELECT number AS flt_number FROM numbers(10) WHERE number = shardNum() @@ -203,7 +203,7 @@ SELECT tab.number FROM remote('127.0.0.{1..3}', numbers(100)) AS tab -INNER JOIN ( +ALL INNER JOIN ( SELECT number FROM numbers(10) WHERE number = shardNum() @@ -223,7 +223,7 @@ SELECT number FROM remote('127.0.0.{1..3}', numbers(100)) -INNER JOIN ( +ALL INNER JOIN ( SELECT number AS flt_number FROM numbers(10) WHERE number = shardNum() @@ -245,7 +245,7 @@ SELECT tab.number FROM remote('127.0.0.{1..3}', numbers(100)) AS tab -INNER JOIN ( +GLOBAL ALL INNER JOIN ( SELECT number FROM numbers(10) WHERE number = shardNum() @@ -265,7 +265,7 @@ SELECT number FROM remote('127.0.0.{1..3}', numbers(100)) -INNER JOIN ( +GLOBAL ALL INNER JOIN ( SELECT number AS flt_number FROM numbers(10) WHERE number = shardNum() diff --git a/tests/clickhouse-reference/03580_join_runtime_filter_prewhere.sql.expected.ast.json b/tests/clickhouse-reference/03580_join_runtime_filter_prewhere.sql.expected.ast.json index 0bf12cedb..7882cc9e0 100644 --- a/tests/clickhouse-reference/03580_join_runtime_filter_prewhere.sql.expected.ast.json +++ b/tests/clickhouse-reference/03580_join_runtime_filter_prewhere.sql.expected.ast.json @@ -287,6 +287,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation" @@ -509,6 +510,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "customer" @@ -708,6 +710,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "customer" diff --git a/tests/clickhouse-reference/03580_join_runtime_filter_prewhere.sql.expected.formatted.sql b/tests/clickhouse-reference/03580_join_runtime_filter_prewhere.sql.expected.formatted.sql index ef43b92f0..15eddbf49 100644 --- a/tests/clickhouse-reference/03580_join_runtime_filter_prewhere.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03580_join_runtime_filter_prewhere.sql.expected.formatted.sql @@ -42,7 +42,7 @@ FROM ( max(c_custkey) FROM customer - CROSS JOIN nation + , nation WHERE (c_nationkey = n_nationkey) AND (n_name = 'FRANCE') SETTINGS @@ -64,7 +64,7 @@ FROM ( max(c_custkey) FROM nation - CROSS JOIN customer + , customer WHERE (c_nationkey = n_nationkey) AND (n_name = 'FRANCE') SETTINGS @@ -83,7 +83,7 @@ FROM ( SELECT count() FROM nation - CROSS JOIN customer + , customer WHERE (c_nationkey = n_nationkey) AND (n_name = 'FRANCE') AND (c_custkey % 4 = 0) diff --git a/tests/clickhouse-reference/03593_any_join_swap_tables.sql.expected.ast.json b/tests/clickhouse-reference/03593_any_join_swap_tables.sql.expected.ast.json index 2ac6f8615..564eb8f40 100644 --- a/tests/clickhouse-reference/03593_any_join_swap_tables.sql.expected.ast.json +++ b/tests/clickhouse-reference/03593_any_join_swap_tables.sql.expected.ast.json @@ -169,7 +169,8 @@ ] } } - } + }, + "strictness": "ANY" }, "format": "Null", "postFormatSettings": [ diff --git a/tests/clickhouse-reference/03593_any_join_swap_tables.sql.expected.formatted.sql b/tests/clickhouse-reference/03593_any_join_swap_tables.sql.expected.formatted.sql index c03466e82..4e9d20e66 100644 --- a/tests/clickhouse-reference/03593_any_join_swap_tables.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03593_any_join_swap_tables.sql.expected.formatted.sql @@ -24,7 +24,7 @@ SET enable_analyzer = 1, query_plan_join_swap_table = 'auto'; SELECT * FROM lhs -INNER JOIN rhs +ANY INNER JOIN rhs ON lhs.a = rhs.a FORMAT Null SETTINGS log_comment = '03593_any_join_swap_tables'; diff --git a/tests/clickhouse-reference/03595_analyzer_lateral_join.sql.expected.ast.json b/tests/clickhouse-reference/03595_analyzer_lateral_join.sql.expected.ast.json index 5e38a5bdb..4329a25d3 100644 --- a/tests/clickhouse-reference/03595_analyzer_lateral_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/03595_analyzer_lateral_join.sql.expected.ast.json @@ -64,6 +64,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -147,6 +148,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { diff --git a/tests/clickhouse-reference/03595_analyzer_lateral_join.sql.expected.formatted.sql b/tests/clickhouse-reference/03595_analyzer_lateral_join.sql.expected.formatted.sql index 7232a4e39..510e4a3bd 100644 --- a/tests/clickhouse-reference/03595_analyzer_lateral_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03595_analyzer_lateral_join.sql.expected.formatted.sql @@ -9,7 +9,7 @@ FROM ( SELECT 1 AS a ) AS t -CROSS JOIN ( +, ( SELECT 1 AS a QUALIFY 0 = ((t.a AS alias668)) ) AS u; -- { serverError NOT_IMPLEMENTED } @@ -21,7 +21,7 @@ FROM ( SELECT 1 AS a ) AS t -CROSS JOIN ( +, ( SELECT DISTINCT *, *, diff --git a/tests/clickhouse-reference/03610_disjunctions_pushdown_optimization.sql.expected.ast.json b/tests/clickhouse-reference/03610_disjunctions_pushdown_optimization.sql.expected.ast.json index 92470cb23..b09500ef2 100644 --- a/tests/clickhouse-reference/03610_disjunctions_pushdown_optimization.sql.expected.ast.json +++ b/tests/clickhouse-reference/03610_disjunctions_pushdown_optimization.sql.expected.ast.json @@ -1848,6 +1848,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -2088,6 +2089,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -2103,6 +2105,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", diff --git a/tests/clickhouse-reference/03610_disjunctions_pushdown_optimization.sql.expected.formatted.sql b/tests/clickhouse-reference/03610_disjunctions_pushdown_optimization.sql.expected.formatted.sql index 8b8d59a32..90ece7ed9 100644 --- a/tests/clickhouse-reference/03610_disjunctions_pushdown_optimization.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03610_disjunctions_pushdown_optimization.sql.expected.formatted.sql @@ -210,7 +210,7 @@ SELECT n2.number FROM numbers(6) AS n1 -CROSS JOIN numbers(6) AS n2 +, numbers(6) AS n2 WHERE ((n1.number = 1 AND n2.number = 2) OR (n1.number = 3 @@ -232,8 +232,8 @@ FROM ( n3.number FROM numbers(3) AS n2 - CROSS JOIN numbers(3) AS n3 - CROSS JOIN numbers(3) AS n1 + , numbers(3) AS n3 + , numbers(3) AS n1 WHERE ((n1.number = 1) AND ((n2.number + n3.number) = 3)) OR ((n1.number = 2) diff --git a/tests/clickhouse-reference/03611_pr_global_join.sql.expected.ast.json b/tests/clickhouse-reference/03611_pr_global_join.sql.expected.ast.json index d77f138e4..87c486085 100644 --- a/tests/clickhouse-reference/03611_pr_global_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/03611_pr_global_join.sql.expected.ast.json @@ -278,7 +278,8 @@ "type": "Bool", "value": "1" } - } + }, + "global": true }, "leadingComments": [ "-- this query was problematic, now GLOBAL JOINs has been disabled in n-way JOINs" @@ -309,7 +310,8 @@ "type": "Bool", "value": "1" } - } + }, + "global": true }, "leadingComments": [ "-- just check that simple GLOBAL JOIN works with parallel replicas" diff --git a/tests/clickhouse-reference/03611_pr_global_join.sql.expected.formatted.sql b/tests/clickhouse-reference/03611_pr_global_join.sql.expected.formatted.sql index 159bb573c..82c707935 100644 --- a/tests/clickhouse-reference/03611_pr_global_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03611_pr_global_join.sql.expected.formatted.sql @@ -42,14 +42,14 @@ FROM t2 INNER JOIN t2 AS tx ON true -RIGHT JOIN t1 +GLOBAL RIGHT JOIN t1 ON true; -- just check that simple GLOBAL JOIN works with parallel replicas SELECT * FROM t2 -RIGHT JOIN t1 +GLOBAL RIGHT JOIN t1 ON true; DROP TABLE t1; diff --git a/tests/clickhouse-reference/03623_convert_any_join_to_semi_or_anti_2.sql.expected.ast.json b/tests/clickhouse-reference/03623_convert_any_join_to_semi_or_anti_2.sql.expected.ast.json index 2984400a7..d43780f17 100644 --- a/tests/clickhouse-reference/03623_convert_any_join_to_semi_or_anti_2.sql.expected.ast.json +++ b/tests/clickhouse-reference/03623_convert_any_join_to_semi_or_anti_2.sql.expected.ast.json @@ -307,7 +307,8 @@ ] } } - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -418,7 +419,8 @@ ] } } - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", diff --git a/tests/clickhouse-reference/03623_convert_any_join_to_semi_or_anti_2.sql.expected.formatted.sql b/tests/clickhouse-reference/03623_convert_any_join_to_semi_or_anti_2.sql.expected.formatted.sql index a57441c98..ea8c77948 100644 --- a/tests/clickhouse-reference/03623_convert_any_join_to_semi_or_anti_2.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03623_convert_any_join_to_semi_or_anti_2.sql.expected.formatted.sql @@ -43,7 +43,7 @@ FROM * FROM users1 ) AS u1 -LEFT JOIN users2 AS u2 +ANY LEFT JOIN users2 AS u2 ON u1.uid = u2.uid WHERE 1 / u2.age > 1; @@ -56,6 +56,6 @@ FROM * FROM users1 ) AS u1 -LEFT JOIN users2 AS u2 +ANY LEFT JOIN users2 AS u2 ON u1.uid = u2.uid WHERE u2.age > 1; \ No newline at end of file diff --git a/tests/clickhouse-reference/03624_pr_lefl_right_joins_chain.sql.expected.ast.json b/tests/clickhouse-reference/03624_pr_lefl_right_joins_chain.sql.expected.ast.json index eb9bbc777..ef9161d9f 100644 --- a/tests/clickhouse-reference/03624_pr_lefl_right_joins_chain.sql.expected.ast.json +++ b/tests/clickhouse-reference/03624_pr_lefl_right_joins_chain.sql.expected.ast.json @@ -282,7 +282,8 @@ ] } } - } + }, + "strictness": "ANY" }, "kind": "joinExpr", "joinType": "RIGHT", @@ -309,7 +310,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -373,7 +375,8 @@ ] } } - } + }, + "strictness": "ANY" }, "kind": "joinExpr", "joinType": "RIGHT", @@ -400,7 +403,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { @@ -501,7 +505,8 @@ ] } } - } + }, + "strictness": "ANY" }, "kind": "joinExpr", "joinType": "RIGHT", @@ -528,7 +533,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/03624_pr_lefl_right_joins_chain.sql.expected.formatted.sql b/tests/clickhouse-reference/03624_pr_lefl_right_joins_chain.sql.expected.formatted.sql index bbba4bd88..373a89739 100644 --- a/tests/clickhouse-reference/03624_pr_lefl_right_joins_chain.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03624_pr_lefl_right_joins_chain.sql.expected.formatted.sql @@ -41,9 +41,9 @@ SELECT '-- no parallel replicas --'; SELECT * FROM tab -LEFT JOIN mem +ANY LEFT JOIN mem ON k1 = mem.k -RIGHT JOIN mem2 +ANY RIGHT JOIN mem2 ON k2 = mem2.k ORDER BY tab.v ASC SETTINGS enable_parallel_replicas = 0; @@ -51,9 +51,9 @@ SETTINGS enable_parallel_replicas = 0; SELECT * FROM tab -LEFT JOIN mem +ANY LEFT JOIN mem ON k1 = mem.k -RIGHT JOIN mem2 +ANY RIGHT JOIN mem2 ON k2 = mem2.k ORDER BY tab.v ASC SETTINGS @@ -68,9 +68,9 @@ FROM ( SELECT * FROM tab - LEFT JOIN mem + ANY LEFT JOIN mem ON k1 = mem.k - RIGHT JOIN mem2 + ANY RIGHT JOIN mem2 ON k2 = mem2.k ORDER BY tab.v ASC SETTINGS diff --git a/tests/clickhouse-reference/03630_hash_join_max_block_size.sql.expected.ast.json b/tests/clickhouse-reference/03630_hash_join_max_block_size.sql.expected.ast.json index 349e4692f..e9c96ef95 100644 --- a/tests/clickhouse-reference/03630_hash_join_max_block_size.sql.expected.ast.json +++ b/tests/clickhouse-reference/03630_hash_join_max_block_size.sql.expected.ast.json @@ -389,7 +389,8 @@ ] } } - } + }, + "strictness": "ANY" }, "kind": "joinExpr", "joinType": "LEFT", @@ -418,7 +419,8 @@ ] } } - } + }, + "strictness": "ANY" } } } diff --git a/tests/clickhouse-reference/03630_hash_join_max_block_size.sql.expected.formatted.sql b/tests/clickhouse-reference/03630_hash_join_max_block_size.sql.expected.formatted.sql index ac34f3664..98ec5e73c 100644 --- a/tests/clickhouse-reference/03630_hash_join_max_block_size.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03630_hash_join_max_block_size.sql.expected.formatted.sql @@ -58,8 +58,8 @@ FROM ( SELECT customers.customer_id AS dim_customers_id FROM b_orders AS orders - RIGHT JOIN b_customers AS customers + ANY RIGHT JOIN b_customers AS customers ON orders.order_id = customers.first_order_id - LEFT JOIN b_addresses AS shipping_addresses + ANY LEFT JOIN b_addresses AS shipping_addresses ON shipping_addresses.address_id = orders.address_id ); \ No newline at end of file diff --git a/tests/clickhouse-reference/03634_subcolumns_in_temporary_table_parallel_replicas.sql.expected.ast.json b/tests/clickhouse-reference/03634_subcolumns_in_temporary_table_parallel_replicas.sql.expected.ast.json index e64f7ac04..f8ac545fa 100644 --- a/tests/clickhouse-reference/03634_subcolumns_in_temporary_table_parallel_replicas.sql.expected.ast.json +++ b/tests/clickhouse-reference/03634_subcolumns_in_temporary_table_parallel_replicas.sql.expected.ast.json @@ -132,7 +132,8 @@ ] } } - } + }, + "global": true }, "settings": [ { diff --git a/tests/clickhouse-reference/03634_subcolumns_in_temporary_table_parallel_replicas.sql.expected.formatted.sql b/tests/clickhouse-reference/03634_subcolumns_in_temporary_table_parallel_replicas.sql.expected.formatted.sql index 2f47d7bea..69896f10f 100644 --- a/tests/clickhouse-reference/03634_subcolumns_in_temporary_table_parallel_replicas.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03634_subcolumns_in_temporary_table_parallel_replicas.sql.expected.formatted.sql @@ -14,7 +14,7 @@ INSERT INTO t0 (c0); SELECT tx.c0.`null` FROM t0 AS tx -RIGHT JOIN t0 AS ty +GLOBAL RIGHT JOIN t0 AS ty ON tx.c0 = ty.c0 SETTINGS allow_experimental_parallel_reading_from_replicas = 1, diff --git a/tests/clickhouse-reference/03644_join_order_mixed_comma_and_left.sql.expected.ast.json b/tests/clickhouse-reference/03644_join_order_mixed_comma_and_left.sql.expected.ast.json index bf3d47979..df2b767de 100644 --- a/tests/clickhouse-reference/03644_join_order_mixed_comma_and_left.sql.expected.ast.json +++ b/tests/clickhouse-reference/03644_join_order_mixed_comma_and_left.sql.expected.ast.json @@ -237,6 +237,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "n2" diff --git a/tests/clickhouse-reference/03644_join_order_mixed_comma_and_left.sql.expected.formatted.sql b/tests/clickhouse-reference/03644_join_order_mixed_comma_and_left.sql.expected.formatted.sql index d2bfbdbe5..9a871924c 100644 --- a/tests/clickhouse-reference/03644_join_order_mixed_comma_and_left.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03644_join_order_mixed_comma_and_left.sql.expected.formatted.sql @@ -39,7 +39,7 @@ FROM numbers(2); SELECT * FROM n1 -CROSS JOIN n2 +, n2 LEFT JOIN n3 ON n1.number = n3.number ORDER BY diff --git a/tests/clickhouse-reference/03657_hash_vs_full_sorting_merge_join.sql.expected.ast.json b/tests/clickhouse-reference/03657_hash_vs_full_sorting_merge_join.sql.expected.ast.json index fd0e37295..d9114d923 100644 --- a/tests/clickhouse-reference/03657_hash_vs_full_sorting_merge_join.sql.expected.ast.json +++ b/tests/clickhouse-reference/03657_hash_vs_full_sorting_merge_join.sql.expected.ast.json @@ -285,7 +285,8 @@ "columns": [ "key" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/03657_hash_vs_full_sorting_merge_join.sql.expected.formatted.sql b/tests/clickhouse-reference/03657_hash_vs_full_sorting_merge_join.sql.expected.formatted.sql index 610cb298f..542c798c7 100644 --- a/tests/clickhouse-reference/03657_hash_vs_full_sorting_merge_join.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03657_hash_vs_full_sorting_merge_join.sql.expected.formatted.sql @@ -54,7 +54,7 @@ SELECT length(t2.s) FROM t1 AS t1 -FULL JOIN tn2 AS t2 +ALL FULL JOIN tn2 AS t2 USING (key) ORDER BY key ASC, diff --git a/tests/clickhouse-reference/03667_pr_join_with_cross_join_on_left.sql.expected.ast.json b/tests/clickhouse-reference/03667_pr_join_with_cross_join_on_left.sql.expected.ast.json index 42950f8bc..e29eaef0e 100644 --- a/tests/clickhouse-reference/03667_pr_join_with_cross_join_on_left.sql.expected.ast.json +++ b/tests/clickhouse-reference/03667_pr_join_with_cross_join_on_left.sql.expected.ast.json @@ -294,6 +294,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "n2" diff --git a/tests/clickhouse-reference/03667_pr_join_with_cross_join_on_left.sql.expected.formatted.sql b/tests/clickhouse-reference/03667_pr_join_with_cross_join_on_left.sql.expected.formatted.sql index af1364dc3..6a5292cea 100644 --- a/tests/clickhouse-reference/03667_pr_join_with_cross_join_on_left.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03667_pr_join_with_cross_join_on_left.sql.expected.formatted.sql @@ -42,7 +42,7 @@ SET enable_parallel_replicas = 1, max_parallel_replicas = 3, cluster_for_paralle SELECT * FROM n1 -CROSS JOIN n2 +, n2 INNER JOIN n3 ON n1.number = n3.number ORDER BY diff --git a/tests/clickhouse-reference/03681_distributed_fractional_limit_offset.sql.expected.ast.json b/tests/clickhouse-reference/03681_distributed_fractional_limit_offset.sql.expected.ast.json index 3e986e29e..38dd191fc 100644 --- a/tests/clickhouse-reference/03681_distributed_fractional_limit_offset.sql.expected.ast.json +++ b/tests/clickhouse-reference/03681_distributed_fractional_limit_offset.sql.expected.ast.json @@ -460,7 +460,8 @@ "k" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ], "offset": { diff --git a/tests/clickhouse-reference/03681_distributed_fractional_limit_offset.sql.expected.formatted.sql b/tests/clickhouse-reference/03681_distributed_fractional_limit_offset.sql.expected.formatted.sql index 979a7eaf0..57b7376eb 100644 --- a/tests/clickhouse-reference/03681_distributed_fractional_limit_offset.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03681_distributed_fractional_limit_offset.sql.expected.formatted.sql @@ -55,7 +55,7 @@ SELECT __table1.k AS k FROM test__fuzz_2_dist AS __table1 PREWHERE _CAST(11, 'Nullable(UInt8)') -ORDER BY __table1.k DESC +ORDER BY __table1.k DESC NULLS LAST LIMIT 0.9999, _CAST(100, 'UInt64'); SET extremes = 0; diff --git a/tests/clickhouse-reference/03708_analyzer_convert_any_outer_to_inner_2.sql.expected.ast.json b/tests/clickhouse-reference/03708_analyzer_convert_any_outer_to_inner_2.sql.expected.ast.json index 6574765e9..50ba99bed 100644 --- a/tests/clickhouse-reference/03708_analyzer_convert_any_outer_to_inner_2.sql.expected.ast.json +++ b/tests/clickhouse-reference/03708_analyzer_convert_any_outer_to_inner_2.sql.expected.ast.json @@ -218,7 +218,8 @@ ] } } - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -334,7 +335,8 @@ ] } } - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -460,7 +462,8 @@ ] } } - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -600,7 +603,8 @@ ] } } - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -742,7 +746,8 @@ ] } } - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", diff --git a/tests/clickhouse-reference/03708_analyzer_convert_any_outer_to_inner_2.sql.expected.formatted.sql b/tests/clickhouse-reference/03708_analyzer_convert_any_outer_to_inner_2.sql.expected.formatted.sql index 77bf657c9..c3fd10cb8 100644 --- a/tests/clickhouse-reference/03708_analyzer_convert_any_outer_to_inner_2.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03708_analyzer_convert_any_outer_to_inner_2.sql.expected.formatted.sql @@ -22,7 +22,7 @@ EXPLAIN actions = 1, keep_logical_steps = 1 SELECT * FROM users AS u1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT sum(age)::Nullable(Int64) AS age_sum, name @@ -36,7 +36,7 @@ SETTINGS enable_join_runtime_filters = 0; SELECT * FROM users AS u1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT sum(age)::Nullable(Int64) AS age_sum, name @@ -51,7 +51,7 @@ EXPLAIN actions = 1, keep_logical_steps = 1 SELECT * FROM users AS u1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT sum(age)::Nullable(Int64) AS age_sum, name @@ -68,7 +68,7 @@ EXPLAIN actions = 1, keep_logical_steps = 1 SELECT * FROM users AS u1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT sum(age)::Nullable(Int64) AS age_sum, name @@ -85,7 +85,7 @@ EXPLAIN actions = 1, keep_logical_steps = 1 SELECT * FROM users AS u1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT sum(age)::Nullable(Int64) AS age_sum, name diff --git a/tests/clickhouse-reference/03709_anti_join_runtime_filters.sql.expected.ast.json b/tests/clickhouse-reference/03709_anti_join_runtime_filters.sql.expected.ast.json index 09da4db7c..1e4f0ed6b 100644 --- a/tests/clickhouse-reference/03709_anti_join_runtime_filters.sql.expected.ast.json +++ b/tests/clickhouse-reference/03709_anti_join_runtime_filters.sql.expected.ast.json @@ -274,7 +274,8 @@ ] } } - } + }, + "strictness": "ANTI" } } } @@ -399,7 +400,8 @@ ] } } - } + }, + "strictness": "ANTI" }, "settings": [ { @@ -450,7 +452,8 @@ ] } } - } + }, + "strictness": "ANTI" }, "settings": [ { @@ -547,7 +550,8 @@ ] } } - } + }, + "strictness": "ANTI" } } } diff --git a/tests/clickhouse-reference/03709_anti_join_runtime_filters.sql.expected.formatted.sql b/tests/clickhouse-reference/03709_anti_join_runtime_filters.sql.expected.formatted.sql index 3f724b771..fa539aa2c 100644 --- a/tests/clickhouse-reference/03709_anti_join_runtime_filters.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03709_anti_join_runtime_filters.sql.expected.formatted.sql @@ -36,7 +36,7 @@ FROM ( SELECT count() FROM customer - LEFT JOIN nation + ANTI LEFT JOIN nation ON c_nationkey = n_nationkey ) WHERE (ilike(`explain`, '%Filter column%')) @@ -47,14 +47,14 @@ WHERE (ilike(`explain`, '%Filter column%')) SELECT count() FROM customer -LEFT JOIN nation +ANTI LEFT JOIN nation ON c_nationkey = n_nationkey SETTINGS enable_join_runtime_filters = 0; SELECT count() FROM customer -LEFT JOIN nation +ANTI LEFT JOIN nation ON c_nationkey = n_nationkey SETTINGS enable_join_runtime_filters = 1; @@ -65,7 +65,7 @@ FROM ( SELECT count() FROM customer - RIGHT JOIN nation + ANTI RIGHT JOIN nation ON c_nationkey = n_nationkey ) WHERE (ilike(`explain`, '%Filter column%')) diff --git a/tests/clickhouse-reference/03709_tuple_inside_nullable_basic.sql.expected.ast.json b/tests/clickhouse-reference/03709_tuple_inside_nullable_basic.sql.expected.ast.json index 1b09dc643..236fcac73 100644 --- a/tests/clickhouse-reference/03709_tuple_inside_nullable_basic.sql.expected.ast.json +++ b/tests/clickhouse-reference/03709_tuple_inside_nullable_basic.sql.expected.ast.json @@ -945,7 +945,8 @@ "tup" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -988,7 +989,8 @@ "tup" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -1123,7 +1125,8 @@ "u" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true }, { "kind": "orderByItem", @@ -1168,7 +1171,8 @@ "u" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -1213,7 +1217,8 @@ "s" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -1265,7 +1270,8 @@ "u" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -1325,7 +1331,8 @@ "n" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -1383,7 +1390,8 @@ "tup" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -1449,7 +1457,8 @@ "u" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -1499,7 +1508,8 @@ "s" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -1563,7 +1573,8 @@ "u" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -1777,7 +1788,8 @@ "u" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -1849,7 +1861,8 @@ "u" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -2630,7 +2643,8 @@ "id" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ], "settings": [ @@ -2770,7 +2784,8 @@ "tup" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -2802,7 +2817,8 @@ "u" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -2841,7 +2857,8 @@ "u" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -2943,7 +2960,8 @@ "tup" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -3014,7 +3032,8 @@ "value" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -3901,7 +3920,8 @@ "id" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] } @@ -3969,7 +3989,8 @@ "u" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] } @@ -3993,7 +4014,8 @@ "u" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] } @@ -4087,7 +4109,8 @@ "id" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] } @@ -4340,6 +4363,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "tuple_test", diff --git a/tests/clickhouse-reference/03709_tuple_inside_nullable_basic.sql.expected.formatted.sql b/tests/clickhouse-reference/03709_tuple_inside_nullable_basic.sql.expected.formatted.sql index 3c1252433..41692ee03 100644 --- a/tests/clickhouse-reference/03709_tuple_inside_nullable_basic.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03709_tuple_inside_nullable_basic.sql.expected.formatted.sql @@ -126,7 +126,7 @@ SELECT tup FROM tuple_test ORDER BY - tup ASC, + tup ASC NULLS FIRST, id ASC; SELECT @@ -134,7 +134,7 @@ SELECT tup FROM tuple_test ORDER BY - tup ASC, + tup ASC NULLS LAST, id ASC; SELECT @@ -158,7 +158,7 @@ SELECT tup.u FROM tuple_test ORDER BY - tup.u ASC, + tup.u ASC NULLS FIRST, id ASC; SELECT @@ -166,7 +166,7 @@ SELECT tup.u FROM tuple_test ORDER BY - tup.u ASC, + tup.u ASC NULLS LAST, id ASC; SELECT @@ -174,7 +174,7 @@ SELECT tup.s FROM tuple_test ORDER BY - tup.s ASC, + tup.s ASC NULLS LAST, id ASC; SELECT @@ -183,7 +183,7 @@ SELECT tup.s FROM tuple_test ORDER BY - tup.u ASC, + tup.u ASC NULLS LAST, tup.s ASC, id ASC; @@ -193,7 +193,7 @@ SELECT n FROM tuple_test ORDER BY - n ASC, + n ASC NULLS LAST, tup.u ASC; SELECT @@ -201,7 +201,7 @@ SELECT count() AS cnt FROM tuple_test GROUP BY tup -ORDER BY tup ASC; +ORDER BY tup ASC NULLS LAST; SELECT tup.u, @@ -209,14 +209,14 @@ SELECT sum(n) AS sum_n FROM tuple_test GROUP BY tup.u -ORDER BY tup.u ASC; +ORDER BY tup.u ASC NULLS LAST; SELECT tup.s, count() AS cnt FROM tuple_test GROUP BY tup.s -ORDER BY tup.s ASC; +ORDER BY tup.s ASC NULLS LAST; SELECT tup.u, @@ -227,7 +227,7 @@ GROUP BY tup.u, tup.s ORDER BY - tup.u ASC, + tup.u ASC NULLS LAST, tup.s ASC; SELECT @@ -250,7 +250,7 @@ SELECT FROM tuple_test GROUP BY tup.u HAVING cnt > 1 -ORDER BY tup.u ASC; +ORDER BY tup.u ASC NULLS LAST; SELECT tup.u, @@ -258,7 +258,7 @@ SELECT FROM tuple_test GROUP BY tup.u HAVING sum_n > 400 -ORDER BY tup.u ASC; +ORDER BY tup.u ASC NULLS LAST; SELECT tup.u, @@ -344,7 +344,7 @@ LEFT JOIN tuple_test AS t2 AND t1.id != t2.id ORDER BY t1.id ASC, - t2.id ASC + t2.id ASC NULLS LAST SETTINGS enable_analyzer = 1; -- t1.tup.u notation is not recognized in old analyzer SELECT @@ -361,18 +361,18 @@ ORDER BY SELECT DISTINCT tup FROM tuple_test -ORDER BY tup ASC; +ORDER BY tup ASC NULLS LAST; SELECT DISTINCT tup.u FROM tuple_test -ORDER BY tup.u ASC; +ORDER BY tup.u ASC NULLS LAST; SELECT DISTINCT tup.u, tup.s FROM tuple_test ORDER BY - tup.u ASC, + tup.u ASC NULLS LAST, tup.s ASC; SELECT tup @@ -385,7 +385,7 @@ FROM ( FROM tuple_test WHERE id >= 3 ) -ORDER BY tup ASC; +ORDER BY tup ASC NULLS LAST; SELECT value FROM ( @@ -395,7 +395,7 @@ FROM ( SELECT n AS value FROM tuple_test ) -ORDER BY value ASC; +ORDER BY value ASC NULLS LAST; SELECT tup.u FROM tuple_test @@ -489,7 +489,7 @@ ORDER BY id ASC; SELECT id, tup.u, - row_number() OVER (ORDER BY tup.u ASC, id ASC) AS rn + row_number() OVER (ORDER BY tup.u ASC, id ASC NULLS LAST) AS rn FROM tuple_test ORDER BY rn ASC, @@ -498,8 +498,8 @@ ORDER BY SELECT id, tup.u, - rank() OVER (ORDER BY tup.u ASC) AS rnk, - dense_rank() OVER (ORDER BY tup.u ASC) AS dense_rnk + rank() OVER (ORDER BY tup.u ASC NULLS LAST) AS rnk, + dense_rank() OVER (ORDER BY tup.u ASC NULLS LAST) AS dense_rnk FROM tuple_test ORDER BY id ASC; @@ -507,7 +507,7 @@ SELECT id, tup.u, isNull(tup), - row_number() OVER (PARTITION BY isNull(tup) ORDER BY tup.u ASC, id ASC) AS rn_in_partition + row_number() OVER (PARTITION BY isNull(tup) ORDER BY tup.u ASC, id ASC NULLS LAST) AS rn_in_partition FROM tuple_test ORDER BY isNull(tup) ASC, @@ -529,7 +529,7 @@ SELECT t1.tup != t2.tup AS is_not_equal FROM tuple_test AS t1 -CROSS JOIN tuple_test AS t2 +, tuple_test AS t2 WHERE t1.id = 1 AND t2.id IN (1, 2, 3) ORDER BY diff --git a/tests/clickhouse-reference/03710_array_join_in_map_bug.sql.expected.ast.json b/tests/clickhouse-reference/03710_array_join_in_map_bug.sql.expected.ast.json index eff42e0f0..3dfb926ea 100644 --- a/tests/clickhouse-reference/03710_array_join_in_map_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/03710_array_join_in_map_bug.sql.expected.ast.json @@ -187,7 +187,8 @@ "columns": [ "dummy" ] - } + }, + "strictness": "ALL" }, "kind": "arrayJoinExpr", "joinType": "LEFT ARRAY", diff --git a/tests/clickhouse-reference/03710_array_join_in_map_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/03710_array_join_in_map_bug.sql.expected.formatted.sql index 83cf65577..761a28d1a 100644 --- a/tests/clickhouse-reference/03710_array_join_in_map_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03710_array_join_in_map_bug.sql.expected.formatted.sql @@ -6,7 +6,7 @@ SELECT DISTINCT __table4.`isNotDistinctFrom(3, isZeroOrNull(isNotNull(3)))` AS `isNotDistinctFrom(3, isZeroOrNull(isNotNull(3)))` FROM `system`.one AS __table3 -FULL JOIN ( +ALL FULL JOIN ( SELECT DISTINCT __table5.dummy AS dummy, __table5.`isNotNull(map(assumeNotNull(isNull(3)), NULL))` AS `isNotNull(map(assumeNotNull(isNull(3)), NULL))`, diff --git a/tests/clickhouse-reference/03710_tuple_inside_nullable_function_tuple_element.sql.expected.ast.json b/tests/clickhouse-reference/03710_tuple_inside_nullable_function_tuple_element.sql.expected.ast.json index 0cdd0130e..e4cc5fa75 100644 --- a/tests/clickhouse-reference/03710_tuple_inside_nullable_function_tuple_element.sql.expected.ast.json +++ b/tests/clickhouse-reference/03710_tuple_inside_nullable_function_tuple_element.sql.expected.ast.json @@ -4522,7 +4522,8 @@ "value" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -4555,7 +4556,8 @@ "value" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] } @@ -4800,7 +4802,8 @@ "value" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, @@ -4966,7 +4969,8 @@ } ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", diff --git a/tests/clickhouse-reference/03710_tuple_inside_nullable_function_tuple_element.sql.expected.formatted.sql b/tests/clickhouse-reference/03710_tuple_inside_nullable_function_tuple_element.sql.expected.formatted.sql index 5836b641c..a22bbfa96 100644 --- a/tests/clickhouse-reference/03710_tuple_inside_nullable_function_tuple_element.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03710_tuple_inside_nullable_function_tuple_element.sql.expected.formatted.sql @@ -324,8 +324,8 @@ ORDER BY id ASC; SELECT id, value, - row_number() OVER (ORDER BY value ASC, id ASC) AS rank, - dense_rank() OVER (ORDER BY value ASC) AS dense_rank + row_number() OVER (ORDER BY value ASC NULLS LAST, id ASC) AS rank, + dense_rank() OVER (ORDER BY value ASC NULLS LAST) AS dense_rank FROM ( SELECT id, @@ -349,7 +349,7 @@ FROM ( FROM test_nullable_tuples WHERE id >= 4 ) -ORDER BY value ASC; +ORDER BY value ASC NULLS LAST; SELECT id, @@ -364,5 +364,5 @@ SELECT data.2 AS name FROM test_nullable_tuples ORDER BY - data.1 ASC, + data.1 ASC NULLS LAST, id ASC; \ No newline at end of file diff --git a/tests/clickhouse-reference/03732_join_on_exists_bug.sql.expected.ast.json b/tests/clickhouse-reference/03732_join_on_exists_bug.sql.expected.ast.json index 51d1e6771..a1e776d00 100644 --- a/tests/clickhouse-reference/03732_join_on_exists_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/03732_join_on_exists_bug.sql.expected.ast.json @@ -80,7 +80,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "kind": "joinExpr", "joinType": "INNER", @@ -158,7 +159,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "kind": "joinExpr", "joinType": "INNER", @@ -246,7 +248,8 @@ } ] } - } + }, + "strictness": "ASOF" }, "kind": "joinExpr", "joinType": "INNER", diff --git a/tests/clickhouse-reference/03732_join_on_exists_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/03732_join_on_exists_bug.sql.expected.formatted.sql index 4707a632c..8136d27a6 100644 --- a/tests/clickhouse-reference/03732_join_on_exists_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03732_join_on_exists_bug.sql.expected.formatted.sql @@ -11,7 +11,7 @@ INSERT INTO t0; SELECT 1 FROM t0 -INNER JOIN t0 AS tx +ASOF INNER JOIN t0 AS tx ON EXISTS(( SELECT 1 )) @@ -21,7 +21,7 @@ INNER JOIN t0 AS ty SELECT 1 FROM t0 -INNER JOIN t0 AS tx +ASOF INNER JOIN t0 AS tx ON EXISTS(( SELECT 1 )) @@ -32,7 +32,7 @@ SETTINGS allow_general_join_planning = 0; -- { serverError INVALID_JOIN_ON_EXPRE SELECT 1 FROM t0 -INNER JOIN t0 AS tx +ASOF INNER JOIN t0 AS tx ON EXISTS(( SELECT 1 )) diff --git a/tests/clickhouse-reference/03733_anti_join_runtime_filter_3.sql.expected.ast.json b/tests/clickhouse-reference/03733_anti_join_runtime_filter_3.sql.expected.ast.json index ccc3bf2ab..32c699f1b 100644 --- a/tests/clickhouse-reference/03733_anti_join_runtime_filter_3.sql.expected.ast.json +++ b/tests/clickhouse-reference/03733_anti_join_runtime_filter_3.sql.expected.ast.json @@ -387,7 +387,8 @@ ] } } - } + }, + "strictness": "ANTI" }, "leadingComments": [ "-- 1 element in filter" @@ -462,7 +463,8 @@ ] } } - } + }, + "strictness": "ANTI" } }, { @@ -534,7 +536,8 @@ ] } } - } + }, + "strictness": "ANTI" }, "leadingComments": [ "-- 0 elements in filter ('WAKANDA' is not present in `nations` table)" @@ -609,7 +612,8 @@ ] } } - } + }, + "strictness": "ANTI" } }, { @@ -688,7 +692,8 @@ ] } } - } + }, + "strictness": "ANTI" }, "leadingComments": [ "-- again 1 element in filter" @@ -770,7 +775,8 @@ ] } } - } + }, + "strictness": "ANTI" } }, { @@ -849,7 +855,8 @@ ] } } - } + }, + "strictness": "ANTI" }, "leadingComments": [ "-- 2 elements in filter" @@ -931,7 +938,8 @@ ] } } - } + }, + "strictness": "ANTI" } }, { diff --git a/tests/clickhouse-reference/03733_anti_join_runtime_filter_3.sql.expected.formatted.sql b/tests/clickhouse-reference/03733_anti_join_runtime_filter_3.sql.expected.formatted.sql index ec29dcaec..600019358 100644 --- a/tests/clickhouse-reference/03733_anti_join_runtime_filter_3.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03733_anti_join_runtime_filter_3.sql.expected.formatted.sql @@ -53,7 +53,7 @@ SET query_plan_join_swap_table = 0; SELECT count() FROM customer -LEFT JOIN ( +ANTI LEFT JOIN ( SELECT n_nationkey FROM nation WHERE n_name = 'FRANCE' @@ -67,14 +67,14 @@ FROM FROM nation WHERE n_name = 'FRANCE' ) AS n -RIGHT JOIN customer +ANTI RIGHT JOIN customer ON c_nationkey = n.n_nationkey; -- 0 elements in filter ('WAKANDA' is not present in `nations` table) SELECT count() FROM customer -LEFT JOIN ( +ANTI LEFT JOIN ( SELECT n_nationkey FROM nation WHERE n_name = 'WAKANDA' @@ -88,14 +88,14 @@ FROM FROM nation WHERE n_name = 'WAKANDA' ) AS n -RIGHT JOIN customer +ANTI RIGHT JOIN customer ON c_nationkey = n.n_nationkey; -- again 1 element in filter SELECT count() FROM customer -LEFT JOIN ( +ANTI LEFT JOIN ( SELECT n_nationkey FROM nation WHERE n_name IN ('WAKANDA', 'GERMANY') @@ -109,14 +109,14 @@ FROM FROM nation WHERE n_name IN ('WAKANDA', 'GERMANY') ) AS n -RIGHT JOIN customer +ANTI RIGHT JOIN customer ON c_nationkey = n.n_nationkey; -- 2 elements in filter SELECT count() FROM customer -LEFT JOIN ( +ANTI LEFT JOIN ( SELECT n_nationkey FROM nation WHERE n_name IN ('FRANCE', 'GERMANY') @@ -130,7 +130,7 @@ FROM FROM nation WHERE n_name IN ('FRANCE', 'GERMANY') ) AS n -RIGHT JOIN customer +ANTI RIGHT JOIN customer ON c_nationkey = n.n_nationkey; -- 2 elements in filter store in a bloom filter diff --git a/tests/clickhouse-reference/03733_join_order_dp.sql.expected.ast.json b/tests/clickhouse-reference/03733_join_order_dp.sql.expected.ast.json index 5ca1f63a2..eb31f8bb0 100644 --- a/tests/clickhouse-reference/03733_join_order_dp.sql.expected.ast.json +++ b/tests/clickhouse-reference/03733_join_order_dp.sql.expected.ast.json @@ -631,6 +631,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "R2", @@ -639,6 +640,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "R3", @@ -647,6 +649,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "R4", @@ -819,6 +822,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "R2", @@ -827,6 +831,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "R3", @@ -835,6 +840,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "R4", @@ -988,6 +994,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "R2", @@ -996,6 +1003,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "R3", @@ -1004,6 +1012,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "R4", @@ -1176,6 +1185,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "R2", @@ -1184,6 +1194,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "R3", @@ -1192,6 +1203,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "R4", diff --git a/tests/clickhouse-reference/03733_join_order_dp.sql.expected.formatted.sql b/tests/clickhouse-reference/03733_join_order_dp.sql.expected.formatted.sql index dbe98ee8b..5c5f3a18d 100644 --- a/tests/clickhouse-reference/03733_join_order_dp.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03733_join_order_dp.sql.expected.formatted.sql @@ -81,9 +81,9 @@ SELECT T4.D_LookupCode FROM R1 AS T1 -CROSS JOIN R2 AS T2 -CROSS JOIN R3 AS T3 -CROSS JOIN R4 AS T4 +, R2 AS T2 +, R3 AS T3 +, R4 AS T4 WHERE T1.A_ID = T2.R1_A_ID AND T1.A_ID = T3.R1_A_ID AND T3.R4_D_ID = T4.D_ID @@ -96,9 +96,9 @@ SETTINGS SELECT sum(sipHash64(T1.A_Description, T2.B_Data, T3.C_Value, T4.D_LookupCode)) FROM R1 AS T1 -CROSS JOIN R2 AS T2 -CROSS JOIN R3 AS T3 -CROSS JOIN R4 AS T4 +, R2 AS T2 +, R3 AS T3 +, R4 AS T4 WHERE T1.A_ID = T2.R1_A_ID AND T1.A_ID = T3.R1_A_ID AND T3.R4_D_ID = T4.D_ID @@ -114,9 +114,9 @@ SELECT T4.D_LookupCode FROM R1 AS T1 -CROSS JOIN R2 AS T2 -CROSS JOIN R3 AS T3 -CROSS JOIN R4 AS T4 +, R2 AS T2 +, R3 AS T3 +, R4 AS T4 WHERE T1.A_ID = T2.R1_A_ID AND T1.A_ID = T3.R1_A_ID AND T3.R4_D_ID = T4.D_ID @@ -129,9 +129,9 @@ SETTINGS SELECT sum(sipHash64(T1.A_Description, T2.B_Data, T3.C_Value, T4.D_LookupCode)) FROM R1 AS T1 -CROSS JOIN R2 AS T2 -CROSS JOIN R3 AS T3 -CROSS JOIN R4 AS T4 +, R2 AS T2 +, R3 AS T3 +, R4 AS T4 WHERE T1.A_ID = T2.R1_A_ID AND T1.A_ID = T3.R1_A_ID AND T3.R4_D_ID = T4.D_ID diff --git a/tests/clickhouse-reference/03734_correlated_subqueries_reorder.sql.expected.ast.json b/tests/clickhouse-reference/03734_correlated_subqueries_reorder.sql.expected.ast.json index 0fc2c404e..cdc44e2d5 100644 --- a/tests/clickhouse-reference/03734_correlated_subqueries_reorder.sql.expected.ast.json +++ b/tests/clickhouse-reference/03734_correlated_subqueries_reorder.sql.expected.ast.json @@ -430,6 +430,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "part" @@ -610,6 +611,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "part" diff --git a/tests/clickhouse-reference/03734_correlated_subqueries_reorder.sql.expected.formatted.sql b/tests/clickhouse-reference/03734_correlated_subqueries_reorder.sql.expected.formatted.sql index 61d859ae3..ee9d1b752 100644 --- a/tests/clickhouse-reference/03734_correlated_subqueries_reorder.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03734_correlated_subqueries_reorder.sql.expected.formatted.sql @@ -47,7 +47,7 @@ EXPLAIN actions = 1, keep_logical_steps = 1 SELECT sum(l_extendedprice) / 7.0 AS avg_yearly FROM lineitem -CROSS JOIN part +, part WHERE p_partkey = l_partkey AND l_quantity < ( SELECT 0.2 * avg(l_quantity) @@ -66,7 +66,7 @@ FROM ( l_extendedprice FROM lineitem - CROSS JOIN part + , part WHERE p_partkey = l_partkey ) AS lp WHERE l_quantity < ( diff --git a/tests/clickhouse-reference/03736_table_stats_hint.sql.expected.ast.json b/tests/clickhouse-reference/03736_table_stats_hint.sql.expected.ast.json index b1d655ad4..4746d9ffa 100644 --- a/tests/clickhouse-reference/03736_table_stats_hint.sql.expected.ast.json +++ b/tests/clickhouse-reference/03736_table_stats_hint.sql.expected.ast.json @@ -342,6 +342,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "part" diff --git a/tests/clickhouse-reference/03736_table_stats_hint.sql.expected.formatted.sql b/tests/clickhouse-reference/03736_table_stats_hint.sql.expected.formatted.sql index 6e64c5c63..67c595e7b 100644 --- a/tests/clickhouse-reference/03736_table_stats_hint.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03736_table_stats_hint.sql.expected.formatted.sql @@ -46,7 +46,7 @@ FROM ( SELECT count() FROM partsupp - CROSS JOIN part + , part WHERE ps_partkey = p_partkey AND ps_availqty >= 10 ) diff --git a/tests/clickhouse-reference/03742_nested_loop_join_long.sql.expected.ast.json b/tests/clickhouse-reference/03742_nested_loop_join_long.sql.expected.ast.json index 1e86054c7..b432e3290 100644 --- a/tests/clickhouse-reference/03742_nested_loop_join_long.sql.expected.ast.json +++ b/tests/clickhouse-reference/03742_nested_loop_join_long.sql.expected.ast.json @@ -1178,7 +1178,8 @@ "Id" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -1319,7 +1320,8 @@ "Id" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -1436,7 +1438,8 @@ ] } } - } + }, + "strictness": "SEMI" }, "groupBy": { "kind": "expressions", @@ -1460,7 +1463,8 @@ "Id" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -1577,7 +1581,8 @@ ] } } - } + }, + "strictness": "ANTI" }, "groupBy": { "kind": "expressions", @@ -1601,7 +1606,8 @@ "Id" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -1760,7 +1766,8 @@ ] } } - } + }, + "strictness": "SEMI" } }, { @@ -1839,7 +1846,8 @@ ] } } - } + }, + "strictness": "ANTI" } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/03742_nested_loop_join_long.sql.expected.formatted.sql b/tests/clickhouse-reference/03742_nested_loop_join_long.sql.expected.formatted.sql index 1088bb15c..f63ab97bb 100644 --- a/tests/clickhouse-reference/03742_nested_loop_join_long.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03742_nested_loop_join_long.sql.expected.formatted.sql @@ -121,7 +121,7 @@ FROM INNER JOIN attributes AS t1 ON t0.Id = t1.EventId GROUP BY t0.Id -ORDER BY t0.Id ASC; +ORDER BY t0.Id ASC NULLS FIRST; SELECT t0.Id, @@ -134,7 +134,7 @@ FROM LEFT JOIN attributes AS t1 ON t0.Id = t1.EventId GROUP BY t0.Id -ORDER BY t0.Id ASC; +ORDER BY t0.Id ASC NULLS FIRST; SELECT t0.Id, @@ -144,10 +144,10 @@ SELECT sum(sipHash64(t1.Attribute)) AS attr_hash_sum FROM events AS t0 -LEFT JOIN attributes AS t1 +SEMI LEFT JOIN attributes AS t1 ON t0.Id = t1.EventId GROUP BY t0.Id -ORDER BY t0.Id ASC; +ORDER BY t0.Id ASC NULLS FIRST; SELECT t0.Id, @@ -157,10 +157,10 @@ SELECT sum(sipHash64(t1.Attribute)) AS attr_hash_sum FROM events AS t0 -LEFT JOIN attributes AS t1 +ANTI LEFT JOIN attributes AS t1 ON t0.Id = t1.EventId GROUP BY t0.Id -ORDER BY t0.Id ASC; +ORDER BY t0.Id ASC NULLS FIRST; SELECT sum(sipHash64(t0.Id, t0.Payload)) AS hash_sum, @@ -175,7 +175,7 @@ SELECT count() AS cnt FROM events2 AS t0 -LEFT JOIN attributes2 AS t1 +SEMI LEFT JOIN attributes2 AS t1 ON t1.EventId = t0.Id; SELECT @@ -183,5 +183,5 @@ SELECT count() AS cnt FROM events2 AS t0 -LEFT JOIN attributes2 AS t1 +ANTI LEFT JOIN attributes2 AS t1 ON t1.EventId = t0.Id; \ No newline at end of file diff --git a/tests/clickhouse-reference/03749_cross_join_use_nulls_matcher.sql.expected.ast.json b/tests/clickhouse-reference/03749_cross_join_use_nulls_matcher.sql.expected.ast.json index a48bd8d5a..45d0eaa8c 100644 --- a/tests/clickhouse-reference/03749_cross_join_use_nulls_matcher.sql.expected.ast.json +++ b/tests/clickhouse-reference/03749_cross_join_use_nulls_matcher.sql.expected.ast.json @@ -45,6 +45,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", diff --git a/tests/clickhouse-reference/03749_cross_join_use_nulls_matcher.sql.expected.formatted.sql b/tests/clickhouse-reference/03749_cross_join_use_nulls_matcher.sql.expected.formatted.sql index fa3e40772..12e2c04e0 100644 --- a/tests/clickhouse-reference/03749_cross_join_use_nulls_matcher.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03749_cross_join_use_nulls_matcher.sql.expected.formatted.sql @@ -3,7 +3,7 @@ SET enable_analyzer = 1; SELECT concat(*) AS x FROM numbers(2) AS n1 -CROSS JOIN numbers(3) AS n2 +, numbers(3) AS n2 RIGHT JOIN numbers(4) AS n3 ON n2.number = n3.number ORDER BY x ASC diff --git a/tests/clickhouse-reference/03751_join_empty_string_nullable.sql.expected.ast.json b/tests/clickhouse-reference/03751_join_empty_string_nullable.sql.expected.ast.json index f1514441a..e20a32ff1 100644 --- a/tests/clickhouse-reference/03751_join_empty_string_nullable.sql.expected.ast.json +++ b/tests/clickhouse-reference/03751_join_empty_string_nullable.sql.expected.ast.json @@ -226,7 +226,8 @@ "c0" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false } ] }, diff --git a/tests/clickhouse-reference/03751_join_empty_string_nullable.sql.expected.formatted.sql b/tests/clickhouse-reference/03751_join_empty_string_nullable.sql.expected.formatted.sql index 73a2c8d25..37dbbca13 100644 --- a/tests/clickhouse-reference/03751_join_empty_string_nullable.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03751_join_empty_string_nullable.sql.expected.formatted.sql @@ -31,7 +31,7 @@ SELECT c0, isNull(c0) AS is_null FROM t_join_nullable_string -ORDER BY c0 ASC; +ORDER BY c0 ASC NULLS LAST; -- Case 3: ANY strictness CREATE TABLE t_join_nullable_string diff --git a/tests/clickhouse-reference/03753_anti_join_runtime_filter_4.sql.expected.ast.json b/tests/clickhouse-reference/03753_anti_join_runtime_filter_4.sql.expected.ast.json index eeb867ecb..b76e91a09 100644 --- a/tests/clickhouse-reference/03753_anti_join_runtime_filter_4.sql.expected.ast.json +++ b/tests/clickhouse-reference/03753_anti_join_runtime_filter_4.sql.expected.ast.json @@ -368,7 +368,8 @@ } ] } - } + }, + "strictness": "ANTI" }, "settings": [ { @@ -450,7 +451,8 @@ ] } } - } + }, + "strictness": "ANTI" }, "settings": [ { @@ -522,7 +524,8 @@ } ] } - } + }, + "strictness": "ANTI" }, "settings": [ { @@ -601,7 +604,8 @@ ] } } - } + }, + "strictness": "ANTI" }, "settings": [ { diff --git a/tests/clickhouse-reference/03753_anti_join_runtime_filter_4.sql.expected.formatted.sql b/tests/clickhouse-reference/03753_anti_join_runtime_filter_4.sql.expected.formatted.sql index 594019821..dfff5e88d 100644 --- a/tests/clickhouse-reference/03753_anti_join_runtime_filter_4.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03753_anti_join_runtime_filter_4.sql.expected.formatted.sql @@ -53,7 +53,7 @@ SET join_algorithm = 'hash,parallel_hash'; SELECT count() FROM customer -LEFT JOIN nation +ANTI LEFT JOIN nation ON c_nationkey = n_nationkey AND n_name = 'FRANCE' SETTINGS enable_join_runtime_filters = 0; @@ -61,7 +61,7 @@ SETTINGS enable_join_runtime_filters = 0; SELECT count() FROM customer -LEFT JOIN ( +ANTI LEFT JOIN ( SELECT * FROM nation WHERE n_name = 'FRANCE' @@ -72,7 +72,7 @@ SETTINGS enable_join_runtime_filters = 0; SELECT count() FROM customer -LEFT JOIN nation +ANTI LEFT JOIN nation ON c_nationkey = n_nationkey AND n_name = 'FRANCE' SETTINGS enable_join_runtime_filters = 1; @@ -80,7 +80,7 @@ SETTINGS enable_join_runtime_filters = 1; SELECT count() FROM customer -LEFT JOIN ( +ANTI LEFT JOIN ( SELECT * FROM nation WHERE n_name = 'FRANCE' diff --git a/tests/clickhouse-reference/03753_join_runtime_filter_dynamically_disable.sql.expected.ast.json b/tests/clickhouse-reference/03753_join_runtime_filter_dynamically_disable.sql.expected.ast.json index 209aa03fa..792cf1691 100644 --- a/tests/clickhouse-reference/03753_join_runtime_filter_dynamically_disable.sql.expected.ast.json +++ b/tests/clickhouse-reference/03753_join_runtime_filter_dynamically_disable.sql.expected.ast.json @@ -394,6 +394,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation" @@ -705,6 +706,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation" @@ -1023,6 +1025,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation" @@ -1351,6 +1354,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -1730,7 +1734,8 @@ ] } } - } + }, + "strictness": "ANTI" }, "settings": [ { @@ -2071,7 +2076,8 @@ ] } } - } + }, + "strictness": "ANTI" }, "settings": [ { @@ -2320,6 +2326,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "nation" diff --git a/tests/clickhouse-reference/03753_join_runtime_filter_dynamically_disable.sql.expected.formatted.sql b/tests/clickhouse-reference/03753_join_runtime_filter_dynamically_disable.sql.expected.formatted.sql index 4fc14c728..6b95e422b 100644 --- a/tests/clickhouse-reference/03753_join_runtime_filter_dynamically_disable.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03753_join_runtime_filter_dynamically_disable.sql.expected.formatted.sql @@ -65,7 +65,7 @@ SET enable_multiple_prewhere_read_steps = 1; SELECT count() FROM customer -CROSS JOIN nation +, nation WHERE c_nationkey = n_nationkey AND n_name = 'FRANCE' AND c_nationkey_copy = 6 @@ -92,7 +92,7 @@ WHERE type = 'QueryFinish' SELECT count() FROM customer -CROSS JOIN nation +, nation WHERE c_nationkey = n_nationkey AND n_name IN ('FRANCE', 'GERMANY') AND c_nationkey_copy IN (6, 7) @@ -116,7 +116,7 @@ WHERE type = 'QueryFinish' SELECT count() FROM customer -CROSS JOIN nation +, nation WHERE c_nationkey = n_nationkey AND n_name IN ('FRANCE', 'GERMANY', 'ETHIOPIA') AND c_nationkey_copy IN (6, 7, 5) @@ -140,7 +140,7 @@ WHERE type = 'QueryFinish' SELECT count() FROM customer -CROSS JOIN numbers(2000) AS n +, numbers(2000) AS n WHERE c_nationkey = n.number::Int32 SETTINGS join_runtime_filter_exact_values_limit = 1, @@ -168,7 +168,7 @@ FROM FROM customer WHERE c_nationkey_copy != 6 ) AS c -LEFT JOIN ( +ANTI LEFT JOIN ( SELECT * FROM nation WHERE n_name = 'FRANCE' @@ -198,7 +198,7 @@ FROM FROM customer WHERE c_nationkey_copy NOT IN (6, 7) ) AS c -LEFT JOIN ( +ANTI LEFT JOIN ( SELECT * FROM nation WHERE n_name IN ('FRANCE', 'GERMANY') @@ -224,7 +224,7 @@ WHERE type = 'QueryFinish' SELECT count() FROM customer -CROSS JOIN nation +, nation WHERE c_nationkey = n_nationkey AND n_name = 'FRANCE' AND c_nationkey_copy = 6 diff --git a/tests/clickhouse-reference/03760_split_join_filter.sql.expected.ast.json b/tests/clickhouse-reference/03760_split_join_filter.sql.expected.ast.json index e8c7f7189..b3fadf6cd 100644 --- a/tests/clickhouse-reference/03760_split_join_filter.sql.expected.ast.json +++ b/tests/clickhouse-reference/03760_split_join_filter.sql.expected.ast.json @@ -417,7 +417,8 @@ } ] } - } + }, + "strictness": "ANTI" } } } @@ -595,7 +596,8 @@ } ] } - } + }, + "strictness": "ANTI" } } } @@ -773,7 +775,8 @@ } ] } - } + }, + "strictness": "SEMI" } } } @@ -951,7 +954,8 @@ } ] } - } + }, + "strictness": "SEMI" } } } @@ -1129,7 +1133,8 @@ } ] } - } + }, + "strictness": "ANY" } } } @@ -1307,7 +1312,8 @@ } ] } - } + }, + "strictness": "ANY" } } } diff --git a/tests/clickhouse-reference/03760_split_join_filter.sql.expected.formatted.sql b/tests/clickhouse-reference/03760_split_join_filter.sql.expected.formatted.sql index 869e27b5f..3ffe5406c 100644 --- a/tests/clickhouse-reference/03760_split_join_filter.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03760_split_join_filter.sql.expected.formatted.sql @@ -56,7 +56,7 @@ FROM ( SELECT count() FROM customer - LEFT JOIN nation + ANTI LEFT JOIN nation ON c_nationkey = n_nationkey AND n_name = 'FRANCE' AND c_custkey = 1 @@ -72,7 +72,7 @@ FROM ( SELECT count() FROM customer - RIGHT JOIN nation + ANTI RIGHT JOIN nation ON c_nationkey = n_nationkey AND n_name = 'FRANCE' AND c_custkey = 1 @@ -88,7 +88,7 @@ FROM ( SELECT count() FROM customer - LEFT JOIN nation + SEMI LEFT JOIN nation ON c_nationkey = n_nationkey AND n_name = 'FRANCE' AND c_custkey = 1 @@ -104,7 +104,7 @@ FROM ( SELECT count() FROM customer - RIGHT JOIN nation + SEMI RIGHT JOIN nation ON c_nationkey = n_nationkey AND n_name = 'FRANCE' AND c_custkey = 1 @@ -120,7 +120,7 @@ FROM ( SELECT count() FROM customer - LEFT JOIN nation + ANY LEFT JOIN nation ON c_nationkey = n_nationkey AND n_name = 'FRANCE' AND c_custkey = 1 @@ -136,7 +136,7 @@ FROM ( SELECT count() FROM customer - RIGHT JOIN nation + ANY RIGHT JOIN nation ON c_nationkey = n_nationkey AND n_name = 'FRANCE' AND c_custkey = 1 diff --git a/tests/clickhouse-reference/03761_convert_outer_to_inner_join_keeps_header.sql.expected.ast.json b/tests/clickhouse-reference/03761_convert_outer_to_inner_join_keeps_header.sql.expected.ast.json index 054487a3a..dbe545752 100644 --- a/tests/clickhouse-reference/03761_convert_outer_to_inner_join_keeps_header.sql.expected.ast.json +++ b/tests/clickhouse-reference/03761_convert_outer_to_inner_join_keeps_header.sql.expected.ast.json @@ -96,7 +96,8 @@ ] } } - } + }, + "strictness": "ANY" }, "where": { "kind": "functionCall", diff --git a/tests/clickhouse-reference/03761_convert_outer_to_inner_join_keeps_header.sql.expected.formatted.sql b/tests/clickhouse-reference/03761_convert_outer_to_inner_join_keeps_header.sql.expected.formatted.sql index bc6b34e65..7a4d0cb13 100644 --- a/tests/clickhouse-reference/03761_convert_outer_to_inner_join_keeps_header.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03761_convert_outer_to_inner_join_keeps_header.sql.expected.formatted.sql @@ -10,6 +10,6 @@ FROM t0 AS l INNER JOIN t0 AS m ON true -RIGHT JOIN t0 AS r +ANY RIGHT JOIN t0 AS r ON (l.c0 + l.c1) = r.c1 WHERE isNull(1); \ No newline at end of file diff --git a/tests/clickhouse-reference/03762_analyzer_convert_any_outer_to_inner_with_injective_function.sql.expected.ast.json b/tests/clickhouse-reference/03762_analyzer_convert_any_outer_to_inner_with_injective_function.sql.expected.ast.json index 2d98636c1..7384b4dc2 100644 --- a/tests/clickhouse-reference/03762_analyzer_convert_any_outer_to_inner_with_injective_function.sql.expected.ast.json +++ b/tests/clickhouse-reference/03762_analyzer_convert_any_outer_to_inner_with_injective_function.sql.expected.ast.json @@ -237,7 +237,8 @@ ] } } - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -372,7 +373,8 @@ ] } } - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -543,7 +545,8 @@ } ] } - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -717,7 +720,8 @@ } ] } - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", diff --git a/tests/clickhouse-reference/03762_analyzer_convert_any_outer_to_inner_with_injective_function.sql.expected.formatted.sql b/tests/clickhouse-reference/03762_analyzer_convert_any_outer_to_inner_with_injective_function.sql.expected.formatted.sql index 218a85796..90cf047a9 100644 --- a/tests/clickhouse-reference/03762_analyzer_convert_any_outer_to_inner_with_injective_function.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03762_analyzer_convert_any_outer_to_inner_with_injective_function.sql.expected.formatted.sql @@ -25,7 +25,7 @@ EXPLAIN actions = 1, keep_logical_steps = 1 SELECT * FROM users AS u1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT sum(age)::Nullable(Int64) AS age_sum, name @@ -40,7 +40,7 @@ EXPLAIN actions = 1, keep_logical_steps = 1 SELECT * FROM users AS u1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT sum(age)::Nullable(Int64) AS age_sum, name @@ -58,7 +58,7 @@ EXPLAIN actions = 1, keep_logical_steps = 1 SELECT * FROM users AS u1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT sum(age)::Nullable(Int64) AS age_sum, name, @@ -76,7 +76,7 @@ EXPLAIN actions = 1, keep_logical_steps = 1 SELECT * FROM users AS u1 -LEFT JOIN ( +ANY LEFT JOIN ( SELECT sum(age)::Nullable(Int64) AS age_sum, name, diff --git a/tests/clickhouse-reference/03764_join_nothing_type_column_crash.sql.expected.ast.json b/tests/clickhouse-reference/03764_join_nothing_type_column_crash.sql.expected.ast.json index 40e5cae91..0f2d027b5 100644 --- a/tests/clickhouse-reference/03764_join_nothing_type_column_crash.sql.expected.ast.json +++ b/tests/clickhouse-reference/03764_join_nothing_type_column_crash.sql.expected.ast.json @@ -119,7 +119,8 @@ ] } } - } + }, + "strictness": "ANY" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/03764_join_nothing_type_column_crash.sql.expected.formatted.sql b/tests/clickhouse-reference/03764_join_nothing_type_column_crash.sql.expected.formatted.sql index dfe80c820..de8dc02f5 100644 --- a/tests/clickhouse-reference/03764_join_nothing_type_column_crash.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03764_join_nothing_type_column_crash.sql.expected.formatted.sql @@ -2,7 +2,7 @@ SELECT DISTINCT kafkaMurmurHash(*) FROM numbers(10) AS y -RIGHT JOIN ( +ANY RIGHT JOIN ( SELECT concat('str', number) AS str, arrayJoin(range(number)) AS i, diff --git a/tests/clickhouse-reference/03773_semi_join_equivalent_sets.sql.expected.ast.json b/tests/clickhouse-reference/03773_semi_join_equivalent_sets.sql.expected.ast.json index 50d1d7727..165979d73 100644 --- a/tests/clickhouse-reference/03773_semi_join_equivalent_sets.sql.expected.ast.json +++ b/tests/clickhouse-reference/03773_semi_join_equivalent_sets.sql.expected.ast.json @@ -208,7 +208,8 @@ ] } } - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -359,7 +360,8 @@ ] } } - } + }, + "strictness": "SEMI" }, "where": { "kind": "binaryExpr", @@ -463,7 +465,8 @@ ] } } - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -636,7 +639,8 @@ ] } } - } + }, + "strictness": "SEMI" }, "where": { "kind": "binaryExpr", @@ -799,7 +803,8 @@ ] } } - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -962,7 +967,8 @@ ] } } - } + }, + "strictness": "SEMI" }, "where": { "kind": "binaryExpr", diff --git a/tests/clickhouse-reference/03773_semi_join_equivalent_sets.sql.expected.formatted.sql b/tests/clickhouse-reference/03773_semi_join_equivalent_sets.sql.expected.formatted.sql index dacd57960..927c42cb7 100644 --- a/tests/clickhouse-reference/03773_semi_join_equivalent_sets.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03773_semi_join_equivalent_sets.sql.expected.formatted.sql @@ -27,7 +27,7 @@ FROM ( SELECT * FROM users - LEFT JOIN ( + ANY LEFT JOIN ( SELECT number FROM numbers(10) ) AS t2 @@ -42,7 +42,7 @@ EXPLAIN actions = 1 SELECT * FROM users -LEFT JOIN ( +SEMI LEFT JOIN ( SELECT number FROM numbers(10) ) AS t2 @@ -55,7 +55,7 @@ FROM ( SELECT * FROM users - LEFT JOIN ( + ANY LEFT JOIN ( SELECT number FROM numbers(10) ) AS t2 @@ -74,7 +74,7 @@ FROM ( SELECT * FROM users - LEFT JOIN ( + SEMI LEFT JOIN ( SELECT number FROM numbers(10) ) AS t2 @@ -91,7 +91,7 @@ FROM ( SELECT * FROM users - RIGHT JOIN ( + ANY RIGHT JOIN ( SELECT number FROM numbers(10) ) AS t2 @@ -108,7 +108,7 @@ FROM ( SELECT * FROM users - RIGHT JOIN ( + SEMI RIGHT JOIN ( SELECT number FROM numbers(10) ) AS t2 diff --git a/tests/clickhouse-reference/03777_analyzer_unused_columns_removal_correlated_subquery.sql.expected.ast.json b/tests/clickhouse-reference/03777_analyzer_unused_columns_removal_correlated_subquery.sql.expected.ast.json index cba678ab2..c6ad0b36c 100644 --- a/tests/clickhouse-reference/03777_analyzer_unused_columns_removal_correlated_subquery.sql.expected.ast.json +++ b/tests/clickhouse-reference/03777_analyzer_unused_columns_removal_correlated_subquery.sql.expected.ast.json @@ -417,6 +417,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "part" @@ -548,6 +549,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableRef", "table": "part" diff --git a/tests/clickhouse-reference/03777_analyzer_unused_columns_removal_correlated_subquery.sql.expected.formatted.sql b/tests/clickhouse-reference/03777_analyzer_unused_columns_removal_correlated_subquery.sql.expected.formatted.sql index b7d219460..5fa4c0ff7 100644 --- a/tests/clickhouse-reference/03777_analyzer_unused_columns_removal_correlated_subquery.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03777_analyzer_unused_columns_removal_correlated_subquery.sql.expected.formatted.sql @@ -53,7 +53,7 @@ FROM ( SELECT * FROM lineitem - CROSS JOIN part + , part WHERE p_partkey = l_partkey ) AS lp WHERE l_quantity < ( @@ -67,7 +67,7 @@ FROM ( SELECT * FROM lineitem - CROSS JOIN part + , part WHERE p_partkey = l_partkey ) AS lp WHERE l_quantity < ( diff --git a/tests/clickhouse-reference/03777_join_runtime_filter_prepared_right_table.sql.expected.ast.json b/tests/clickhouse-reference/03777_join_runtime_filter_prepared_right_table.sql.expected.ast.json index 168bd14cc..23f5b6daf 100644 --- a/tests/clickhouse-reference/03777_join_runtime_filter_prepared_right_table.sql.expected.ast.json +++ b/tests/clickhouse-reference/03777_join_runtime_filter_prepared_right_table.sql.expected.ast.json @@ -199,7 +199,8 @@ "key2", "key3" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { @@ -240,7 +241,8 @@ "key2", "key3" ] - } + }, + "strictness": "ALL" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/03777_join_runtime_filter_prepared_right_table.sql.expected.formatted.sql b/tests/clickhouse-reference/03777_join_runtime_filter_prepared_right_table.sql.expected.formatted.sql index 8a10512fa..e16e1a351 100644 --- a/tests/clickhouse-reference/03777_join_runtime_filter_prepared_right_table.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03777_join_runtime_filter_prepared_right_table.sql.expected.formatted.sql @@ -30,14 +30,14 @@ EXPLAIN SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj USING (key1, key2, key3) ORDER BY key1 ASC; SELECT * FROM t1 -INNER JOIN tj +ALL INNER JOIN tj USING (key1, key2, key3) ORDER BY key1 ASC; diff --git a/tests/clickhouse-reference/03777_join_runtime_filter_unsupported_type.sql.expected.ast.json b/tests/clickhouse-reference/03777_join_runtime_filter_unsupported_type.sql.expected.ast.json index 9b7db6c9d..69f53ac6e 100644 --- a/tests/clickhouse-reference/03777_join_runtime_filter_unsupported_type.sql.expected.ast.json +++ b/tests/clickhouse-reference/03777_join_runtime_filter_unsupported_type.sql.expected.ast.json @@ -155,6 +155,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -456,6 +457,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { diff --git a/tests/clickhouse-reference/03777_join_runtime_filter_unsupported_type.sql.expected.formatted.sql b/tests/clickhouse-reference/03777_join_runtime_filter_unsupported_type.sql.expected.formatted.sql index aedf83428..8b0e0a0ed 100644 --- a/tests/clickhouse-reference/03777_join_runtime_filter_unsupported_type.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03777_join_runtime_filter_unsupported_type.sql.expected.formatted.sql @@ -17,7 +17,7 @@ FROM SELECT (number, number+1) AS a FROM numbers(1000 - 3, 3) ) AS t1 -CROSS JOIN ( +, ( SELECT (number, number+1) AS b FROM numbers(1000) ) AS t2 @@ -44,7 +44,7 @@ FROM SELECT (number, number+1) AS a FROM numbers(1000 - 3, 3) ) AS t1 -CROSS JOIN ( +, ( SELECT (number, number+1) AS b FROM numbers(1000) ) AS t2 diff --git a/tests/clickhouse-reference/03781_split_join_filter_bug.sql.expected.ast.json b/tests/clickhouse-reference/03781_split_join_filter_bug.sql.expected.ast.json index 185f3c384..c251e6be6 100644 --- a/tests/clickhouse-reference/03781_split_join_filter_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/03781_split_join_filter_bug.sql.expected.ast.json @@ -396,7 +396,8 @@ } ] } - } + }, + "strictness": "ANTI" } }, { @@ -473,7 +474,8 @@ } ] } - } + }, + "strictness": "ANTI" } }, { @@ -550,7 +552,8 @@ } ] } - } + }, + "strictness": "SEMI" } }, { @@ -627,7 +630,8 @@ } ] } - } + }, + "strictness": "SEMI" } }, { @@ -704,7 +708,8 @@ } ] } - } + }, + "strictness": "ANY" } }, { @@ -781,7 +786,8 @@ } ] } - } + }, + "strictness": "ANY" } } ] \ No newline at end of file diff --git a/tests/clickhouse-reference/03781_split_join_filter_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/03781_split_join_filter_bug.sql.expected.formatted.sql index ddc0fd4bc..263dba0fb 100644 --- a/tests/clickhouse-reference/03781_split_join_filter_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03781_split_join_filter_bug.sql.expected.formatted.sql @@ -54,7 +54,7 @@ SET query_plan_join_swap_table = 0; SELECT count() FROM customer -LEFT JOIN nation +ANTI LEFT JOIN nation ON c_nationkey = n_nationkey AND n_name = 'FRANCE' AND c_custkey = 1; @@ -62,7 +62,7 @@ LEFT JOIN nation SELECT count() FROM customer -RIGHT JOIN nation +ANTI RIGHT JOIN nation ON c_nationkey = n_nationkey AND n_name = 'FRANCE' AND c_custkey = 1; @@ -70,7 +70,7 @@ RIGHT JOIN nation SELECT count() FROM customer -LEFT JOIN nation +SEMI LEFT JOIN nation ON c_nationkey = n_nationkey AND n_name = 'FRANCE' AND c_custkey = 1; @@ -78,7 +78,7 @@ LEFT JOIN nation SELECT count() FROM customer -RIGHT JOIN nation +SEMI RIGHT JOIN nation ON c_nationkey = n_nationkey AND n_name = 'FRANCE' AND c_custkey = 1; @@ -86,7 +86,7 @@ RIGHT JOIN nation SELECT count() FROM customer -LEFT JOIN nation +ANY LEFT JOIN nation ON c_nationkey = n_nationkey AND n_name = 'FRANCE' AND c_custkey = 1; @@ -94,7 +94,7 @@ LEFT JOIN nation SELECT count() FROM customer -RIGHT JOIN nation +ANY RIGHT JOIN nation ON c_nationkey = n_nationkey AND n_name = 'FRANCE' AND c_custkey = 1; \ No newline at end of file diff --git a/tests/clickhouse-reference/03784_correlated_subquery_from_storage.sql.expected.ast.json b/tests/clickhouse-reference/03784_correlated_subquery_from_storage.sql.expected.ast.json index d63d32dc8..ca7c0e416 100644 --- a/tests/clickhouse-reference/03784_correlated_subquery_from_storage.sql.expected.ast.json +++ b/tests/clickhouse-reference/03784_correlated_subquery_from_storage.sql.expected.ast.json @@ -188,7 +188,8 @@ ] } } - } + }, + "strictness": "SEMI" }, "orderBy": [ { diff --git a/tests/clickhouse-reference/03784_correlated_subquery_from_storage.sql.expected.formatted.sql b/tests/clickhouse-reference/03784_correlated_subquery_from_storage.sql.expected.formatted.sql index cb21c3c15..68bd7f589 100644 --- a/tests/clickhouse-reference/03784_correlated_subquery_from_storage.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03784_correlated_subquery_from_storage.sql.expected.formatted.sql @@ -31,7 +31,7 @@ INSERT INTO t2; SELECT * FROM t2 -LEFT JOIN t0 +SEMI LEFT JOIN t0 ON t2.c0 = t0.c0 ORDER BY `ALL` ASC; diff --git a/tests/clickhouse-reference/03786_outer_to_semi_or_anti.sql.expected.ast.json b/tests/clickhouse-reference/03786_outer_to_semi_or_anti.sql.expected.ast.json index c08a2cd42..f7868baf3 100644 --- a/tests/clickhouse-reference/03786_outer_to_semi_or_anti.sql.expected.ast.json +++ b/tests/clickhouse-reference/03786_outer_to_semi_or_anti.sql.expected.ast.json @@ -122,7 +122,8 @@ "type": "Bool", "value": "1" } - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -199,7 +200,8 @@ "type": "Bool", "value": "1" } - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", diff --git a/tests/clickhouse-reference/03786_outer_to_semi_or_anti.sql.expected.formatted.sql b/tests/clickhouse-reference/03786_outer_to_semi_or_anti.sql.expected.formatted.sql index baedf9965..f642a4153 100644 --- a/tests/clickhouse-reference/03786_outer_to_semi_or_anti.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03786_outer_to_semi_or_anti.sql.expected.formatted.sql @@ -12,7 +12,7 @@ FROM ( SELECT 1 ) AS tx -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 1 AS c0 ) AS tz ON true @@ -23,7 +23,7 @@ FROM ( SELECT 1 ) AS tx -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 1 AS c0 ) AS tz ON true diff --git a/tests/clickhouse-reference/03788_hash_join_with_empty_right_side_skip_left_side.sql.expected.ast.json b/tests/clickhouse-reference/03788_hash_join_with_empty_right_side_skip_left_side.sql.expected.ast.json index 2ccf6d301..2b2a067e1 100644 --- a/tests/clickhouse-reference/03788_hash_join_with_empty_right_side_skip_left_side.sql.expected.ast.json +++ b/tests/clickhouse-reference/03788_hash_join_with_empty_right_side_skip_left_side.sql.expected.ast.json @@ -605,6 +605,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "subqueryFrom", "query": { @@ -673,6 +674,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "null", @@ -732,6 +734,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -747,6 +750,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -762,6 +766,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "numbers", @@ -777,6 +782,7 @@ }, "kind": "joinExpr", "joinType": "CROSS", + "comma": true, "right": { "kind": "tableFunctionRef", "name": "null", diff --git a/tests/clickhouse-reference/03788_hash_join_with_empty_right_side_skip_left_side.sql.expected.formatted.sql b/tests/clickhouse-reference/03788_hash_join_with_empty_right_side_skip_left_side.sql.expected.formatted.sql index 8e67356d2..95c98aae7 100644 --- a/tests/clickhouse-reference/03788_hash_join_with_empty_right_side_skip_left_side.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03788_hash_join_with_empty_right_side_skip_left_side.sql.expected.formatted.sql @@ -80,7 +80,7 @@ FROM SELECT sum(number) AS x FROM `system`.numbers ) AS a -CROSS JOIN ( +, ( SELECT toUInt64(1) AS y WHERE 0 ) AS b @@ -89,7 +89,7 @@ SETTINGS query_plan_join_swap_table = 0; SELECT count() FROM numbers(1e12) AS t1 -CROSS JOIN null('x UInt8') AS t2 +, null('x UInt8') AS t2 SETTINGS query_plan_join_swap_table = 0, max_rows_to_read = 1e13; @@ -97,10 +97,10 @@ SETTINGS SELECT count() FROM numbers(1e12) AS t1 -CROSS JOIN numbers(1e12) AS t2 -CROSS JOIN numbers(1e12) AS t3 -CROSS JOIN numbers(1e12) AS t4 -CROSS JOIN null('x UInt8') AS t5 +, numbers(1e12) AS t2 +, numbers(1e12) AS t3 +, numbers(1e12) AS t4 +, null('x UInt8') AS t5 SETTINGS query_plan_join_swap_table = 0, max_rows_to_read = 1e13; \ No newline at end of file diff --git a/tests/clickhouse-reference/03788_header_after_outer_to_semi_or_anti_conversion.sql.expected.ast.json b/tests/clickhouse-reference/03788_header_after_outer_to_semi_or_anti_conversion.sql.expected.ast.json index c722caa71..212f0375e 100644 --- a/tests/clickhouse-reference/03788_header_after_outer_to_semi_or_anti_conversion.sql.expected.ast.json +++ b/tests/clickhouse-reference/03788_header_after_outer_to_semi_or_anti_conversion.sql.expected.ast.json @@ -467,7 +467,8 @@ } ] } - } + }, + "strictness": "ANY" }, "where": { "kind": "naryExpr", @@ -659,7 +660,8 @@ "ALL" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": true } ] }, @@ -804,7 +806,8 @@ } ] } - } + }, + "strictness": "ANY" }, "where": { "kind": "literal", diff --git a/tests/clickhouse-reference/03788_header_after_outer_to_semi_or_anti_conversion.sql.expected.formatted.sql b/tests/clickhouse-reference/03788_header_after_outer_to_semi_or_anti_conversion.sql.expected.formatted.sql index 2f1090c60..29fcb24f6 100644 --- a/tests/clickhouse-reference/03788_header_after_outer_to_semi_or_anti_conversion.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03788_header_after_outer_to_semi_or_anti_conversion.sql.expected.formatted.sql @@ -22,7 +22,7 @@ FROM WITH CUBE WITH TOTALS ) AS foo -LEFT JOIN ( +ANY LEFT JOIN ( SELECT * AND ((((isNullable(isZeroOrNull(toNullable(1))) @@ -46,7 +46,7 @@ WHERE ((and(*, toNullable(2), * AND ((* AND isZeroOrNull(2))) AND isNull(toNullable(2)))) -ORDER BY `ALL` ASC; +ORDER BY `ALL` ASC NULLS FIRST; SELECT DISTINCT 2 FROM @@ -61,7 +61,7 @@ FROM WITH CUBE WITH TOTALS ) AS foo -LEFT JOIN ( +ANY LEFT JOIN ( SELECT 2 AS b, 1 AS a diff --git a/tests/clickhouse-reference/03788_semi_join_filter_pushdown_bug.sql.expected.ast.json b/tests/clickhouse-reference/03788_semi_join_filter_pushdown_bug.sql.expected.ast.json index f88bfc687..d046e39de 100644 --- a/tests/clickhouse-reference/03788_semi_join_filter_pushdown_bug.sql.expected.ast.json +++ b/tests/clickhouse-reference/03788_semi_join_filter_pushdown_bug.sql.expected.ast.json @@ -91,7 +91,8 @@ ] } } - } + }, + "strictness": "SEMI" }, "where": { "kind": "binaryExpr", @@ -154,7 +155,8 @@ ] } } - } + }, + "strictness": "ANY" }, "where": { "kind": "binaryExpr", @@ -217,7 +219,8 @@ ] } } - } + }, + "strictness": "SEMI" }, "where": { "kind": "binaryExpr", diff --git a/tests/clickhouse-reference/03788_semi_join_filter_pushdown_bug.sql.expected.formatted.sql b/tests/clickhouse-reference/03788_semi_join_filter_pushdown_bug.sql.expected.formatted.sql index 867943141..ee518f361 100644 --- a/tests/clickhouse-reference/03788_semi_join_filter_pushdown_bug.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03788_semi_join_filter_pushdown_bug.sql.expected.formatted.sql @@ -11,20 +11,20 @@ SET any_join_distinct_right_table_keys = 1, join_use_nulls = 1; SELECT 1 FROM t0 AS t1 -LEFT JOIN t0 AS t2 +SEMI LEFT JOIN t0 AS t2 ON t1.c0 = t2.c0 WHERE t1.c0 = t2.c0; SELECT 1 FROM t0 AS t1 -INNER JOIN t0 AS t2 +ANY INNER JOIN t0 AS t2 ON t1.c0 = t2.c0 WHERE t1.c0 = t2.c0; SELECT 1 FROM t0 AS t1 -RIGHT JOIN t0 AS t2 +SEMI RIGHT JOIN t0 AS t2 ON t1.c0 = t2.c0 WHERE t1.c0 = t2.c0; \ No newline at end of file diff --git a/tests/clickhouse-reference/03793_with_fill_staleness_long_jump.sql.expected.ast.json b/tests/clickhouse-reference/03793_with_fill_staleness_long_jump.sql.expected.ast.json index 9ca07760c..b9cc83248 100644 --- a/tests/clickhouse-reference/03793_with_fill_staleness_long_jump.sql.expected.ast.json +++ b/tests/clickhouse-reference/03793_with_fill_staleness_long_jump.sql.expected.ast.json @@ -49,6 +49,7 @@ ] }, "direction": "DESC", + "withFill": true, "fillStaleness": { "kind": "literal", "type": "Int64", diff --git a/tests/clickhouse-reference/03793_with_fill_staleness_overflow.sql.expected.ast.json b/tests/clickhouse-reference/03793_with_fill_staleness_overflow.sql.expected.ast.json index 8e2c3b39f..fd94ef394 100644 --- a/tests/clickhouse-reference/03793_with_fill_staleness_overflow.sql.expected.ast.json +++ b/tests/clickhouse-reference/03793_with_fill_staleness_overflow.sql.expected.ast.json @@ -67,6 +67,7 @@ ] }, "direction": "DESC", + "withFill": true, "fillStaleness": { "kind": "functionCall", "name": "toIntervalSecond", @@ -158,6 +159,7 @@ ] }, "direction": "DESC", + "withFill": true, "fillStaleness": { "kind": "functionCall", "name": "toIntervalSecond", @@ -246,6 +248,7 @@ ] }, "direction": "DESC", + "withFill": true, "fillStaleness": { "kind": "functionCall", "name": "toIntervalSecond", diff --git a/tests/clickhouse-reference/03798_nullable_primary_key_logical_error.sql.expected.ast.json b/tests/clickhouse-reference/03798_nullable_primary_key_logical_error.sql.expected.ast.json index c6d26b16f..764a71804 100644 --- a/tests/clickhouse-reference/03798_nullable_primary_key_logical_error.sql.expected.ast.json +++ b/tests/clickhouse-reference/03798_nullable_primary_key_logical_error.sql.expected.ast.json @@ -155,7 +155,8 @@ } ] } - ] + ], + "nullsAction": "IGNORE NULLS" } ], "from": { diff --git a/tests/clickhouse-reference/03798_nullable_primary_key_logical_error.sql.expected.formatted.sql b/tests/clickhouse-reference/03798_nullable_primary_key_logical_error.sql.expected.formatted.sql index 653660c47..6b3940801 100644 --- a/tests/clickhouse-reference/03798_nullable_primary_key_logical_error.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03798_nullable_primary_key_logical_error.sql.expected.formatted.sql @@ -16,5 +16,5 @@ INSERT INTO t; INSERT INTO t; -SELECT DISTINCT minDistinct(toDecimalString(isNotNull(77), isZeroOrNull(isNotNull(toNullable(1))))) +SELECT DISTINCT minDistinct(toDecimalString(isNotNull(77), isZeroOrNull(isNotNull(toNullable(1))))) IGNORE NULLS FROM t; \ No newline at end of file diff --git a/tests/clickhouse-reference/03799_any_left_join_isnotnull_crash.sql.expected.ast.json b/tests/clickhouse-reference/03799_any_left_join_isnotnull_crash.sql.expected.ast.json index c35f7039d..a13984116 100644 --- a/tests/clickhouse-reference/03799_any_left_join_isnotnull_crash.sql.expected.ast.json +++ b/tests/clickhouse-reference/03799_any_left_join_isnotnull_crash.sql.expected.ast.json @@ -440,7 +440,8 @@ ] } } - } + }, + "strictness": "ANY" }, "where": { "kind": "naryExpr", diff --git a/tests/clickhouse-reference/03799_any_left_join_isnotnull_crash.sql.expected.formatted.sql b/tests/clickhouse-reference/03799_any_left_join_isnotnull_crash.sql.expected.formatted.sql index d236f2efd..9253d3d31 100644 --- a/tests/clickhouse-reference/03799_any_left_join_isnotnull_crash.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03799_any_left_join_isnotnull_crash.sql.expected.formatted.sql @@ -38,7 +38,7 @@ SELECT count() AS count FROM AddedToCart AS a -LEFT JOIN Session AS s +ANY LEFT JOIN Session AS s ON a.sessionId = s.id WHERE (isNotNull(a.`top`)) AND (isNotNull(a.screenHeight)) diff --git a/tests/clickhouse-reference/03807_top_k_limit_zero.sql.expected.ast.json b/tests/clickhouse-reference/03807_top_k_limit_zero.sql.expected.ast.json index 0f5d2cee5..8834a90bd 100644 --- a/tests/clickhouse-reference/03807_top_k_limit_zero.sql.expected.ast.json +++ b/tests/clickhouse-reference/03807_top_k_limit_zero.sql.expected.ast.json @@ -140,7 +140,8 @@ "v1" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": false } ], "limit": { diff --git a/tests/clickhouse-reference/03807_top_k_limit_zero.sql.expected.formatted.sql b/tests/clickhouse-reference/03807_top_k_limit_zero.sql.expected.formatted.sql index 222cc9fea..db404127e 100644 --- a/tests/clickhouse-reference/03807_top_k_limit_zero.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03807_top_k_limit_zero.sql.expected.formatted.sql @@ -21,7 +21,7 @@ SELECT id, v1 FROM tab -ORDER BY v1 DESC +ORDER BY v1 DESC NULLS LAST LIMIT 0 SETTINGS use_skip_indexes_for_top_k = 1; diff --git a/tests/clickhouse-reference/03812_fuse_function_pass_nullable_argument.sql.expected.ast.json b/tests/clickhouse-reference/03812_fuse_function_pass_nullable_argument.sql.expected.ast.json index d1f1e906d..2d21a145c 100644 --- a/tests/clickhouse-reference/03812_fuse_function_pass_nullable_argument.sql.expected.ast.json +++ b/tests/clickhouse-reference/03812_fuse_function_pass_nullable_argument.sql.expected.ast.json @@ -86,7 +86,8 @@ "b" ] } - ] + ], + "nullsAction": "IGNORE NULLS" } } ], @@ -202,7 +203,8 @@ { "kind": "functionCall", "name": "count", - "args": [] + "args": [], + "nullsAction": "IGNORE NULLS" } ], "from": { @@ -443,7 +445,8 @@ "b" ] } - ] + ], + "nullsAction": "IGNORE NULLS" } } ], @@ -573,7 +576,8 @@ { "kind": "functionCall", "name": "count", - "args": [] + "args": [], + "nullsAction": "IGNORE NULLS" } ], "from": { diff --git a/tests/clickhouse-reference/03812_fuse_function_pass_nullable_argument.sql.expected.formatted.sql b/tests/clickhouse-reference/03812_fuse_function_pass_nullable_argument.sql.expected.formatted.sql index e1b3eb8f3..b3c01b0f0 100644 --- a/tests/clickhouse-reference/03812_fuse_function_pass_nullable_argument.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03812_fuse_function_pass_nullable_argument.sql.expected.formatted.sql @@ -10,7 +10,7 @@ CREATE TABLE test ) ENGINE = Log; -SELECT count(b) * count(b) +SELECT count(b) * count(b) IGNORE NULLS FROM ( SELECT b FROM test @@ -20,7 +20,7 @@ SELECT avg(b) * 3, (sum(b) + 1) + count(b), count(b) * count(b), - count() + count() IGNORE NULLS FROM ( SELECT b FROM test @@ -50,7 +50,7 @@ FROM ( SET enable_analyzer = 1; EXPLAIN SYNTAX run_query_tree_passes = 1 -SELECT count(b) * count(b) +SELECT count(b) * count(b) IGNORE NULLS FROM ( SELECT b FROM test @@ -61,7 +61,7 @@ SELECT avg(b) * 3, (sum(b) + 1) + count(b), count(b) * count(b), - count() + count() IGNORE NULLS FROM ( SELECT b FROM test diff --git a/tests/clickhouse-reference/03812_join_order_ubsan_overflow.sql.expected.ast.json b/tests/clickhouse-reference/03812_join_order_ubsan_overflow.sql.expected.ast.json index eae9a2044..2b319c4aa 100644 --- a/tests/clickhouse-reference/03812_join_order_ubsan_overflow.sql.expected.ast.json +++ b/tests/clickhouse-reference/03812_join_order_ubsan_overflow.sql.expected.ast.json @@ -130,7 +130,8 @@ "type": "UInt64", "value": "1" } - } + }, + "strictness": "ALL" } }, "format": "Null" diff --git a/tests/clickhouse-reference/03812_join_order_ubsan_overflow.sql.expected.formatted.sql b/tests/clickhouse-reference/03812_join_order_ubsan_overflow.sql.expected.formatted.sql index a0bb6c1d3..288d09117 100644 --- a/tests/clickhouse-reference/03812_join_order_ubsan_overflow.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03812_join_order_ubsan_overflow.sql.expected.formatted.sql @@ -23,7 +23,7 @@ EXPLAIN PLAN SELECT 1 FROM data_03812 AS t1 -INNER JOIN ( +ALL INNER JOIN ( SELECT number FROM `system`.numbers LIMIT 9223372036854775806 diff --git a/tests/clickhouse-reference/03822_window_function_large_preceding_offset.sql.expected.ast.json b/tests/clickhouse-reference/03822_window_function_large_preceding_offset.sql.expected.ast.json index 25c7c4080..1f77da5ee 100644 --- a/tests/clickhouse-reference/03822_window_function_large_preceding_offset.sql.expected.ast.json +++ b/tests/clickhouse-reference/03822_window_function_large_preceding_offset.sql.expected.ast.json @@ -40,7 +40,8 @@ "number" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ], "frame": { @@ -115,7 +116,8 @@ "p" ] }, - "direction": "ASC" + "direction": "ASC", + "nullsFirst": false }, { "kind": "orderByItem", @@ -125,7 +127,8 @@ "number" ] }, - "direction": "DESC" + "direction": "DESC", + "nullsFirst": true } ], "settings": [ diff --git a/tests/clickhouse-reference/03822_window_function_large_preceding_offset.sql.expected.formatted.sql b/tests/clickhouse-reference/03822_window_function_large_preceding_offset.sql.expected.formatted.sql index 34b52cc74..1ba8e6f2d 100644 --- a/tests/clickhouse-reference/03822_window_function_large_preceding_offset.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03822_window_function_large_preceding_offset.sql.expected.formatted.sql @@ -4,7 +4,7 @@ SELECT number, p, - count(*) OVER (PARTITION BY p ORDER BY number DESC ROWS BETWEEN UNBOUNDED PRECEDING AND 65537 PRECEDING) + count(*) OVER (PARTITION BY p ORDER BY number DESC NULLS FIRST ROWS BETWEEN UNBOUNDED PRECEDING AND 65537 PRECEDING) FROM ( SELECT number, @@ -12,6 +12,6 @@ FROM ( FROM numbers(71) ) ORDER BY - p ASC, - number DESC + p ASC NULLS LAST, + number DESC NULLS FIRST SETTINGS max_block_size = 2; \ No newline at end of file diff --git a/tests/clickhouse-reference/03904_fuse_function_pass_lowcardinality_nullable_argument.sql.expected.ast.json b/tests/clickhouse-reference/03904_fuse_function_pass_lowcardinality_nullable_argument.sql.expected.ast.json index 2558953ba..e11a7c8c1 100644 --- a/tests/clickhouse-reference/03904_fuse_function_pass_lowcardinality_nullable_argument.sql.expected.ast.json +++ b/tests/clickhouse-reference/03904_fuse_function_pass_lowcardinality_nullable_argument.sql.expected.ast.json @@ -107,7 +107,8 @@ "b" ] } - ] + ], + "nullsAction": "IGNORE NULLS" } } ], @@ -223,7 +224,8 @@ { "kind": "functionCall", "name": "count", - "args": [] + "args": [], + "nullsAction": "IGNORE NULLS" } ], "from": { @@ -464,7 +466,8 @@ "b" ] } - ] + ], + "nullsAction": "IGNORE NULLS" } } ], @@ -594,7 +597,8 @@ { "kind": "functionCall", "name": "count", - "args": [] + "args": [], + "nullsAction": "IGNORE NULLS" } ], "from": { diff --git a/tests/clickhouse-reference/03904_fuse_function_pass_lowcardinality_nullable_argument.sql.expected.formatted.sql b/tests/clickhouse-reference/03904_fuse_function_pass_lowcardinality_nullable_argument.sql.expected.formatted.sql index 1707f75dd..d3f2be8d4 100644 --- a/tests/clickhouse-reference/03904_fuse_function_pass_lowcardinality_nullable_argument.sql.expected.formatted.sql +++ b/tests/clickhouse-reference/03904_fuse_function_pass_lowcardinality_nullable_argument.sql.expected.formatted.sql @@ -12,7 +12,7 @@ CREATE TABLE test ) ENGINE = Log; -SELECT count(b) * count(b) +SELECT count(b) * count(b) IGNORE NULLS FROM ( SELECT b FROM test @@ -22,7 +22,7 @@ SELECT avg(b) * 3, (sum(b) + 1) + count(b), count(b) * count(b), - count() + count() IGNORE NULLS FROM ( SELECT b FROM test @@ -52,7 +52,7 @@ FROM ( SET enable_analyzer = 1; EXPLAIN SYNTAX run_query_tree_passes = 1 -SELECT count(b) * count(b) +SELECT count(b) * count(b) IGNORE NULLS FROM ( SELECT b FROM test @@ -63,7 +63,7 @@ SELECT avg(b) * 3, (sum(b) + 1) + count(b), count(b) * count(b), - count() + count() IGNORE NULLS FROM ( SELECT b FROM test diff --git a/tests/helpers.ts b/tests/helpers.ts index ed3de8a7a..ef4eb426f 100644 --- a/tests/helpers.ts +++ b/tests/helpers.ts @@ -18,6 +18,9 @@ export function discoverCases(): string[] { /** * Recursively removes `location` and `parent` keys from objects. + * Also removes `isOperator` — a surface-syntax marker on desugared operator + * calls that `format()` intentionally normalizes to explicit function-call + * syntax, so it does not survive a format/re-parse round-trip. * Used to strip AST metadata for snapshot/equality comparisons. */ export function stripMeta(value: unknown): unknown { @@ -31,7 +34,7 @@ export function stripMeta(value: unknown): unknown { const result: Record = {}; for (const [k, v] of Object.entries(value as Record)) { - if (k === 'location' || k === 'parent') continue; + if (k === 'location' || k === 'parent' || k === 'isOperator') continue; result[k] = stripMeta(v); } return result;