MCPcopy Create free account
hub / github.com/apache/datafusion / precedence

Method precedence

datafusion/expr-common/src/operator.rs:298–337  ·  view source on GitHub ↗

Get the operator precedence use as a reference

(&self)

Source from the content-addressed store, hash-verified

296 /// Get the operator precedence
297 /// use <https://www.postgresql.org/docs/7.2/sql-precedence.html> as a reference
298 pub fn precedence(&self) -> u8 {
299 match self {
300 Operator::Or => 5,
301 Operator::And => 10,
302 Operator::Eq | Operator::NotEq | Operator::LtEq | Operator::GtEq => 15,
303 Operator::Lt | Operator::Gt => 20,
304 Operator::LikeMatch
305 | Operator::NotLikeMatch
306 | Operator::ILikeMatch
307 | Operator::NotILikeMatch => 25,
308 Operator::IsDistinctFrom
309 | Operator::IsNotDistinctFrom
310 | Operator::RegexMatch
311 | Operator::RegexNotMatch
312 | Operator::RegexIMatch
313 | Operator::RegexNotIMatch
314 | Operator::BitwiseAnd
315 | Operator::BitwiseOr
316 | Operator::BitwiseShiftLeft
317 | Operator::BitwiseShiftRight
318 | Operator::BitwiseXor
319 | Operator::StringConcat
320 | Operator::AtArrow
321 | Operator::ArrowAt
322 | Operator::Arrow
323 | Operator::LongArrow
324 | Operator::HashArrow
325 | Operator::HashLongArrow
326 | Operator::AtAt
327 | Operator::IntegerDivide
328 | Operator::HashMinus
329 | Operator::AtQuestion
330 | Operator::Question
331 | Operator::QuestionAnd
332 | Operator::QuestionPipe
333 | Operator::Colon => 30,
334 Operator::Plus | Operator::Minus => 40,
335 Operator::Multiply | Operator::Divide | Operator::Modulo => 45,
336 }
337 }
338
339 /// Returns true if the `Expr::BinaryOperator` with this operator
340 /// is guaranteed to return null if either side is null.

Callers 6

write_childMethod · 0.80
fmtMethod · 0.80
fmt_sqlMethod · 0.80
write_childMethod · 0.80
fmtMethod · 0.80
sql_op_precedenceMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected