Files
sqlparser/parser/testdata/query/output/select_simple.sql.golden.json

438 lines
11 KiB
JSON

[
{
"SelectPos": 0,
"StatementEnd": 277,
"With": null,
"Top": null,
"HasDistinct": false,
"DistinctOn": null,
"SelectItems": [
{
"Expr": {
"Name": "f0",
"QuoteType": 1,
"NamePos": 11,
"NameEnd": 13
},
"Modifiers": [],
"Alias": null
},
{
"Expr": {
"Name": {
"Name": "coalesce",
"QuoteType": 1,
"NamePos": 15,
"NameEnd": 23
},
"Params": {
"LeftParenPos": 23,
"RightParenPos": 30,
"Items": {
"ListPos": 24,
"ListEnd": 30,
"HasDistinct": false,
"Items": [
{
"Expr": {
"Name": "f1",
"QuoteType": 1,
"NamePos": 24,
"NameEnd": 26
},
"Alias": null
},
{
"Expr": {
"Name": "f2",
"QuoteType": 1,
"NamePos": 28,
"NameEnd": 30
},
"Alias": null
}
]
},
"ColumnArgList": null
}
},
"Modifiers": [],
"Alias": {
"Name": "f3",
"QuoteType": 1,
"NamePos": 35,
"NameEnd": 37
}
},
{
"Expr": {
"Function": {
"Name": {
"Name": "row_number",
"QuoteType": 1,
"NamePos": 39,
"NameEnd": 49
},
"Params": {
"LeftParenPos": 49,
"RightParenPos": 50,
"Items": {
"ListPos": 50,
"ListEnd": 50,
"HasDistinct": false,
"Items": []
},
"ColumnArgList": null
}
},
"OverPos": 52,
"OverExpr": {
"LeftParenPos": 57,
"RightParenPos": 89,
"PartitionBy": {
"PartitionPos": 57,
"Expr": {
"ListPos": 71,
"ListEnd": 73,
"HasDistinct": false,
"Items": [
{
"Expr": {
"Name": "f0",
"QuoteType": 1,
"NamePos": 71,
"NameEnd": 73
},
"Alias": null
}
]
}
},
"OrderBy": {
"OrderPos": 74,
"ListEnd": 85,
"Items": [
{
"OrderPos": 74,
"Expr": {
"Name": "f1",
"QuoteType": 1,
"NamePos": 83,
"NameEnd": 85
},
"Alias": null,
"Direction": "ASC",
"Fill": null
}
],
"Interpolate": null
},
"Frame": null
}
},
"Modifiers": [],
"Alias": {
"Name": "rn",
"QuoteType": 1,
"NamePos": 94,
"NameEnd": 96
}
}
],
"From": {
"FromPos": 97,
"Expr": {
"Table": {
"TablePos": 102,
"TableEnd": 119,
"Alias": null,
"Expr": {
"Database": {
"Name": "test",
"QuoteType": 1,
"NamePos": 102,
"NameEnd": 106
},
"Table": {
"Name": "events_local",
"QuoteType": 1,
"NamePos": 107,
"NameEnd": 119
}
},
"HasFinal": false
},
"StatementEnd": 119,
"SampleRatio": null,
"HasFinal": false
}
},
"ArrayJoin": null,
"Window": null,
"Prewhere": null,
"Where": {
"WherePos": 120,
"Expr": {
"LeftExpr": {
"LeftExpr": {
"LeftExpr": {
"LeftParenPos": 126,
"RightParenPos": 155,
"Items": {
"ListPos": 127,
"ListEnd": 154,
"HasDistinct": false,
"Items": [
{
"Expr": {
"LeftExpr": {
"Name": "f0",
"QuoteType": 1,
"NamePos": 127,
"NameEnd": 129
},
"Operation": "IN",
"RightExpr": {
"LeftParenPos": 133,
"RightParenPos": 154,
"Items": {
"ListPos": 135,
"ListEnd": 153,
"HasDistinct": false,
"Items": [
{
"Expr": {
"LiteralPos": 135,
"LiteralEnd": 138,
"Literal": "foo"
},
"Alias": null
},
{
"Expr": {
"LiteralPos": 142,
"LiteralEnd": 145,
"Literal": "bar"
},
"Alias": null
},
{
"Expr": {
"LiteralPos": 149,
"LiteralEnd": 153,
"Literal": "test"
},
"Alias": null
}
]
},
"ColumnArgList": null
},
"HasGlobal": false,
"HasNot": false
},
"Alias": null
}
]
},
"ColumnArgList": null
},
"Operation": "AND",
"RightExpr": {
"LeftParenPos": 161,
"RightParenPos": 176,
"Items": {
"ListPos": 162,
"ListEnd": 175,
"HasDistinct": false,
"Items": [
{
"Expr": {
"LeftExpr": {
"Name": "f1",
"QuoteType": 1,
"NamePos": 162,
"NameEnd": 164
},
"Operation": "=",
"RightExpr": {
"LiteralPos": 168,
"LiteralEnd": 175,
"Literal": "testing"
},
"HasGlobal": false,
"HasNot": false
},
"Alias": null
}
]
},
"ColumnArgList": null
},
"HasGlobal": false,
"HasNot": false
},
"Operation": "AND",
"RightExpr": {
"LeftParenPos": 182,
"RightParenPos": 205,
"Items": {
"ListPos": 183,
"ListEnd": 204,
"HasDistinct": false,
"Items": [
{
"Expr": {
"LeftExpr": {
"Name": "f2",
"QuoteType": 1,
"NamePos": 183,
"NameEnd": 185
},
"Operation": "NOT LIKE",
"RightExpr": {
"LiteralPos": 196,
"LiteralEnd": 204,
"Literal": "testing2"
},
"HasGlobal": false,
"HasNot": false
},
"Alias": null
}
]
},
"ColumnArgList": null
},
"HasGlobal": false,
"HasNot": false
},
"Operation": "AND",
"RightExpr": {
"LeftExpr": {
"Name": "f3",
"QuoteType": 1,
"NamePos": 211,
"NameEnd": 213
},
"Operation": "NOT IN",
"RightExpr": {
"LeftParenPos": 221,
"RightParenPos": 235,
"Items": {
"ListPos": 223,
"ListEnd": 234,
"HasDistinct": false,
"Items": [
{
"Expr": {
"LiteralPos": 223,
"LiteralEnd": 224,
"Literal": "a"
},
"Alias": null
},
{
"Expr": {
"LiteralPos": 228,
"LiteralEnd": 229,
"Literal": "b"
},
"Alias": null
},
{
"Expr": {
"LiteralPos": 233,
"LiteralEnd": 234,
"Literal": "c"
},
"Alias": null
}
]
},
"ColumnArgList": null
},
"HasGlobal": false,
"HasNot": false
},
"HasGlobal": false,
"HasNot": false
}
},
"GroupBy": {
"GroupByPos": 239,
"GroupByEnd": 258,
"AggregateType": "",
"Expr": {
"ListPos": 248,
"ListEnd": 256,
"HasDistinct": false,
"Items": [
{
"Expr": {
"Name": "f0",
"QuoteType": 1,
"NamePos": 248,
"NameEnd": 250
},
"Alias": null
},
{
"Expr": {
"Name": "f1",
"QuoteType": 1,
"NamePos": 254,
"NameEnd": 256
},
"Alias": null
}
]
},
"WithCube": false,
"WithRollup": false,
"WithTotals": false
},
"WithTotal": false,
"Having": null,
"OrderBy": null,
"LimitBy": {
"Limit": {
"LimitPos": 258,
"Limit": {
"NumPos": 269,
"NumEnd": 271,
"Literal": "10",
"Base": 10
},
"Offset": {
"NumPos": 264,
"NumEnd": 267,
"Literal": "100",
"Base": 10
}
},
"ByExpr": {
"ListPos": 275,
"ListEnd": 277,
"HasDistinct": false,
"Items": [
{
"Expr": {
"Name": "f0",
"QuoteType": 1,
"NamePos": 275,
"NameEnd": 277
},
"Alias": null
}
]
}
},
"Limit": null,
"Settings": null,
"Format": null,
"UnionAll": null,
"UnionDistinct": null,
"Except": null
}
]