Skip to content

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Aug 9, 2024

Which issue does this PR close?

N/A

Rationale for this change

While looking at #11897 from @Lordworms I noticed several places where the very long form of creating a literal boolean was used:

Expr::Literal(ScalarValue::Boolean(Some(false)));

I would like to encourage people to use the shorter form:

lit(false)

Which both makes the code shorter and easier to read

What changes are included in this PR?

Replace some

  • Expr::Literal(ScalarValue::Boolean(Some(false))) with lit(false)
  • Expr::Literal(ScalarValue::Boolean(Some(true))) with lit(true)

Are these changes tested?

By CI

Are there any user-facing changes?

No, this is all internal only

@github-actions github-actions bot added physical-expr Changes to the physical-expr crates optimizer Optimizer rules labels Aug 9, 2024
@alamb alamb marked this pull request as draft August 9, 2024 16:06
@alamb alamb force-pushed the alamb/lit_cleanup branch from 8fee876 to aadfe11 Compare August 9, 2024 16:38
@alamb alamb marked this pull request as ready for review August 9, 2024 18:22
Copy link
Member

@lewiszlw lewiszlw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @alamb

@lewiszlw lewiszlw merged commit 12aa82c into apache:main Aug 10, 2024
@alamb alamb deleted the alamb/lit_cleanup branch August 10, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

optimizer Optimizer rules physical-expr Changes to the physical-expr crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants