diff --git a/ast/ast.go b/ast/ast.go index d20bf9144..028c65b65 100644 --- a/ast/ast.go +++ b/ast/ast.go @@ -911,6 +911,7 @@ type CastExpr struct { TypeExpr Expression `json:"type_expr,omitempty"` // For dynamic type like CAST(x, if(cond, 'Type1', 'Type2')) Alias string `json:"alias,omitempty"` OperatorSyntax bool `json:"operator_syntax,omitempty"` // true if using :: syntax + UsedASSyntax bool `json:"-"` // true if CAST(x AS Type) syntax used (not CAST(x, 'Type')) } func (c *CastExpr) Pos() token.Position { return c.Position } diff --git a/internal/explain/expressions.go b/internal/explain/expressions.go index cbc3cbd32..9f4ac109b 100644 --- a/internal/explain/expressions.go +++ b/internal/explain/expressions.go @@ -198,7 +198,11 @@ func explainUnaryExpr(sb *strings.Builder, n *ast.UnaryExpr, indent string, dept func explainSubquery(sb *strings.Builder, n *ast.Subquery, indent string, depth int) { children := 1 - fmt.Fprintf(sb, "%sSubquery (children %d)\n", indent, children) + if n.Alias != "" { + fmt.Fprintf(sb, "%sSubquery (alias %s) (children %d)\n", indent, n.Alias, children) + } else { + fmt.Fprintf(sb, "%sSubquery (children %d)\n", indent, children) + } Node(sb, n.Query, depth+1) } @@ -270,8 +274,12 @@ func explainAliasedExpr(sb *strings.Builder, n *ast.AliasedExpr, depth int) { Node(sb, e.Then, depth+2) Node(sb, e.Else, depth+2) case *ast.CastExpr: - // CAST expressions - ClickHouse doesn't show aliases on CAST in EXPLAIN AST - explainCastExpr(sb, e, indent, depth) + // CAST expressions - show alias only for CAST(x AS Type) syntax, not CAST(x, 'Type') + if e.UsedASSyntax { + explainCastExprWithAlias(sb, e, n.Alias, indent, depth) + } else { + explainCastExpr(sb, e, indent, depth) + } case *ast.ArrayAccess: // Array access - ClickHouse doesn't show aliases on arrayElement in EXPLAIN AST explainArrayAccess(sb, e, indent, depth) diff --git a/internal/explain/format.go b/internal/explain/format.go index 89f9607b5..96a4cccf5 100644 --- a/internal/explain/format.go +++ b/internal/explain/format.go @@ -2,6 +2,7 @@ package explain import ( "fmt" + "math" "strconv" "strings" @@ -10,6 +11,16 @@ import ( // FormatFloat formats a float value for EXPLAIN AST output func FormatFloat(val float64) string { + // Handle special float values - ClickHouse uses lowercase + if math.IsInf(val, 1) { + return "inf" + } + if math.IsInf(val, -1) { + return "-inf" + } + if math.IsNaN(val) { + return "nan" + } // Use 'f' format to avoid scientific notation, -1 precision for smallest representation return strconv.FormatFloat(val, 'f', -1, 64) } @@ -142,6 +153,21 @@ func formatTupleLiteral(val interface{}) string { return fmt.Sprintf("Tuple_(%s)", strings.Join(parts, ", ")) } +// formatInListAsTuple formats an IN expression's value list as a tuple literal +func formatInListAsTuple(list []ast.Expression) string { + var parts []string + for _, e := range list { + if lit, ok := e.(*ast.Literal); ok { + parts = append(parts, FormatLiteral(lit)) + } else if ident, ok := e.(*ast.Identifier); ok { + parts = append(parts, ident.Name()) + } else { + parts = append(parts, formatExprAsString(e)) + } + } + return fmt.Sprintf("Tuple_(%s)", strings.Join(parts, ", ")) +} + // FormatDataType formats a DataType for EXPLAIN AST output func FormatDataType(dt *ast.DataType) string { if dt == nil { @@ -161,6 +187,9 @@ func FormatDataType(dt *ast.DataType) string { } } else if nested, ok := p.(*ast.DataType); ok { params = append(params, FormatDataType(nested)) + } else if ntp, ok := p.(*ast.NameTypePair); ok { + // Named tuple field: "name Type" + params = append(params, ntp.Name+" "+FormatDataType(ntp.Type)) } else { params = append(params, fmt.Sprintf("%v", p)) } diff --git a/internal/explain/functions.go b/internal/explain/functions.go index 8b71accb1..28d886ec0 100644 --- a/internal/explain/functions.go +++ b/internal/explain/functions.go @@ -83,8 +83,19 @@ func explainCastExpr(sb *strings.Builder, n *ast.CastExpr, indent string, depth } func explainCastExprWithAlias(sb *strings.Builder, n *ast.CastExpr, alias string, indent string, depth int) { + // For :: operator syntax, ClickHouse hides alias only when expression is + // an array/tuple with complex content that gets formatted as string + hideAlias := false + if n.OperatorSyntax { + if lit, ok := n.Expr.(*ast.Literal); ok { + if lit.Type == ast.LiteralArray || lit.Type == ast.LiteralTuple { + hideAlias = !containsOnlyPrimitives(lit) + } + } + } + // CAST is represented as Function CAST with expr and type as arguments - if alias != "" { + if alias != "" && !hideAlias { fmt.Fprintf(sb, "%sFunction CAST (alias %s) (children %d)\n", indent, alias, 1) } else { fmt.Fprintf(sb, "%sFunction CAST (children %d)\n", indent, 1) @@ -205,6 +216,18 @@ func explainArrayAccess(sb *strings.Builder, n *ast.ArrayAccess, indent string, Node(sb, n.Index, depth+2) } +func explainArrayAccessWithAlias(sb *strings.Builder, n *ast.ArrayAccess, alias string, indent string, depth int) { + // Array access is represented as Function arrayElement + if alias != "" { + fmt.Fprintf(sb, "%sFunction arrayElement (alias %s) (children %d)\n", indent, alias, 1) + } else { + fmt.Fprintf(sb, "%sFunction arrayElement (children %d)\n", indent, 1) + } + fmt.Fprintf(sb, "%s ExpressionList (children %d)\n", indent, 2) + Node(sb, n.Array, depth+2) + Node(sb, n.Index, depth+2) +} + func explainTupleAccess(sb *strings.Builder, n *ast.TupleAccess, indent string, depth int) { // Tuple access is represented as Function tupleElement fmt.Fprintf(sb, "%sFunction tupleElement (children %d)\n", indent, 1) @@ -213,6 +236,18 @@ func explainTupleAccess(sb *strings.Builder, n *ast.TupleAccess, indent string, Node(sb, n.Index, depth+2) } +func explainTupleAccessWithAlias(sb *strings.Builder, n *ast.TupleAccess, alias string, indent string, depth int) { + // Tuple access is represented as Function tupleElement + if alias != "" { + fmt.Fprintf(sb, "%sFunction tupleElement (alias %s) (children %d)\n", indent, alias, 1) + } else { + fmt.Fprintf(sb, "%sFunction tupleElement (children %d)\n", indent, 1) + } + fmt.Fprintf(sb, "%s ExpressionList (children %d)\n", indent, 2) + Node(sb, n.Tuple, depth+2) + Node(sb, n.Index, depth+2) +} + func explainLikeExpr(sb *strings.Builder, n *ast.LikeExpr, indent string, depth int) { // LIKE is represented as Function like fnName := "like" @@ -229,17 +264,37 @@ func explainLikeExpr(sb *strings.Builder, n *ast.LikeExpr, indent string, depth } func explainBetweenExpr(sb *strings.Builder, n *ast.BetweenExpr, indent string, depth int) { - // BETWEEN is represented as Function and with two comparisons - // But for explain, we can use a simpler form - fnName := "between" if n.Not { - fnName = "notBetween" + // NOT BETWEEN is transformed to: expr < low OR expr > high + // Represented as: Function or with two comparisons: less and greater + fmt.Fprintf(sb, "%sFunction or (children %d)\n", indent, 1) + fmt.Fprintf(sb, "%s ExpressionList (children %d)\n", indent, 2) + // less(expr, low) + fmt.Fprintf(sb, "%s Function less (children %d)\n", indent, 1) + fmt.Fprintf(sb, "%s ExpressionList (children %d)\n", indent, 2) + Node(sb, n.Expr, depth+4) + Node(sb, n.Low, depth+4) + // greater(expr, high) + fmt.Fprintf(sb, "%s Function greater (children %d)\n", indent, 1) + fmt.Fprintf(sb, "%s ExpressionList (children %d)\n", indent, 2) + Node(sb, n.Expr, depth+4) + Node(sb, n.High, depth+4) + } else { + // BETWEEN is represented as Function and with two comparisons + // expr >= low AND expr <= high + fmt.Fprintf(sb, "%sFunction and (children %d)\n", indent, 1) + fmt.Fprintf(sb, "%s ExpressionList (children %d)\n", indent, 2) + // greaterOrEquals(expr, low) + fmt.Fprintf(sb, "%s Function greaterOrEquals (children %d)\n", indent, 1) + fmt.Fprintf(sb, "%s ExpressionList (children %d)\n", indent, 2) + Node(sb, n.Expr, depth+4) + Node(sb, n.Low, depth+4) + // lessOrEquals(expr, high) + fmt.Fprintf(sb, "%s Function lessOrEquals (children %d)\n", indent, 1) + fmt.Fprintf(sb, "%s ExpressionList (children %d)\n", indent, 2) + Node(sb, n.Expr, depth+4) + Node(sb, n.High, depth+4) } - fmt.Fprintf(sb, "%sFunction %s (children %d)\n", indent, fnName, 1) - fmt.Fprintf(sb, "%s ExpressionList (children %d)\n", indent, 3) - Node(sb, n.Expr, depth+2) - Node(sb, n.Low, depth+2) - Node(sb, n.High, depth+2) } func explainIsNullExpr(sb *strings.Builder, n *ast.IsNullExpr, indent string, depth int) { @@ -325,6 +380,7 @@ func explainExtractExpr(sb *strings.Builder, n *ast.ExtractExpr, indent string, func explainWindowSpec(sb *strings.Builder, n *ast.WindowSpec, indent string, depth int) { // Window spec is represented as WindowDefinition // For simple cases like OVER (), just output WindowDefinition without children + // Note: ClickHouse's EXPLAIN AST does not output frame info (ROWS BETWEEN etc) children := 0 if n.Name != "" { children++ @@ -335,9 +391,6 @@ func explainWindowSpec(sb *strings.Builder, n *ast.WindowSpec, indent string, de if len(n.OrderBy) > 0 { children++ } - if n.Frame != nil { - children++ - } if children > 0 { fmt.Fprintf(sb, "%sWindowDefinition (children %d)\n", indent, children) if n.Name != "" { @@ -352,7 +405,7 @@ func explainWindowSpec(sb *strings.Builder, n *ast.WindowSpec, indent string, de if len(n.OrderBy) > 0 { fmt.Fprintf(sb, "%s ExpressionList (children %d)\n", indent, len(n.OrderBy)) for _, o := range n.OrderBy { - Node(sb, o.Expression, depth+2) + explainOrderByElement(sb, o, strings.Repeat(" ", depth+2), depth+2) } } // Frame handling would go here if needed diff --git a/internal/explain/statements.go b/internal/explain/statements.go index 3446ebb25..e4e5ddbc0 100644 --- a/internal/explain/statements.go +++ b/internal/explain/statements.go @@ -316,8 +316,12 @@ func explainExplainQuery(sb *strings.Builder, n *ast.ExplainQuery, indent string } func explainShowQuery(sb *strings.Builder, n *ast.ShowQuery, indent string) { - // Capitalize ShowType correctly for display + // ClickHouse maps certain SHOW types to ShowTables in EXPLAIN AST showType := strings.Title(strings.ToLower(string(n.ShowType))) + // SHOW SETTINGS is displayed as ShowTables in ClickHouse + if showType == "Settings" { + showType = "Tables" + } fmt.Fprintf(sb, "%sShow%s\n", indent, showType) } @@ -327,13 +331,14 @@ func explainUseQuery(sb *strings.Builder, n *ast.UseQuery, indent string) { func explainDescribeQuery(sb *strings.Builder, n *ast.DescribeQuery, indent string) { if n.TableFunction != nil { - // DESCRIBE on a table function + // DESCRIBE on a table function - wrap in TableExpression children := 1 if len(n.Settings) > 0 { children++ } fmt.Fprintf(sb, "%sDescribeQuery (children %d)\n", indent, children) - explainFunctionCall(sb, n.TableFunction, indent+" ", 1) + fmt.Fprintf(sb, "%s TableExpression (children 1)\n", indent) + explainFunctionCall(sb, n.TableFunction, indent+" ", 2) if len(n.Settings) > 0 { fmt.Fprintf(sb, "%s Set\n", indent) } diff --git a/lexer/lexer.go b/lexer/lexer.go index d7e918495..9bc086a8d 100644 --- a/lexer/lexer.go +++ b/lexer/lexer.go @@ -594,16 +594,21 @@ func (l *Lexer) readNumber() Item { } } - // Check for decimal point - if l.ch == '.' && unicode.IsDigit(l.peekChar()) { - sb.WriteRune(l.ch) - l.readChar() - for unicode.IsDigit(l.ch) { + // Check for decimal point (either followed by digit or end of number like 1.) + if l.ch == '.' { + nextCh := l.peekChar() + // Allow 1. (trailing dot with no digits) and 1.5 (dot with digits) + // But not 1.something (identifier-like) + if unicode.IsDigit(nextCh) || (!isIdentStart(nextCh) && nextCh != '.') { sb.WriteRune(l.ch) l.readChar() - // Handle underscore separators - for l.ch == '_' && unicode.IsDigit(l.peekChar()) { + for unicode.IsDigit(l.ch) { + sb.WriteRune(l.ch) l.readChar() + // Handle underscore separators + for l.ch == '_' && unicode.IsDigit(l.peekChar()) { + l.readChar() + } } } } @@ -675,15 +680,20 @@ func (l *Lexer) readNumberOrIdent() Item { } } - // Check for decimal point - if l.ch == '.' && unicode.IsDigit(l.peekChar()) { - sb.WriteRune(l.ch) - l.readChar() - for unicode.IsDigit(l.ch) { + // Check for decimal point (either followed by digit or end of number like 1.) + if l.ch == '.' { + nextCh := l.peekChar() + // Allow 1. (trailing dot with no digits) and 1.5 (dot with digits) + // But not 1.something (identifier-like) + if unicode.IsDigit(nextCh) || (!isIdentStart(nextCh) && nextCh != '.') { sb.WriteRune(l.ch) l.readChar() - for l.ch == '_' && unicode.IsDigit(l.peekChar()) { + for unicode.IsDigit(l.ch) { + sb.WriteRune(l.ch) l.readChar() + for l.ch == '_' && unicode.IsDigit(l.peekChar()) { + l.readChar() + } } } } diff --git a/parser/expression.go b/parser/expression.go index e26a69b39..adfe89540 100644 --- a/parser/expression.go +++ b/parser/expression.go @@ -958,6 +958,7 @@ func (p *Parser) parseCast() ast.Expression { if p.currentIs(token.AS) { p.nextToken() expr.Type = p.parseDataType() + expr.UsedASSyntax = true } else if p.currentIs(token.COMMA) { p.nextToken() // Type can be given as a string literal or an expression (e.g., if(cond, 'Type1', 'Type2')) @@ -1564,6 +1565,18 @@ func (p *Parser) parseAlias(left ast.Expression) ast.Expression { case *ast.Subquery: e.Alias = alias return e + case *ast.CastExpr: + // For :: operator syntax, set alias directly on CastExpr + // For function-style CAST(), wrap in AliasedExpr + if e.OperatorSyntax { + e.Alias = alias + return e + } + return &ast.AliasedExpr{ + Position: left.Pos(), + Expr: left, + Alias: alias, + } case *ast.CaseExpr: e.Alias = alias return e diff --git a/parser/testdata/00129_quantile_timing_weighted/ast.json b/parser/testdata/00129_quantile_timing_weighted/ast.json new file mode 100644 index 000000000..1b9e9cb16 --- /dev/null +++ b/parser/testdata/00129_quantile_timing_weighted/ast.json @@ -0,0 +1,98 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "medianTiming", + "arguments": [ + { + "parts": [ + "t" + ] + } + ] + }, + { + "name": "medianTimingWeighted", + "arguments": [ + { + "parts": [ + "t" + ] + }, + { + "parts": [ + "w" + ] + } + ] + } + ], + "from": { + "tables": [ + { + "table": { + "table": { + "query": { + "selects": [ + { + "columns": [ + { + "parts": [ + "number" + ], + "alias": "t" + }, + { + "expr": { + "condition": { + "left": { + "parts": [ + "number" + ] + }, + "op": "=", + "right": { + "type": "Integer", + "value": 77 + } + }, + "then": { + "type": "Integer", + "value": 10 + }, + "else": { + "type": "Integer", + "value": 1 + } + }, + "alias": "w" + } + ], + "from": { + "tables": [ + { + "table": { + "table": { + "database": "system", + "table": "numbers" + } + } + } + ] + }, + "limit": { + "type": "Integer", + "value": 100 + } + } + ] + } + } + } + } + ] + } + } + ] +} diff --git a/parser/testdata/00140_rename/ast.json b/parser/testdata/00140_rename/ast.json new file mode 100644 index 000000000..05ed9119d --- /dev/null +++ b/parser/testdata/00140_rename/ast.json @@ -0,0 +1,24 @@ +{ + "pairs": [ + { + "from_database": "test", + "from_table": "hits", + "to_database": "test", + "to_table": "visits_tmp" + }, + { + "from_database": "test", + "from_table": "visits", + "to_database": "test", + "to_table": "hits" + }, + { + "from_database": "test", + "from_table": "visits_tmp", + "to_database": "test", + "to_table": "visits" + } + ], + "from": "test.hits", + "to": "test.visits_tmp" +} diff --git a/parser/testdata/00157_cache_dictionary/ast.json b/parser/testdata/00157_cache_dictionary/ast.json new file mode 100644 index 000000000..aff3770ab --- /dev/null +++ b/parser/testdata/00157_cache_dictionary/ast.json @@ -0,0 +1,11 @@ +{ + "if_exists": true, + "database": "test", + "table": "hits_1m", + "tables": [ + { + "database": "test", + "table": "hits_1m" + } + ] +} diff --git a/parser/testdata/00161_rounding_functions/ast.json b/parser/testdata/00161_rounding_functions/ast.json new file mode 100644 index 000000000..07189f739 --- /dev/null +++ b/parser/testdata/00161_rounding_functions/ast.json @@ -0,0 +1,85 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "toUInt8", + "arguments": [ + { + "parts": [ + "number" + ] + } + ], + "alias": "x" + }, + { + "name": "round", + "arguments": [ + { + "parts": [ + "x" + ] + } + ] + }, + { + "name": "roundBankers", + "arguments": [ + { + "parts": [ + "x" + ] + } + ] + }, + { + "name": "floor", + "arguments": [ + { + "parts": [ + "x" + ] + } + ] + }, + { + "name": "ceil", + "arguments": [ + { + "parts": [ + "x" + ] + } + ] + }, + { + "name": "trunc", + "arguments": [ + { + "parts": [ + "x" + ] + } + ] + } + ], + "from": { + "tables": [ + { + "table": { + "table": { + "database": "system", + "table": "numbers" + } + } + } + ] + }, + "limit": { + "type": "Integer", + "value": 20 + } + } + ] +} diff --git a/parser/testdata/00175_if_num_arrays/ast.json b/parser/testdata/00175_if_num_arrays/ast.json new file mode 100644 index 000000000..35aeeaf4e --- /dev/null +++ b/parser/testdata/00175_if_num_arrays/ast.json @@ -0,0 +1,76 @@ +{ + "selects": [ + { + "columns": [ + { + "expr": { + "condition": { + "left": { + "parts": [ + "number" + ] + }, + "op": "%", + "right": { + "type": "Integer", + "value": 2 + } + }, + "then": { + "type": "Array", + "value": [ + { + "type": "Integer", + "value": 1 + }, + { + "type": "Integer", + "value": 2 + } + ] + }, + "else": { + "type": "Array", + "value": [ + { + "type": "Integer", + "value": 3 + }, + { + "type": "Integer", + "value": 4 + }, + { + "type": "Integer", + "value": 5 + } + ] + } + }, + "alias": "res" + } + ], + "from": { + "tables": [ + { + "table": { + "table": { + "database": "system", + "table": "numbers" + } + } + } + ] + }, + "limit": { + "type": "Integer", + "value": 10 + }, + "format": { + "parts": [ + "TabSeparatedWithNamesAndTypes" + ] + } + } + ] +} diff --git a/parser/testdata/00198_group_by_empty_arrays/ast.json b/parser/testdata/00198_group_by_empty_arrays/ast.json new file mode 100644 index 000000000..10aa445a0 --- /dev/null +++ b/parser/testdata/00198_group_by_empty_arrays/ast.json @@ -0,0 +1,98 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "range", + "arguments": [ + { + "parts": [ + "x" + ] + } + ], + "alias": "k" + }, + { + "name": "count" + } + ], + "from": { + "tables": [ + { + "table": { + "table": { + "query": { + "selects": [ + { + "columns": [ + { + "expr": { + "condition": { + "left": { + "parts": [ + "number" + ] + }, + "op": "%", + "right": { + "type": "Integer", + "value": 2 + } + }, + "then": { + "parts": [ + "number" + ] + }, + "else": { + "type": "Integer", + "value": 0 + } + }, + "alias": "x" + } + ], + "from": { + "tables": [ + { + "table": { + "table": { + "database": "system", + "table": "numbers" + } + } + } + ] + }, + "limit": { + "type": "Integer", + "value": 10 + } + } + ] + } + } + } + } + ] + }, + "group_by": [ + { + "parts": [ + "k" + ] + } + ], + "order_by": [ + { + "expression": { + "parts": [ + "k" + ] + } + } + ] + } + ] +} diff --git a/parser/testdata/00320_between/ast.json b/parser/testdata/00320_between/ast.json new file mode 100644 index 000000000..eca67c1c0 --- /dev/null +++ b/parser/testdata/00320_between/ast.json @@ -0,0 +1,36 @@ +{ + "selects": [ + { + "columns": [ + { + "expr": { + "type": "Integer", + "value": 2 + }, + "low": { + "left": { + "type": "Integer", + "value": 1 + }, + "op": "+", + "right": { + "type": "Integer", + "value": 1 + } + }, + "high": { + "left": { + "type": "Integer", + "value": 3 + }, + "op": "-", + "right": { + "type": "Integer", + "value": 1 + } + } + } + ] + } + ] +} diff --git a/parser/testdata/00320_between/metadata.json b/parser/testdata/00320_between/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/00320_between/metadata.json +++ b/parser/testdata/00320_between/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/00337_shard_any_heavy/ast.json b/parser/testdata/00337_shard_any_heavy/ast.json new file mode 100644 index 000000000..e3c47ba30 --- /dev/null +++ b/parser/testdata/00337_shard_any_heavy/ast.json @@ -0,0 +1,90 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "anyHeavy", + "arguments": [ + { + "parts": [ + "x" + ] + } + ] + } + ], + "from": { + "tables": [ + { + "table": { + "table": { + "query": { + "selects": [ + { + "columns": [ + { + "expr": { + "condition": { + "left": { + "left": { + "name": "intHash64", + "arguments": [ + { + "parts": [ + "number" + ] + } + ] + }, + "op": "%", + "right": { + "type": "Integer", + "value": 100 + } + }, + "op": "\u003c", + "right": { + "type": "Integer", + "value": 60 + } + }, + "then": { + "type": "Integer", + "value": 999 + }, + "else": { + "parts": [ + "number" + ] + } + }, + "alias": "x" + } + ], + "from": { + "tables": [ + { + "table": { + "table": { + "database": "system", + "table": "numbers" + } + } + } + ] + }, + "limit": { + "type": "Integer", + "value": 100000 + } + } + ] + } + } + } + } + ] + } + } + ] +} diff --git a/parser/testdata/00500_point_in_polygon_nan/metadata.json b/parser/testdata/00500_point_in_polygon_nan/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/00500_point_in_polygon_nan/metadata.json +++ b/parser/testdata/00500_point_in_polygon_nan/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/00503_cast_const_nullable/metadata.json b/parser/testdata/00503_cast_const_nullable/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/00503_cast_const_nullable/metadata.json +++ b/parser/testdata/00503_cast_const_nullable/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/00516_is_inf_nan/metadata.json b/parser/testdata/00516_is_inf_nan/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/00516_is_inf_nan/metadata.json +++ b/parser/testdata/00516_is_inf_nan/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/00525_aggregate_functions_of_nullable_that_return_non_nullable/metadata.json b/parser/testdata/00525_aggregate_functions_of_nullable_that_return_non_nullable/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/00525_aggregate_functions_of_nullable_that_return_non_nullable/metadata.json +++ b/parser/testdata/00525_aggregate_functions_of_nullable_that_return_non_nullable/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/00547_named_tuples/metadata.json b/parser/testdata/00547_named_tuples/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/00547_named_tuples/metadata.json +++ b/parser/testdata/00547_named_tuples/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/00649_quantile_tdigest_negative/ast.json b/parser/testdata/00649_quantile_tdigest_negative/ast.json new file mode 100644 index 000000000..3ce20c970 --- /dev/null +++ b/parser/testdata/00649_quantile_tdigest_negative/ast.json @@ -0,0 +1,50 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "quantileTDigest", + "parameters": [ + { + "type": "Float", + "value": 0.5 + } + ], + "arguments": [ + { + "name": "arrayJoin", + "arguments": [ + { + "type": "Array", + "value": [ + { + "op": "-", + "operand": { + "type": "Integer", + "value": 1 + } + }, + { + "op": "-", + "operand": { + "type": "Integer", + "value": 2 + } + }, + { + "op": "-", + "operand": { + "type": "Integer", + "value": 3 + } + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/00834_not_between/ast.json b/parser/testdata/00834_not_between/ast.json new file mode 100644 index 000000000..fb9698abb --- /dev/null +++ b/parser/testdata/00834_not_between/ast.json @@ -0,0 +1,37 @@ +{ + "selects": [ + { + "columns": [ + { + "expr": { + "type": "Integer", + "value": 2 + }, + "not": true, + "low": { + "left": { + "type": "Integer", + "value": 2 + }, + "op": "+", + "right": { + "type": "Integer", + "value": 1 + } + }, + "high": { + "left": { + "type": "Integer", + "value": 4 + }, + "op": "-", + "right": { + "type": "Integer", + "value": 1 + } + } + } + ] + } + ] +} diff --git a/parser/testdata/00834_not_between/metadata.json b/parser/testdata/00834_not_between/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/00834_not_between/metadata.json +++ b/parser/testdata/00834_not_between/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01029_early_constant_folding/ast.json b/parser/testdata/01029_early_constant_folding/ast.json new file mode 100644 index 000000000..01db4048f --- /dev/null +++ b/parser/testdata/01029_early_constant_folding/ast.json @@ -0,0 +1,26 @@ +{ + "explain_type": "SYNTAX", + "statement": { + "selects": [ + { + "columns": [ + { + "type": "Integer", + "value": 1 + } + ], + "where": { + "left": { + "type": "Integer", + "value": 1 + }, + "op": "=", + "right": { + "type": "Integer", + "value": 0 + } + } + } + ] + } +} diff --git a/parser/testdata/01129_dict_get_join_lose_constness/ast.json b/parser/testdata/01129_dict_get_join_lose_constness/ast.json new file mode 100644 index 000000000..9f01a0784 --- /dev/null +++ b/parser/testdata/01129_dict_get_join_lose_constness/ast.json @@ -0,0 +1,11 @@ +{ + "if_exists": true, + "database": "system", + "table": "dict1", + "tables": [ + { + "database": "system", + "table": "dict1" + } + ] +} diff --git a/parser/testdata/01277_convert_field_to_type_logical_error/ast.json b/parser/testdata/01277_convert_field_to_type_logical_error/ast.json new file mode 100644 index 000000000..e8b4ece05 --- /dev/null +++ b/parser/testdata/01277_convert_field_to_type_logical_error/ast.json @@ -0,0 +1,48 @@ +{ + "selects": [ + { + "columns": [ + { + "op": "-", + "operand": { + "type": "Integer", + "value": 2487 + } + }, + { + "name": "globalNullIn", + "arguments": [ + { + "name": "toIntervalMinute", + "arguments": [ + { + "op": "-", + "operand": { + "type": "Integer", + "value": 88074 + } + } + ] + }, + { + "type": "String", + "value": "qEkek.." + } + ] + }, + { + "type": "Array", + "value": [ + { + "op": "-", + "operand": { + "type": "Float", + "value": 27.537293 + } + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01293_show_settings/metadata.json b/parser/testdata/01293_show_settings/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01293_show_settings/metadata.json +++ b/parser/testdata/01293_show_settings/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01300_polygon_convex_hull/ast.json b/parser/testdata/01300_polygon_convex_hull/ast.json new file mode 100644 index 000000000..c29b1f1b2 --- /dev/null +++ b/parser/testdata/01300_polygon_convex_hull/ast.json @@ -0,0 +1,93 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "polygonConvexHullCartesian", + "arguments": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 0 + }, + { + "type": "Float", + "value": 0 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 0 + }, + { + "type": "Float", + "value": 5 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 5 + }, + { + "type": "Float", + "value": 5 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 5 + }, + { + "type": "Float", + "value": 0 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 2 + }, + { + "type": "Float", + "value": 3 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01300_polygon_convex_hull/metadata.json b/parser/testdata/01300_polygon_convex_hull/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01300_polygon_convex_hull/metadata.json +++ b/parser/testdata/01300_polygon_convex_hull/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01300_svg/ast.json b/parser/testdata/01300_svg/ast.json new file mode 100644 index 000000000..eb44ba2f8 --- /dev/null +++ b/parser/testdata/01300_svg/ast.json @@ -0,0 +1,26 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "SVG", + "arguments": [ + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 0 + }, + { + "type": "Float", + "value": 0 + } + ] + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01300_svg/metadata.json b/parser/testdata/01300_svg/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01300_svg/metadata.json +++ b/parser/testdata/01300_svg/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01300_wkt/ast.json b/parser/testdata/01300_wkt/ast.json new file mode 100644 index 000000000..36ee5bc9e --- /dev/null +++ b/parser/testdata/01300_wkt/ast.json @@ -0,0 +1,26 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "wkt", + "arguments": [ + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 0 + }, + { + "type": "Float", + "value": 0 + } + ] + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01300_wkt/metadata.json b/parser/testdata/01300_wkt/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01300_wkt/metadata.json +++ b/parser/testdata/01300_wkt/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01301_polygons_within/ast.json b/parser/testdata/01301_polygons_within/ast.json new file mode 100644 index 000000000..a95ed056b --- /dev/null +++ b/parser/testdata/01301_polygons_within/ast.json @@ -0,0 +1,212 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "polygonsWithinCartesian", + "arguments": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 0 + }, + { + "type": "Integer", + "value": 0 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 0 + }, + { + "type": "Integer", + "value": 3 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 1 + }, + { + "type": "Float", + "value": 2.9 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 2 + }, + { + "type": "Float", + "value": 2.6 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 2.6 + }, + { + "type": "Integer", + "value": 2 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 2.9 + }, + { + "type": "Integer", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 3 + }, + { + "type": "Integer", + "value": 0 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 0 + }, + { + "type": "Integer", + "value": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 4 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 4 + }, + { + "type": "Float", + "value": 4 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 4 + }, + { + "type": "Float", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01301_polygons_within/metadata.json b/parser/testdata/01301_polygons_within/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01301_polygons_within/metadata.json +++ b/parser/testdata/01301_polygons_within/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01302_polygons_distance/ast.json b/parser/testdata/01302_polygons_distance/ast.json new file mode 100644 index 000000000..d68e9c29d --- /dev/null +++ b/parser/testdata/01302_polygons_distance/ast.json @@ -0,0 +1,212 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "polygonsDistanceCartesian", + "arguments": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 0 + }, + { + "type": "Integer", + "value": 0 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 0 + }, + { + "type": "Integer", + "value": 3 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 1 + }, + { + "type": "Float", + "value": 2.9 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 2 + }, + { + "type": "Float", + "value": 2.6 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 2.6 + }, + { + "type": "Integer", + "value": 2 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 2.9 + }, + { + "type": "Integer", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 3 + }, + { + "type": "Integer", + "value": 0 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 0 + }, + { + "type": "Integer", + "value": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 4 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 4 + }, + { + "type": "Float", + "value": 4 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 4 + }, + { + "type": "Float", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01302_polygons_distance/metadata.json b/parser/testdata/01302_polygons_distance/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01302_polygons_distance/metadata.json +++ b/parser/testdata/01302_polygons_distance/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01303_polygons_equals/ast.json b/parser/testdata/01303_polygons_equals/ast.json new file mode 100644 index 000000000..38e092066 --- /dev/null +++ b/parser/testdata/01303_polygons_equals/ast.json @@ -0,0 +1,212 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "polygonsEqualsCartesian", + "arguments": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 0 + }, + { + "type": "Integer", + "value": 0 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 0 + }, + { + "type": "Integer", + "value": 3 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 1 + }, + { + "type": "Float", + "value": 2.9 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 2 + }, + { + "type": "Float", + "value": 2.6 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 2.6 + }, + { + "type": "Integer", + "value": 2 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 2.9 + }, + { + "type": "Integer", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 3 + }, + { + "type": "Integer", + "value": 0 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 0 + }, + { + "type": "Integer", + "value": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 4 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 4 + }, + { + "type": "Float", + "value": 4 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 4 + }, + { + "type": "Float", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01303_polygons_equals/metadata.json b/parser/testdata/01303_polygons_equals/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01303_polygons_equals/metadata.json +++ b/parser/testdata/01303_polygons_equals/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01304_polygons_sym_difference/ast.json b/parser/testdata/01304_polygons_sym_difference/ast.json new file mode 100644 index 000000000..c0f71260d --- /dev/null +++ b/parser/testdata/01304_polygons_sym_difference/ast.json @@ -0,0 +1,212 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "polygonsSymDifferenceCartesian", + "arguments": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 0 + }, + { + "type": "Integer", + "value": 0 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 0 + }, + { + "type": "Integer", + "value": 3 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 1 + }, + { + "type": "Float", + "value": 2.9 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 2 + }, + { + "type": "Float", + "value": 2.6 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 2.6 + }, + { + "type": "Integer", + "value": 2 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 2.9 + }, + { + "type": "Integer", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 3 + }, + { + "type": "Integer", + "value": 0 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 0 + }, + { + "type": "Integer", + "value": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 4 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 4 + }, + { + "type": "Float", + "value": 4 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 4 + }, + { + "type": "Float", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01304_polygons_sym_difference/metadata.json b/parser/testdata/01304_polygons_sym_difference/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01304_polygons_sym_difference/metadata.json +++ b/parser/testdata/01304_polygons_sym_difference/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01305_polygons_union/ast.json b/parser/testdata/01305_polygons_union/ast.json new file mode 100644 index 000000000..e58909d4a --- /dev/null +++ b/parser/testdata/01305_polygons_union/ast.json @@ -0,0 +1,212 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "polygonsUnionCartesian", + "arguments": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 0 + }, + { + "type": "Float", + "value": 0 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 0 + }, + { + "type": "Float", + "value": 3 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 2.9 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 2 + }, + { + "type": "Float", + "value": 2.6 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 2.6 + }, + { + "type": "Float", + "value": 2 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 2.9 + }, + { + "type": "Integer", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 3 + }, + { + "type": "Float", + "value": 0 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 0 + }, + { + "type": "Float", + "value": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 4 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 4 + }, + { + "type": "Float", + "value": 4 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 4 + }, + { + "type": "Float", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01305_polygons_union/metadata.json b/parser/testdata/01305_polygons_union/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01305_polygons_union/metadata.json +++ b/parser/testdata/01305_polygons_union/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01306_polygons_intersection/ast.json b/parser/testdata/01306_polygons_intersection/ast.json new file mode 100644 index 000000000..4e6a59054 --- /dev/null +++ b/parser/testdata/01306_polygons_intersection/ast.json @@ -0,0 +1,212 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "polygonsIntersectionCartesian", + "arguments": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 0 + }, + { + "type": "Float", + "value": 0 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 0 + }, + { + "type": "Float", + "value": 3 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 2.9 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 2 + }, + { + "type": "Float", + "value": 2.6 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 2.6 + }, + { + "type": "Float", + "value": 2 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 2.9 + }, + { + "type": "Float", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 3 + }, + { + "type": "Float", + "value": 0 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 0 + }, + { + "type": "Float", + "value": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 4 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 4 + }, + { + "type": "Float", + "value": 4 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 4 + }, + { + "type": "Float", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01306_polygons_intersection/metadata.json b/parser/testdata/01306_polygons_intersection/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01306_polygons_intersection/metadata.json +++ b/parser/testdata/01306_polygons_intersection/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01307_polygon_perimeter/ast.json b/parser/testdata/01307_polygon_perimeter/ast.json new file mode 100644 index 000000000..6f10860dd --- /dev/null +++ b/parser/testdata/01307_polygon_perimeter/ast.json @@ -0,0 +1,93 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "polygonPerimeterCartesian", + "arguments": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 0 + }, + { + "type": "Float", + "value": 0 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 0 + }, + { + "type": "Float", + "value": 5 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 5 + }, + { + "type": "Float", + "value": 5 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 5 + }, + { + "type": "Float", + "value": 0 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 0 + }, + { + "type": "Float", + "value": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01307_polygon_perimeter/metadata.json b/parser/testdata/01307_polygon_perimeter/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01307_polygon_perimeter/metadata.json +++ b/parser/testdata/01307_polygon_perimeter/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01308_polygon_area/ast.json b/parser/testdata/01308_polygon_area/ast.json new file mode 100644 index 000000000..9f834d678 --- /dev/null +++ b/parser/testdata/01308_polygon_area/ast.json @@ -0,0 +1,80 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "polygonAreaCartesian", + "arguments": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 0 + }, + { + "type": "Float", + "value": 0 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 0 + }, + { + "type": "Float", + "value": 5 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 5 + }, + { + "type": "Float", + "value": 5 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 5 + }, + { + "type": "Float", + "value": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01308_polygon_area/metadata.json b/parser/testdata/01308_polygon_area/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01308_polygon_area/metadata.json +++ b/parser/testdata/01308_polygon_area/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01351_geohash_assert/metadata.json b/parser/testdata/01351_geohash_assert/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01351_geohash_assert/metadata.json +++ b/parser/testdata/01351_geohash_assert/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01352_add_datetime_bad_get/ast.json b/parser/testdata/01352_add_datetime_bad_get/ast.json new file mode 100644 index 000000000..7da29765c --- /dev/null +++ b/parser/testdata/01352_add_datetime_bad_get/ast.json @@ -0,0 +1,31 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "addMonths", + "arguments": [ + { + "name": "materialize", + "arguments": [ + { + "name": "toDateTime", + "arguments": [ + { + "type": "String", + "value": "2017-11-05 08:07:47" + } + ] + } + ] + }, + { + "type": "Float", + "value": 1 + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01352_add_datetime_bad_get/metadata.json b/parser/testdata/01352_add_datetime_bad_get/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01352_add_datetime_bad_get/metadata.json +++ b/parser/testdata/01352_add_datetime_bad_get/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01359_geodistance_loop/metadata.json b/parser/testdata/01359_geodistance_loop/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01359_geodistance_loop/metadata.json +++ b/parser/testdata/01359_geodistance_loop/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01423_if_nullable_cond/ast.json b/parser/testdata/01423_if_nullable_cond/ast.json new file mode 100644 index 000000000..7f51ebc0e --- /dev/null +++ b/parser/testdata/01423_if_nullable_cond/ast.json @@ -0,0 +1,65 @@ +{ + "selects": [ + { + "columns": [ + { + "expr": { + "condition": { + "left": { + "expr": { + "type": "Null", + "value": null + }, + "type": { + "name": "Nullable(UInt8)" + } + }, + "op": "=", + "right": { + "type": "Integer", + "value": 1 + } + }, + "then": { + "expr": { + "type": "Null", + "value": null + }, + "type": { + "name": "Nullable(UInt8)" + } + }, + "else": { + "op": "-", + "operand": { + "type": "Integer", + "value": 1 + } + } + }, + "alias": "x" + }, + { + "name": "toTypeName", + "arguments": [ + { + "parts": [ + "x" + ] + } + ] + }, + { + "name": "dumpColumnStructure", + "arguments": [ + { + "parts": [ + "x" + ] + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01426_geohash_constants/ast.json b/parser/testdata/01426_geohash_constants/ast.json new file mode 100644 index 000000000..a6f0874f6 --- /dev/null +++ b/parser/testdata/01426_geohash_constants/ast.json @@ -0,0 +1,33 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "geohashesInBox", + "arguments": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 2 + }, + { + "type": "Float", + "value": 3 + }, + { + "type": "Float", + "value": 4 + }, + { + "type": "Integer", + "value": 1 + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01426_geohash_constants/metadata.json b/parser/testdata/01426_geohash_constants/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01426_geohash_constants/metadata.json +++ b/parser/testdata/01426_geohash_constants/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01568_window_functions_distributed/metadata.json b/parser/testdata/01568_window_functions_distributed/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01568_window_functions_distributed/metadata.json +++ b/parser/testdata/01568_window_functions_distributed/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01581_to_int_inf_nan/metadata.json b/parser/testdata/01581_to_int_inf_nan/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01581_to_int_inf_nan/metadata.json +++ b/parser/testdata/01581_to_int_inf_nan/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01582_deterministic_function_with_predicate/ast.json b/parser/testdata/01582_deterministic_function_with_predicate/ast.json new file mode 100644 index 000000000..1d7315f2a --- /dev/null +++ b/parser/testdata/01582_deterministic_function_with_predicate/ast.json @@ -0,0 +1,97 @@ +{ + "explain_type": "SYNTAX", + "statement": { + "selects": [ + { + "columns": [ + { + "name": "count", + "arguments": [ + {} + ] + } + ], + "from": { + "tables": [ + { + "table": { + "table": { + "query": { + "selects": [ + { + "columns": [ + { + "parts": [ + "number" + ] + } + ], + "from": { + "tables": [ + { + "table": { + "table": { + "query": { + "selects": [ + { + "columns": [ + { + "parts": [ + "number" + ] + } + ], + "from": { + "tables": [ + { + "table": { + "table": { + "name": "numbers", + "arguments": [ + { + "type": "Integer", + "value": 1000000 + } + ] + } + } + } + ] + } + } + ] + } + } + } + } + ] + }, + "where": { + "left": { + "name": "rand64" + }, + "op": "\u003c", + "right": { + "left": { + "type": "Float", + "value": 0.01 + }, + "op": "*", + "right": { + "type": "Float", + "value": 18446744073709552000 + } + } + } + } + ] + } + } + } + } + ] + } + } + ] + } +} diff --git a/parser/testdata/01582_deterministic_function_with_predicate/metadata.json b/parser/testdata/01582_deterministic_function_with_predicate/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01582_deterministic_function_with_predicate/metadata.json +++ b/parser/testdata/01582_deterministic_function_with_predicate/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01602_modified_julian_day_msan/metadata.json b/parser/testdata/01602_modified_julian_day_msan/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01602_modified_julian_day_msan/metadata.json +++ b/parser/testdata/01602_modified_julian_day_msan/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01611_constant_folding_subqueries/metadata.json b/parser/testdata/01611_constant_folding_subqueries/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01611_constant_folding_subqueries/metadata.json +++ b/parser/testdata/01611_constant_folding_subqueries/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01634_sum_map_nulls/ast.json b/parser/testdata/01634_sum_map_nulls/ast.json new file mode 100644 index 000000000..ded8f6fe8 --- /dev/null +++ b/parser/testdata/01634_sum_map_nulls/ast.json @@ -0,0 +1,71 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "initializeAggregation", + "arguments": [ + { + "type": "String", + "value": "sumMap" + }, + { + "type": "Array", + "value": [ + { + "type": "Integer", + "value": 1 + }, + { + "type": "Integer", + "value": 2 + }, + { + "type": "Integer", + "value": 1 + } + ] + }, + { + "type": "Array", + "value": [ + { + "type": "Integer", + "value": 1 + }, + { + "type": "Integer", + "value": 1 + }, + { + "type": "Integer", + "value": 1 + } + ] + }, + { + "type": "Array", + "value": [ + { + "op": "-", + "operand": { + "type": "Integer", + "value": 1 + } + }, + { + "type": "Null", + "value": null + }, + { + "type": "Integer", + "value": 10 + } + ] + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01642_if_nullable_regression/metadata.json b/parser/testdata/01642_if_nullable_regression/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01642_if_nullable_regression/metadata.json +++ b/parser/testdata/01642_if_nullable_regression/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01659_array_aggregation_ubsan/ast.json b/parser/testdata/01659_array_aggregation_ubsan/ast.json new file mode 100644 index 000000000..c998f8fb9 --- /dev/null +++ b/parser/testdata/01659_array_aggregation_ubsan/ast.json @@ -0,0 +1,32 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "arraySum", + "arguments": [ + { + "type": "Array", + "value": [ + { + "op": "-", + "operand": { + "type": "Integer", + "value": 9000000000000000000 + } + }, + { + "op": "-", + "operand": { + "type": "Integer", + "value": 9000000000000000000 + } + } + ] + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01664_decimal_ubsan/metadata.json b/parser/testdata/01664_decimal_ubsan/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01664_decimal_ubsan/metadata.json +++ b/parser/testdata/01664_decimal_ubsan/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01667_aes_args_check/ast.json b/parser/testdata/01667_aes_args_check/ast.json new file mode 100644 index 000000000..e2998cd44 --- /dev/null +++ b/parser/testdata/01667_aes_args_check/ast.json @@ -0,0 +1,45 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "encrypt", + "arguments": [ + { + "type": "String", + "value": "aes-128-ecb" + }, + { + "type": "Array", + "value": [ + { + "type": "Integer", + "value": 1 + }, + { + "op": "-", + "operand": { + "type": "Integer", + "value": 1 + } + }, + { + "type": "Integer", + "value": 0 + }, + { + "type": "Null", + "value": null + } + ] + }, + { + "type": "String", + "value": "text" + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01677_bit_float/metadata.json b/parser/testdata/01677_bit_float/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01677_bit_float/metadata.json +++ b/parser/testdata/01677_bit_float/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01679_format_readable_time_delta_inf/metadata.json b/parser/testdata/01679_format_readable_time_delta_inf/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01679_format_readable_time_delta_inf/metadata.json +++ b/parser/testdata/01679_format_readable_time_delta_inf/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01716_array_difference_overflow/ast.json b/parser/testdata/01716_array_difference_overflow/ast.json new file mode 100644 index 000000000..6559f3d2d --- /dev/null +++ b/parser/testdata/01716_array_difference_overflow/ast.json @@ -0,0 +1,29 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "arrayDifference", + "arguments": [ + { + "type": "Array", + "value": [ + { + "type": "Integer", + "value": 65536 + }, + { + "op": "-", + "operand": { + "type": "Integer", + "value": 9223372036854775808 + } + } + ] + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01773_datetime64_add_ubsan/metadata.json b/parser/testdata/01773_datetime64_add_ubsan/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01773_datetime64_add_ubsan/metadata.json +++ b/parser/testdata/01773_datetime64_add_ubsan/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01781_map_op_ubsan/ast.json b/parser/testdata/01781_map_op_ubsan/ast.json new file mode 100644 index 000000000..1c9cb06de --- /dev/null +++ b/parser/testdata/01781_map_op_ubsan/ast.json @@ -0,0 +1,306 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "toInt32", + "arguments": [ + { + "type": "Array", + "value": [ + { + "name": "toUInt8", + "arguments": [ + { + "type": "Null", + "value": null + } + ] + } + ] + }, + { + "type": "Null", + "value": null + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "name": "mapSubtract", + "arguments": [ + { + "type": "Tuple", + "value": [ + { + "type": "Array", + "value": [ + { + "name": "toUInt8", + "arguments": [ + { + "type": "Integer", + "value": 256 + } + ] + }, + { + "type": "Integer", + "value": 10 + } + ] + }, + { + "type": "Array", + "value": [ + { + "name": "toInt32", + "arguments": [ + { + "op": "-", + "operand": { + "type": "Integer", + "value": 9223372036854775808 + } + } + ] + }, + { + "type": "Integer", + "value": 1025 + } + ] + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Array", + "value": [ + { + "name": "toUInt8", + "arguments": [ + { + "type": "Integer", + "value": 65535 + } + ] + }, + { + "type": "Integer", + "value": 0 + } + ] + }, + { + "type": "Array", + "value": [ + { + "name": "toInt16", + "arguments": [ + { + "type": "Float", + "value": 0 + } + ] + }, + { + "op": "-", + "operand": { + "type": "Integer", + "value": 9223372036854775808 + } + } + ] + } + ] + } + ] + }, + { + "type": "Array", + "value": [ + { + "name": "toUInt8", + "arguments": [ + { + "op": "-", + "operand": { + "type": "Integer", + "value": 1 + } + } + ] + }, + { + "name": "toInt32", + "arguments": [ + { + "type": "Tuple", + "value": [ + { + "type": "Array", + "value": [ + { + "name": "toUInt8", + "arguments": [ + { + "type": "Integer", + "value": 9223372036854775807 + } + ] + }, + { + "op": "-", + "operand": { + "type": "Integer", + "value": 1 + } + } + ] + }, + { + "type": "Array", + "value": [ + { + "name": "toInt32", + "arguments": [ + { + "type": "Integer", + "value": 255 + } + ] + }, + { + "type": "Integer", + "value": 65536 + } + ] + } + ] + }, + { + "type": "Null", + "value": null + } + ] + } + ] + } + ] + }, + { + "name": "toUInt8", + "arguments": [ + { + "type": "Tuple", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Integer", + "value": 2 + }, + { + "type": "Integer", + "value": 9223372036854775807 + } + ] + }, + { + "type": "Array", + "value": [ + { + "name": "toFloat32", + "arguments": [ + { + "type": "String", + "value": "0.0000065536" + } + ] + }, + { + "type": "Integer", + "value": 2 + } + ] + } + ] + }, + { + "type": "Integer", + "value": 9223372036854775807 + }, + { + "type": "Null", + "value": null + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Array", + "value": [ + { + "name": "toUInt8", + "arguments": [ + { + "type": "Integer", + "value": 1024 + } + ] + }, + { + "type": "Integer", + "value": 255 + } + ] + }, + { + "name": "toUInt8", + "arguments": [ + { + "type": "Integer", + "value": 3 + } + ] + }, + { + "type": "Array", + "value": [ + { + "name": "toInt16", + "arguments": [ + { + "op": "-", + "operand": { + "type": "Integer", + "value": 2 + } + } + ] + } + ] + } + ] + }, + { + "type": "Array", + "value": [ + { + "type": "Null", + "value": null + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/01781_map_op_ubsan/metadata.json b/parser/testdata/01781_map_op_ubsan/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01781_map_op_ubsan/metadata.json +++ b/parser/testdata/01781_map_op_ubsan/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01840_tupleElement_formatting_fuzzer/ast.json b/parser/testdata/01840_tupleElement_formatting_fuzzer/ast.json new file mode 100644 index 000000000..5030e6aa7 --- /dev/null +++ b/parser/testdata/01840_tupleElement_formatting_fuzzer/ast.json @@ -0,0 +1,24 @@ +{ + "explain_type": "AST", + "statement": { + "selects": [ + { + "columns": [ + { + "name": "tupleElement", + "arguments": [ + { + "type": "Integer", + "value": 255 + }, + { + "type": "Integer", + "value": 100 + } + ] + } + ] + } + ] + } +} diff --git a/parser/testdata/01852_cast_operator/metadata.json b/parser/testdata/01852_cast_operator/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/01852_cast_operator/metadata.json +++ b/parser/testdata/01852_cast_operator/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/01856_create_function/ast.json b/parser/testdata/01856_create_function/ast.json new file mode 100644 index 000000000..55472c9fc --- /dev/null +++ b/parser/testdata/01856_create_function/ast.json @@ -0,0 +1,32 @@ +{ + "create_function": true, + "function_name": "01856_test_function_0", + "function_body": { + "parameters": [ + "a", + "b", + "c" + ], + "body": { + "left": { + "left": { + "parts": [ + "a" + ] + }, + "op": "*", + "right": { + "parts": [ + "b" + ] + } + }, + "op": "*", + "right": { + "parts": [ + "c" + ] + } + } + } +} diff --git a/parser/testdata/01881_negate_formatting/ast.json b/parser/testdata/01881_negate_formatting/ast.json new file mode 100644 index 000000000..bd6839363 --- /dev/null +++ b/parser/testdata/01881_negate_formatting/ast.json @@ -0,0 +1,18 @@ +{ + "explain_type": "SYNTAX", + "statement": { + "selects": [ + { + "columns": [ + { + "op": "-", + "operand": { + "type": "Integer", + "value": 1 + } + } + ] + } + ] + } +} diff --git a/parser/testdata/02007_ipv4_and_ipv6_to_and_from_string/metadata.json b/parser/testdata/02007_ipv4_and_ipv6_to_and_from_string/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02007_ipv4_and_ipv6_to_and_from_string/metadata.json +++ b/parser/testdata/02007_ipv4_and_ipv6_to_and_from_string/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02029_quantile_sanitizer/ast.json b/parser/testdata/02029_quantile_sanitizer/ast.json new file mode 100644 index 000000000..a6b7328b9 --- /dev/null +++ b/parser/testdata/02029_quantile_sanitizer/ast.json @@ -0,0 +1,35 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "quantileTDigestWeighted", + "parameters": [ + { + "op": "-", + "operand": { + "type": "Float", + "value": 0 + } + } + ], + "arguments": [ + { + "name": "toDateTime", + "arguments": [ + { + "type": "Float", + "value": 10000000000 + } + ] + }, + { + "type": "Integer", + "value": 1 + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/02029_quantile_sanitizer/metadata.json b/parser/testdata/02029_quantile_sanitizer/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02029_quantile_sanitizer/metadata.json +++ b/parser/testdata/02029_quantile_sanitizer/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02096_sql_user_defined_function_alias/ast.json b/parser/testdata/02096_sql_user_defined_function_alias/ast.json new file mode 100644 index 000000000..efff67961 --- /dev/null +++ b/parser/testdata/02096_sql_user_defined_function_alias/ast.json @@ -0,0 +1,21 @@ +{ + "create_function": true, + "function_name": "02096_test_function", + "function_body": { + "parameters": [ + "x" + ], + "body": { + "left": { + "parts": [ + "x" + ] + }, + "op": "+", + "right": { + "type": "Integer", + "value": 1 + } + } + } +} diff --git a/parser/testdata/02098_sql_user_defined_functions_aliases/ast.json b/parser/testdata/02098_sql_user_defined_functions_aliases/ast.json new file mode 100644 index 000000000..8f39213bc --- /dev/null +++ b/parser/testdata/02098_sql_user_defined_functions_aliases/ast.json @@ -0,0 +1,32 @@ +{ + "create_function": true, + "function_name": "02098_alias_function", + "function_body": { + "parameters": [ + "x" + ], + "body": { + "left": { + "expr": { + "left": { + "parts": [ + "x" + ] + }, + "op": "*", + "right": { + "type": "Integer", + "value": 2 + } + }, + "alias": "x_doubled" + }, + "op": "+", + "right": { + "parts": [ + "x_doubled" + ] + } + } + } +} diff --git a/parser/testdata/02099_sql_user_defined_functions_lambda/ast.json b/parser/testdata/02099_sql_user_defined_functions_lambda/ast.json new file mode 100644 index 000000000..1397bfe3e --- /dev/null +++ b/parser/testdata/02099_sql_user_defined_functions_lambda/ast.json @@ -0,0 +1,36 @@ +{ + "create_function": true, + "function_name": "02099_lambda_function", + "function_body": { + "parameters": [ + "x" + ], + "body": { + "name": "arrayMap", + "arguments": [ + { + "parameters": [ + "array_element" + ], + "body": { + "left": { + "parts": [ + "array_element" + ] + }, + "op": "*", + "right": { + "type": "Integer", + "value": 2 + } + } + }, + { + "parts": [ + "x" + ] + } + ] + } + } +} diff --git a/parser/testdata/02101_sql_user_defined_functions_create_or_replace/ast.json b/parser/testdata/02101_sql_user_defined_functions_create_or_replace/ast.json new file mode 100644 index 000000000..fd27c0927 --- /dev/null +++ b/parser/testdata/02101_sql_user_defined_functions_create_or_replace/ast.json @@ -0,0 +1,22 @@ +{ + "or_replace": true, + "create_function": true, + "function_name": "02101_test_function", + "function_body": { + "parameters": [ + "x" + ], + "body": { + "left": { + "parts": [ + "x" + ] + }, + "op": "+", + "right": { + "type": "Integer", + "value": 1 + } + } + } +} diff --git a/parser/testdata/02101_sql_user_defined_functions_drop_if_exists/ast.json b/parser/testdata/02101_sql_user_defined_functions_drop_if_exists/ast.json new file mode 100644 index 000000000..7f05de252 --- /dev/null +++ b/parser/testdata/02101_sql_user_defined_functions_drop_if_exists/ast.json @@ -0,0 +1,21 @@ +{ + "create_function": true, + "function_name": "02101_test_function", + "function_body": { + "parameters": [ + "x" + ], + "body": { + "left": { + "parts": [ + "x" + ] + }, + "op": "+", + "right": { + "type": "Integer", + "value": 1 + } + } + } +} diff --git a/parser/testdata/02102_sql_user_defined_functions_create_if_not_exists/ast.json b/parser/testdata/02102_sql_user_defined_functions_create_if_not_exists/ast.json new file mode 100644 index 000000000..d2c31b4a5 --- /dev/null +++ b/parser/testdata/02102_sql_user_defined_functions_create_if_not_exists/ast.json @@ -0,0 +1,22 @@ +{ + "if_not_exists": true, + "create_function": true, + "function_name": "02102_test_function", + "function_body": { + "parameters": [ + "x" + ], + "body": { + "left": { + "parts": [ + "x" + ] + }, + "op": "+", + "right": { + "type": "Integer", + "value": 1 + } + } + } +} diff --git a/parser/testdata/02103_sql_user_defined_functions_composition/ast.json b/parser/testdata/02103_sql_user_defined_functions_composition/ast.json new file mode 100644 index 000000000..6614bbad1 --- /dev/null +++ b/parser/testdata/02103_sql_user_defined_functions_composition/ast.json @@ -0,0 +1,21 @@ +{ + "create_function": true, + "function_name": "02103_test_function", + "function_body": { + "parameters": [ + "x" + ], + "body": { + "left": { + "parts": [ + "x" + ] + }, + "op": "+", + "right": { + "type": "Integer", + "value": 1 + } + } + } +} diff --git a/parser/testdata/02125_recursive_sql_user_defined_functions/ast.json b/parser/testdata/02125_recursive_sql_user_defined_functions/ast.json new file mode 100644 index 000000000..ec2993885 --- /dev/null +++ b/parser/testdata/02125_recursive_sql_user_defined_functions/ast.json @@ -0,0 +1,4 @@ +{ + "if_exists": true, + "function": "02125_function" +} diff --git a/parser/testdata/02126_identity_user_defined_function/ast.json b/parser/testdata/02126_identity_user_defined_function/ast.json new file mode 100644 index 000000000..96798350a --- /dev/null +++ b/parser/testdata/02126_identity_user_defined_function/ast.json @@ -0,0 +1,4 @@ +{ + "if_exists": true, + "function": "02126_function" +} diff --git a/parser/testdata/02136_scalar_subquery_metrics/metadata.json b/parser/testdata/02136_scalar_subquery_metrics/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02136_scalar_subquery_metrics/metadata.json +++ b/parser/testdata/02136_scalar_subquery_metrics/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02148_cast_type_parsing/metadata.json b/parser/testdata/02148_cast_type_parsing/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02148_cast_type_parsing/metadata.json +++ b/parser/testdata/02148_cast_type_parsing/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02148_sql_user_defined_function_subquery/ast.json b/parser/testdata/02148_sql_user_defined_function_subquery/ast.json new file mode 100644 index 000000000..460584272 --- /dev/null +++ b/parser/testdata/02148_sql_user_defined_function_subquery/ast.json @@ -0,0 +1,4 @@ +{ + "if_exists": true, + "function": "02148_test_function" +} diff --git a/parser/testdata/02181_sql_user_defined_functions_invalid_lambda/ast.json b/parser/testdata/02181_sql_user_defined_functions_invalid_lambda/ast.json new file mode 100644 index 000000000..129396c55 --- /dev/null +++ b/parser/testdata/02181_sql_user_defined_functions_invalid_lambda/ast.json @@ -0,0 +1,32 @@ +{ + "create_function": true, + "function_name": "02181_invalid_lambda", + "function_body": { + "name": "lambda", + "arguments": [ + { + "left": { + "expr": { + "left": { + "parts": [ + "x" + ] + }, + "op": "*", + "right": { + "type": "Integer", + "value": 2 + } + }, + "alias": "x_doubled" + }, + "op": "+", + "right": { + "parts": [ + "x_doubled" + ] + } + } + ] + } +} diff --git a/parser/testdata/02210_processors_profile_log/ast.json b/parser/testdata/02210_processors_profile_log/ast.json new file mode 100644 index 000000000..4f6a98065 --- /dev/null +++ b/parser/testdata/02210_processors_profile_log/ast.json @@ -0,0 +1,20 @@ +{ + "explain_type": "PIPELINE", + "statement": { + "selects": [ + { + "columns": [ + { + "name": "sleep", + "arguments": [ + { + "type": "Integer", + "value": 1 + } + ] + } + ] + } + ] + } +} diff --git a/parser/testdata/02220_array_join_format/ast.json b/parser/testdata/02220_array_join_format/ast.json new file mode 100644 index 000000000..ca0b845a1 --- /dev/null +++ b/parser/testdata/02220_array_join_format/ast.json @@ -0,0 +1,71 @@ +{ + "explain_type": "SYNTAX", + "statement": { + "selects": [ + { + "columns": [ + {} + ], + "from": { + "tables": [ + { + "table": { + "table": { + "query": { + "selects": [ + { + "columns": [ + { + "name": "range", + "arguments": [ + { + "type": "Integer", + "value": 0 + }, + { + "type": "Integer", + "value": 10 + } + ], + "alias": "range_" + }, + { + "parts": [ + "point_" + ] + } + ], + "from": { + "tables": [ + { + "table": { + "table": { + "database": "system", + "table": "one" + } + } + } + ] + }, + "array_join": { + "columns": [ + { + "parts": [ + "range_" + ], + "alias": "point_" + } + ] + } + } + ] + } + } + } + } + ] + } + } + ] + } +} diff --git a/parser/testdata/02245_s3_schema_desc/metadata.json b/parser/testdata/02245_s3_schema_desc/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02245_s3_schema_desc/metadata.json +++ b/parser/testdata/02245_s3_schema_desc/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02292_create_function_validate/ast.json b/parser/testdata/02292_create_function_validate/ast.json new file mode 100644 index 000000000..ade95b1cd --- /dev/null +++ b/parser/testdata/02292_create_function_validate/ast.json @@ -0,0 +1,9 @@ +{ + "create_function": true, + "function_name": "foo", + "function_body": { + "parts": [ + "x" + ] + } +} diff --git a/parser/testdata/02313_avro_records_and_maps/metadata.json b/parser/testdata/02313_avro_records_and_maps/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02313_avro_records_and_maps/metadata.json +++ b/parser/testdata/02313_avro_records_and_maps/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02315_replace_multiif_to_if/ast.json b/parser/testdata/02315_replace_multiif_to_if/ast.json new file mode 100644 index 000000000..2e6729bcd --- /dev/null +++ b/parser/testdata/02315_replace_multiif_to_if/ast.json @@ -0,0 +1,59 @@ +{ + "explain_type": "SYNTAX", + "statement": { + "selects": [ + { + "columns": [ + { + "name": "multiIf", + "arguments": [ + { + "left": { + "parts": [ + "number" + ] + }, + "op": "=", + "right": { + "type": "Integer", + "value": 0 + } + }, + { + "type": "Null", + "value": null + }, + { + "name": "toNullable", + "arguments": [ + { + "parts": [ + "number" + ] + } + ] + } + ] + } + ], + "from": { + "tables": [ + { + "table": { + "table": { + "name": "numbers", + "arguments": [ + { + "type": "Integer", + "value": 10000 + } + ] + } + } + } + ] + } + } + ] + } +} diff --git a/parser/testdata/02366_union_decimal_conversion/metadata.json b/parser/testdata/02366_union_decimal_conversion/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02366_union_decimal_conversion/metadata.json +++ b/parser/testdata/02366_union_decimal_conversion/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02377_executable_function_settings/ast.json b/parser/testdata/02377_executable_function_settings/ast.json new file mode 100644 index 000000000..1da331b78 --- /dev/null +++ b/parser/testdata/02377_executable_function_settings/ast.json @@ -0,0 +1,37 @@ +{ + "explain_type": "SYNTAX", + "statement": { + "selects": [ + { + "columns": [ + {} + ], + "from": { + "tables": [ + { + "table": { + "table": { + "name": "executable", + "arguments": [ + { + "type": "String", + "value": "" + }, + { + "type": "String", + "value": "JSON" + }, + { + "type": "String", + "value": "data String" + } + ] + } + } + } + ] + } + } + ] + } +} diff --git a/parser/testdata/02383_schema_inference_hints/metadata.json b/parser/testdata/02383_schema_inference_hints/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02383_schema_inference_hints/metadata.json +++ b/parser/testdata/02383_schema_inference_hints/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02409_url_format_detection/metadata.json b/parser/testdata/02409_url_format_detection/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02409_url_format_detection/metadata.json +++ b/parser/testdata/02409_url_format_detection/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02410_csv_empty_fields_inference/metadata.json b/parser/testdata/02410_csv_empty_fields_inference/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02410_csv_empty_fields_inference/metadata.json +++ b/parser/testdata/02410_csv_empty_fields_inference/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02416_input_json_formats/metadata.json b/parser/testdata/02416_input_json_formats/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02416_input_json_formats/metadata.json +++ b/parser/testdata/02416_input_json_formats/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02427_column_nullable_ubsan/ast.json b/parser/testdata/02427_column_nullable_ubsan/ast.json new file mode 100644 index 000000000..987a70958 --- /dev/null +++ b/parser/testdata/02427_column_nullable_ubsan/ast.json @@ -0,0 +1,125 @@ +{ + "selects": [ + { + "columns": [ + {} + ], + "from": { + "tables": [ + { + "table": { + "table": { + "query": { + "selects": [ + { + "columns": [ + {} + ], + "from": { + "tables": [ + { + "table": { + "table": { + "query": { + "selects": [ + { + "columns": [ + { + "expr": { + "type": "Integer", + "value": 0 + }, + "alias": "a" + }, + { + "name": "toNullable", + "arguments": [ + { + "parts": [ + "number" + ] + } + ], + "alias": "b" + }, + { + "name": "toString", + "arguments": [ + { + "parts": [ + "number" + ] + } + ], + "alias": "c" + } + ], + "from": { + "tables": [ + { + "table": { + "table": { + "name": "numbers", + "arguments": [ + { + "type": "Float", + "value": 1000000 + } + ] + } + } + } + ] + } + } + ] + } + } + } + } + ] + }, + "order_by": [ + { + "expression": { + "parts": [ + "a" + ] + }, + "descending": true + }, + { + "expression": { + "parts": [ + "b" + ] + }, + "descending": true + }, + { + "expression": { + "parts": [ + "c" + ] + } + } + ], + "limit": { + "type": "Integer", + "value": 1500 + } + } + ] + } + } + } + } + ] + }, + "limit": { + "type": "Integer", + "value": 10 + } + } + ] +} diff --git a/parser/testdata/02427_column_nullable_ubsan/metadata.json b/parser/testdata/02427_column_nullable_ubsan/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02427_column_nullable_ubsan/metadata.json +++ b/parser/testdata/02427_column_nullable_ubsan/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02455_duplicate_column_names_in_schema_inference/metadata.json b/parser/testdata/02455_duplicate_column_names_in_schema_inference/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02455_duplicate_column_names_in_schema_inference/metadata.json +++ b/parser/testdata/02455_duplicate_column_names_in_schema_inference/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02457_s3_cluster_schema_inference/metadata.json b/parser/testdata/02457_s3_cluster_schema_inference/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02457_s3_cluster_schema_inference/metadata.json +++ b/parser/testdata/02457_s3_cluster_schema_inference/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02477_is_null_parser/ast.json b/parser/testdata/02477_is_null_parser/ast.json new file mode 100644 index 000000000..ce77ba2a3 --- /dev/null +++ b/parser/testdata/02477_is_null_parser/ast.json @@ -0,0 +1,27 @@ +{ + "explain_type": "SYNTAX", + "statement": { + "selects": [ + { + "columns": [ + { + "expr": { + "left": { + "expr": { + "type": "Integer", + "value": 1 + } + }, + "op": "+", + "right": { + "type": "Integer", + "value": 1 + } + }, + "not": true + } + ] + } + ] + } +} diff --git a/parser/testdata/02560_window_ntile/metadata.json b/parser/testdata/02560_window_ntile/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02560_window_ntile/metadata.json +++ b/parser/testdata/02560_window_ntile/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02587_csv_big_numbers_inference/metadata.json b/parser/testdata/02587_csv_big_numbers_inference/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02587_csv_big_numbers_inference/metadata.json +++ b/parser/testdata/02587_csv_big_numbers_inference/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02674_date_int_string_json_inference/metadata.json b/parser/testdata/02674_date_int_string_json_inference/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02674_date_int_string_json_inference/metadata.json +++ b/parser/testdata/02674_date_int_string_json_inference/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02752_is_null_priority/ast.json b/parser/testdata/02752_is_null_priority/ast.json new file mode 100644 index 000000000..fbefc864f --- /dev/null +++ b/parser/testdata/02752_is_null_priority/ast.json @@ -0,0 +1,42 @@ +{ + "explain_type": "AST", + "statement": { + "selects": [ + { + "columns": [ + { + "expr": { + "left": { + "parts": [ + "a" + ] + }, + "op": "*", + "right": { + "parts": [ + "b" + ] + } + } + }, + { + "expr": { + "left": { + "parts": [ + "a" + ] + }, + "op": "*", + "right": { + "parts": [ + "b" + ] + } + }, + "not": true + } + ] + } + ] + } +} diff --git a/parser/testdata/02784_schema_inference_null_as_default/metadata.json b/parser/testdata/02784_schema_inference_null_as_default/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02784_schema_inference_null_as_default/metadata.json +++ b/parser/testdata/02784_schema_inference_null_as_default/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02795_full_join_assert_cast/metadata.json b/parser/testdata/02795_full_join_assert_cast/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02795_full_join_assert_cast/metadata.json +++ b/parser/testdata/02795_full_join_assert_cast/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02797_transform_narrow_types/ast.json b/parser/testdata/02797_transform_narrow_types/ast.json new file mode 100644 index 000000000..9dd9e41f7 --- /dev/null +++ b/parser/testdata/02797_transform_narrow_types/ast.json @@ -0,0 +1,53 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "transform", + "arguments": [ + { + "op": "-", + "operand": { + "type": "Integer", + "value": 1 + } + }, + { + "type": "Array", + "value": [ + { + "op": "-", + "operand": { + "type": "Integer", + "value": 1 + } + }, + { + "type": "Integer", + "value": 2 + } + ] + }, + { + "type": "Array", + "value": [ + { + "type": "String", + "value": "f" + }, + { + "type": "String", + "value": "s" + } + ] + }, + { + "type": "String", + "value": "g" + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/02832_integer_type_inference/ast.json b/parser/testdata/02832_integer_type_inference/ast.json new file mode 100644 index 000000000..fe67a30bb --- /dev/null +++ b/parser/testdata/02832_integer_type_inference/ast.json @@ -0,0 +1,31 @@ +{ + "selects": [ + { + "columns": [ + { + "type": "Array", + "value": [ + { + "op": "-", + "operand": { + "type": "Integer", + "value": 4741124612489978151 + } + }, + { + "op": "-", + "operand": { + "type": "Integer", + "value": 3236599669630092879 + } + }, + { + "type": "Integer", + "value": 5607475129431807682 + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/02832_transform_fixed_string_no_default/metadata.json b/parser/testdata/02832_transform_fixed_string_no_default/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02832_transform_fixed_string_no_default/metadata.json +++ b/parser/testdata/02832_transform_fixed_string_no_default/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02874_parse_json_as_json_each_row_on_no_metadata/metadata.json b/parser/testdata/02874_parse_json_as_json_each_row_on_no_metadata/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02874_parse_json_as_json_each_row_on_no_metadata/metadata.json +++ b/parser/testdata/02874_parse_json_as_json_each_row_on_no_metadata/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02876_s3_cluster_schema_inference_names_with_spaces/metadata.json b/parser/testdata/02876_s3_cluster_schema_inference_names_with_spaces/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02876_s3_cluster_schema_inference_names_with_spaces/metadata.json +++ b/parser/testdata/02876_s3_cluster_schema_inference_names_with_spaces/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02889_system_drop_format_schema/ast.json b/parser/testdata/02889_system_drop_format_schema/ast.json new file mode 100644 index 000000000..30a1b7467 --- /dev/null +++ b/parser/testdata/02889_system_drop_format_schema/ast.json @@ -0,0 +1,6 @@ +{ + "explain_type": "SYNTAX", + "statement": { + "command": "DROP FORMAT SCHEMA CACHE" + } +} diff --git a/parser/testdata/02893_system_drop_schema_cache_format/ast.json b/parser/testdata/02893_system_drop_schema_cache_format/ast.json new file mode 100644 index 000000000..e342ebf48 --- /dev/null +++ b/parser/testdata/02893_system_drop_schema_cache_format/ast.json @@ -0,0 +1,6 @@ +{ + "explain_type": "SYNTAX", + "statement": { + "command": "drop schema cache for hdfs" + } +} diff --git a/parser/testdata/02901_analyzer_recursive_window/ast.json b/parser/testdata/02901_analyzer_recursive_window/ast.json new file mode 100644 index 000000000..f2483f64c --- /dev/null +++ b/parser/testdata/02901_analyzer_recursive_window/ast.json @@ -0,0 +1,26 @@ +{ + "selects": [ + { + "columns": [ + { + "type": "Integer", + "value": 1 + } + ], + "window": [ + { + "name": "x", + "spec": { + "partition_by": [ + { + "parts": [ + "x" + ] + } + ] + } + } + ] + } + ] +} diff --git a/parser/testdata/02921_bit_hamming_distance_big_int/metadata.json b/parser/testdata/02921_bit_hamming_distance_big_int/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02921_bit_hamming_distance_big_int/metadata.json +++ b/parser/testdata/02921_bit_hamming_distance_big_int/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02922_respect_nulls_extensive/metadata.json b/parser/testdata/02922_respect_nulls_extensive/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02922_respect_nulls_extensive/metadata.json +++ b/parser/testdata/02922_respect_nulls_extensive/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02960_partition_by_udf/ast.json b/parser/testdata/02960_partition_by_udf/ast.json new file mode 100644 index 000000000..94db0ac2b --- /dev/null +++ b/parser/testdata/02960_partition_by_udf/ast.json @@ -0,0 +1,4 @@ +{ + "if_exists": true, + "function": "f1" +} diff --git a/parser/testdata/02982_dont_infer_exponent_floats/metadata.json b/parser/testdata/02982_dont_infer_exponent_floats/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02982_dont_infer_exponent_floats/metadata.json +++ b/parser/testdata/02982_dont_infer_exponent_floats/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/02982_minmax_nan_null_order/metadata.json b/parser/testdata/02982_minmax_nan_null_order/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/02982_minmax_nan_null_order/metadata.json +++ b/parser/testdata/02982_minmax_nan_null_order/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/03031_low_cardinality_logical_error/ast.json b/parser/testdata/03031_low_cardinality_logical_error/ast.json index 0637f6dd5..dd813a7fe 100644 --- a/parser/testdata/03031_low_cardinality_logical_error/ast.json +++ b/parser/testdata/03031_low_cardinality_logical_error/ast.json @@ -15,46 +15,44 @@ "columns": [ { "expr": { - "expr": { - "type": "Array", - "value": [ - { - "name": "toString", - "arguments": [ - { - "left": { - "parts": [ - "number" - ] - }, - "op": "%", - "right": { - "type": "Integer", - "value": 2 - } - } - ] - } - ] - }, - "type": { - "name": "Array", - "parameters": [ - { - "name": "LowCardinality", - "parameters": [ - { - "name": "String" + "type": "Array", + "value": [ + { + "name": "toString", + "arguments": [ + { + "left": { + "parts": [ + "number" + ] + }, + "op": "%", + "right": { + "type": "Integer", + "value": 2 } - ], - "has_parentheses": true - } - ], - "has_parentheses": true - }, - "operator_syntax": true + } + ] + } + ] }, - "alias": "item_id" + "type": { + "name": "Array", + "parameters": [ + { + "name": "LowCardinality", + "parameters": [ + { + "name": "String" + } + ], + "has_parentheses": true + } + ], + "has_parentheses": true + }, + "alias": "item_id", + "operator_syntax": true }, { "name": "count" @@ -101,47 +99,45 @@ "columns": [ { "expr": { - "expr": { - "type": "Array", - "value": [ - { - "name": "toString", - "arguments": [ - { + "type": "Array", + "value": [ + { + "name": "toString", + "arguments": [ + { + "left": { "left": { - "left": { - "parts": [ - "number" - ] - }, - "op": "%", - "right": { - "type": "Integer", - "value": 2 - } + "parts": [ + "number" + ] }, - "op": "*", + "op": "%", "right": { "type": "Integer", "value": 2 } + }, + "op": "*", + "right": { + "type": "Integer", + "value": 2 } - ] - } - ] - }, - "type": { - "name": "Array", - "parameters": [ - { - "name": "String" - } - ], - "has_parentheses": true - }, - "operator_syntax": true + } + ] + } + ] + }, + "type": { + "name": "Array", + "parameters": [ + { + "name": "String" + } + ], + "has_parentheses": true }, - "alias": "item_id" + "alias": "item_id", + "operator_syntax": true } ], "from": { diff --git a/parser/testdata/03033_index_definition_sql_udf_bug/ast.json b/parser/testdata/03033_index_definition_sql_udf_bug/ast.json new file mode 100644 index 000000000..90cae7407 --- /dev/null +++ b/parser/testdata/03033_index_definition_sql_udf_bug/ast.json @@ -0,0 +1,4 @@ +{ + "if_exists": true, + "function": "test_func_1" +} diff --git a/parser/testdata/03037_dot_product_overflow/ast.json b/parser/testdata/03037_dot_product_overflow/ast.json new file mode 100644 index 000000000..f296fe5cd --- /dev/null +++ b/parser/testdata/03037_dot_product_overflow/ast.json @@ -0,0 +1,57 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "ignore", + "arguments": [ + { + "name": "dotProduct", + "arguments": [ + { + "name": "materialize", + "arguments": [ + { + "type": "Array", + "value": [ + { + "type": "Integer", + "value": 9223372036854775807 + }, + { + "type": "Integer", + "value": 1 + } + ] + } + ] + }, + { + "name": "materialize", + "arguments": [ + { + "type": "Array", + "value": [ + { + "op": "-", + "operand": { + "type": "Integer", + "value": 3 + } + }, + { + "type": "Integer", + "value": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/03071_fix_short_circuit_logic/ast.json b/parser/testdata/03071_fix_short_circuit_logic/ast.json new file mode 100644 index 000000000..805ef2eb3 --- /dev/null +++ b/parser/testdata/03071_fix_short_circuit_logic/ast.json @@ -0,0 +1,29 @@ +{ + "if_not_exists": true, + "create_function": true, + "function_name": "unhexPrefixed", + "function_body": { + "parameters": [ + "value" + ], + "body": { + "name": "unhex", + "arguments": [ + { + "name": "substring", + "arguments": [ + { + "parts": [ + "value" + ] + }, + { + "type": "Integer", + "value": 3 + } + ] + } + ] + } + } +} diff --git a/parser/testdata/03155_explain_current_transaction/ast.json b/parser/testdata/03155_explain_current_transaction/ast.json new file mode 100644 index 000000000..1f2b9ca42 --- /dev/null +++ b/parser/testdata/03155_explain_current_transaction/ast.json @@ -0,0 +1,4 @@ +{ + "explain_type": "CURRENT TRANSACTION", + "statement": null +} diff --git a/parser/testdata/03165_round_scale_as_column/ast.json b/parser/testdata/03165_round_scale_as_column/ast.json new file mode 100644 index 000000000..07189f739 --- /dev/null +++ b/parser/testdata/03165_round_scale_as_column/ast.json @@ -0,0 +1,85 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "toUInt8", + "arguments": [ + { + "parts": [ + "number" + ] + } + ], + "alias": "x" + }, + { + "name": "round", + "arguments": [ + { + "parts": [ + "x" + ] + } + ] + }, + { + "name": "roundBankers", + "arguments": [ + { + "parts": [ + "x" + ] + } + ] + }, + { + "name": "floor", + "arguments": [ + { + "parts": [ + "x" + ] + } + ] + }, + { + "name": "ceil", + "arguments": [ + { + "parts": [ + "x" + ] + } + ] + }, + { + "name": "trunc", + "arguments": [ + { + "parts": [ + "x" + ] + } + ] + } + ], + "from": { + "tables": [ + { + "table": { + "table": { + "database": "system", + "table": "numbers" + } + } + } + ] + }, + "limit": { + "type": "Integer", + "value": 20 + } + } + ] +} diff --git a/parser/testdata/03215_udf_with_union/ast.json b/parser/testdata/03215_udf_with_union/ast.json new file mode 100644 index 000000000..39b9aab4c --- /dev/null +++ b/parser/testdata/03215_udf_with_union/ast.json @@ -0,0 +1,4 @@ +{ + "if_exists": true, + "function": "03215_udf_with_union" +} diff --git a/parser/testdata/03237_get_subcolumn_low_cardinality_column/metadata.json b/parser/testdata/03237_get_subcolumn_low_cardinality_column/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/03237_get_subcolumn_low_cardinality_column/metadata.json +++ b/parser/testdata/03237_get_subcolumn_low_cardinality_column/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/03261_json_hints_types_check/metadata.json b/parser/testdata/03261_json_hints_types_check/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/03261_json_hints_types_check/metadata.json +++ b/parser/testdata/03261_json_hints_types_check/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/03359_ub_merging_aggregated_transform/ast.json b/parser/testdata/03359_ub_merging_aggregated_transform/ast.json index 03463b5b5..1916cacb0 100644 --- a/parser/testdata/03359_ub_merging_aggregated_transform/ast.json +++ b/parser/testdata/03359_ub_merging_aggregated_transform/ast.json @@ -98,7 +98,7 @@ { "name": "old_parts_lifetime", "value": { - "type": "Integer", + "type": "Float", "value": 196 } }, diff --git a/parser/testdata/03404_dynamic_in_interval_bug/ast.json b/parser/testdata/03404_dynamic_in_interval_bug/ast.json new file mode 100644 index 000000000..66ba3e893 --- /dev/null +++ b/parser/testdata/03404_dynamic_in_interval_bug/ast.json @@ -0,0 +1,32 @@ +{ + "selects": [ + { + "columns": [ + { + "expr": { + "value": { + "type": "Integer", + "value": 1 + }, + "unit": "MINUTE" + }, + "alias": "c0" + }, + { + "value": { + "expr": { + "parts": [ + "c0" + ] + }, + "type": { + "name": "Dynamic" + }, + "operator_syntax": true + }, + "unit": "DAY" + } + ] + } + ] +} diff --git a/parser/testdata/03405_json_parsing_error_bug/ast.json b/parser/testdata/03405_json_parsing_error_bug/ast.json new file mode 100644 index 000000000..7ed7a870a --- /dev/null +++ b/parser/testdata/03405_json_parsing_error_bug/ast.json @@ -0,0 +1,42 @@ +{ + "selects": [ + { + "columns": [ + { + "expr": { + "type": "Array", + "value": [ + { + "type": "String", + "value": "{}" + }, + { + "type": "String", + "value": "{\"c\" : [1, {\"b\" : []}]}" + } + ] + }, + "type": { + "name": "Array", + "parameters": [ + { + "name": "JSON" + } + ], + "has_parentheses": true + }, + "operator_syntax": true + } + ], + "settings": [ + { + "name": "input_format_json_infer_incomplete_types_as_strings", + "value": { + "type": "Integer", + "value": 0 + } + } + ] + } + ] +} diff --git a/parser/testdata/03410_polygons_intersects/ast.json b/parser/testdata/03410_polygons_intersects/ast.json new file mode 100644 index 000000000..349514de3 --- /dev/null +++ b/parser/testdata/03410_polygons_intersects/ast.json @@ -0,0 +1,212 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "polygonsIntersectCartesian", + "arguments": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 0 + }, + { + "type": "Integer", + "value": 0 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 0 + }, + { + "type": "Integer", + "value": 3 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 1 + }, + { + "type": "Float", + "value": 2.9 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 2 + }, + { + "type": "Float", + "value": 2.6 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 2.6 + }, + { + "type": "Integer", + "value": 2 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 2.9 + }, + { + "type": "Integer", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 3 + }, + { + "type": "Integer", + "value": 0 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Integer", + "value": 0 + }, + { + "type": "Integer", + "value": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 4 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 4 + }, + { + "type": "Float", + "value": 4 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 4 + }, + { + "type": "Float", + "value": 1 + } + ] + }, + { + "type": "Tuple", + "value": [ + { + "type": "Float", + "value": 1 + }, + { + "type": "Float", + "value": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/parser/testdata/03410_polygons_intersects/metadata.json b/parser/testdata/03410_polygons_intersects/metadata.json index ef120d978..0967ef424 100644 --- a/parser/testdata/03410_polygons_intersects/metadata.json +++ b/parser/testdata/03410_polygons_intersects/metadata.json @@ -1 +1 @@ -{"todo": true} +{} diff --git a/parser/testdata/03518_bad_sql_udf/ast.json b/parser/testdata/03518_bad_sql_udf/ast.json new file mode 100644 index 000000000..f575ffb47 --- /dev/null +++ b/parser/testdata/03518_bad_sql_udf/ast.json @@ -0,0 +1,25 @@ +{ + "or_replace": true, + "create_function": true, + "function_name": "03518_bad_sql_udf", + "function_body": { + "name": "lambda", + "arguments": [ + { + "name": "identity", + "arguments": [ + { + "parts": [ + "x" + ] + } + ] + }, + { + "parts": [ + "x" + ] + } + ] + } +} diff --git a/parser/testdata/03533_xirr/ast.json b/parser/testdata/03533_xirr/ast.json new file mode 100644 index 000000000..39132ece7 --- /dev/null +++ b/parser/testdata/03533_xirr/ast.json @@ -0,0 +1,88 @@ +{ + "selects": [ + { + "columns": [ + { + "name": "round", + "arguments": [ + { + "name": "financialInternalRateOfReturnExtended", + "arguments": [ + { + "type": "Array", + "value": [ + { + "op": "-", + "operand": { + "type": "Integer", + "value": 10000 + } + }, + { + "type": "Integer", + "value": 5750 + }, + { + "type": "Integer", + "value": 4250 + }, + { + "type": "Integer", + "value": 3250 + } + ] + }, + { + "type": "Array", + "value": [ + { + "name": "toDate", + "arguments": [ + { + "type": "String", + "value": "2020-01-01" + } + ] + }, + { + "name": "toDate", + "arguments": [ + { + "type": "String", + "value": "2020-03-01" + } + ] + }, + { + "name": "toDate", + "arguments": [ + { + "type": "String", + "value": "2020-10-30" + } + ] + }, + { + "name": "toDate", + "arguments": [ + { + "type": "String", + "value": "2021-02-15" + } + ] + } + ] + } + ] + }, + { + "type": "Integer", + "value": 6 + } + ], + "alias": "xirr_rate" + } + ] + } + ] +} diff --git a/parser/testdata/03541_table_without_insertable_columns/ast.json b/parser/testdata/03541_table_without_insertable_columns/ast.json new file mode 100644 index 000000000..c63212e33 --- /dev/null +++ b/parser/testdata/03541_table_without_insertable_columns/ast.json @@ -0,0 +1,15 @@ +{ + "table": "no_physical", + "columns": [ + { + "name": "a", + "type": { + "name": "Int" + }, + "default_kind": "EPHEMERAL" + } + ], + "engine": { + "name": "Memory" + } +} diff --git a/parser/testdata/03601_histogram_quantile/explain.txt b/parser/testdata/03601_histogram_quantile/explain.txt index 1235f85f5..11d5b92d3 100644 --- a/parser/testdata/03601_histogram_quantile/explain.txt +++ b/parser/testdata/03601_histogram_quantile/explain.txt @@ -36,7 +36,7 @@ SelectWithUnionQuery (children 1) Literal Float64_1 Function + (children 1) ExpressionList (children 1) - Literal Float64_+Inf + Literal Float64_inf Literal Array_[Float64_0, Float64_10, Float64_11, Float64_12] Identifier number TablesInSelectQuery (children 1) diff --git a/parser/testdata/03603_getSubcolumnType_msan/ast.json b/parser/testdata/03603_getSubcolumnType_msan/ast.json new file mode 100644 index 000000000..06bcd8dd0 --- /dev/null +++ b/parser/testdata/03603_getSubcolumnType_msan/ast.json @@ -0,0 +1,32 @@ +{ + "selects": [ + { + "columns": [ + { + "expr": { + "type": "String", + "value": "{}" + }, + "type": { + "name": "JSON" + }, + "alias": "x", + "operator_syntax": true + } + ], + "qualify": { + "left": { + "parts": [ + "x", + "^c0" + ] + }, + "op": "=", + "right": { + "type": "Integer", + "value": 1 + } + } + } + ] +}