@@ -232,10 +232,7 @@ pub enum Expr {
232
232
right : Box < Expr > ,
233
233
} ,
234
234
/// CompositeAccess (postgres) eg: SELECT (information_schema._pg_expandarray(array['i','i'])).n
235
- CompositeAccess {
236
- expr : Box < Expr > ,
237
- key : Ident ,
238
- } ,
235
+ CompositeAccess { expr : Box < Expr > , key : Ident } ,
239
236
/// `IS NULL` operator
240
237
IsNull ( Box < Expr > ) ,
241
238
/// `IS NOT NULL` operator
@@ -280,10 +277,7 @@ pub enum Expr {
280
277
/// ALL operation e.g. `1 ALL (1)` or `foo > ALL(bar)`, It will be wrapped in the right side of BinaryExpr
281
278
AllOp ( Box < Expr > ) ,
282
279
/// Unary operation e.g. `NOT foo`
283
- UnaryOp {
284
- op : UnaryOperator ,
285
- expr : Box < Expr > ,
286
- } ,
280
+ UnaryOp { op : UnaryOperator , expr : Box < Expr > } ,
287
281
/// CAST an expression to a different data type e.g. `CAST(foo AS VARCHAR(123))`
288
282
Cast {
289
283
expr : Box < Expr > ,
@@ -301,10 +295,7 @@ pub enum Expr {
301
295
expr : Box < Expr > ,
302
296
} ,
303
297
/// POSITION(<expr> in <expr>)
304
- Position {
305
- expr : Box < Expr > ,
306
- r#in : Box < Expr > ,
307
- } ,
298
+ Position { expr : Box < Expr > , r#in : Box < Expr > } ,
308
299
/// SUBSTRING(<expr> [FROM <expr>] [FOR <expr>])
309
300
Substring {
310
301
expr : Box < Expr > ,
@@ -331,14 +322,12 @@ pub enum Expr {
331
322
/// A constant of form `<data_type> 'value'`.
332
323
/// This can represent ANSI SQL `DATE`, `TIME`, and `TIMESTAMP` literals (such as `DATE '2020-01-01'`),
333
324
/// as well as constants of other types (a non-standard PostgreSQL extension).
334
- TypedString {
335
- data_type : DataType ,
336
- value : String ,
337
- } ,
338
- MapAccess {
339
- column : Box < Expr > ,
340
- keys : Vec < Expr > ,
341
- } ,
325
+ TypedString { data_type : DataType , value : String } ,
326
+ /// Access a map-like object by field (e.g. `column['field']` or `column[4]`
327
+ /// Note that depending on the dialect, struct like accesses may be
328
+ /// parsed as [`ArrayIndex`] or [`MapAccess`]
329
+ /// <https://clickhouse.com/docs/en/sql-reference/data-types/map/>
330
+ MapAccess { column : Box < Expr > , keys : Vec < Expr > } ,
342
331
/// Scalar function call e.g. `LEFT(foo, 5)`
343
332
Function ( Function ) ,
344
333
/// `CASE [<operand>] WHEN <condition> THEN <result> ... [ELSE <result>] END`
@@ -369,10 +358,7 @@ pub enum Expr {
369
358
/// ROW / TUPLE a single value, such as `SELECT (1, 2)`
370
359
Tuple ( Vec < Expr > ) ,
371
360
/// An array index expression e.g. `(ARRAY[1, 2])[1]` or `(current_schemas(FALSE))[1]`
372
- ArrayIndex {
373
- obj : Box < Expr > ,
374
- indexes : Vec < Expr > ,
375
- } ,
361
+ ArrayIndex { obj : Box < Expr > , indexes : Vec < Expr > } ,
376
362
/// An array expression e.g. `ARRAY[1, 2]`
377
363
Array ( Array ) ,
378
364
}
0 commit comments