Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(duckdb): remove numeric literal casts when compiling sql #9664

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

cpcloud
Copy link
Member

@cpcloud cpcloud commented Jul 22, 2024

Description of changes

This PR removes casting of numeric literals in the DuckDB compiler.

We should probably do this for most backends, as enforcing numeric literals be
a specific type without the full context of the expression can, as seen in
#9662, defeat certain kinds of optimization.

Longer term, I think we should probably support two kinds of literals:

  1. A ops.TypedLiteral when a type is specified in ibis.literal, which will be cast to the specific type
  2. ops.Literal would then be a literal that has type information but avoids casting. This is what op construction would use.

Issues closed

@cpcloud cpcloud added performance Issues related to ibis's performance duckdb The DuckDB backend labels Jul 22, 2024
@cpcloud cpcloud force-pushed the duckdb-remove-literal-casts branch from ed153ef to c342b16 Compare July 22, 2024 23:13
@jcrist jcrist merged commit e4ff1bd into ibis-project:main Jul 23, 2024
82 checks passed
@cpcloud cpcloud deleted the duckdb-remove-literal-casts branch July 25, 2024 12:20
@cpcloud cpcloud added this to the 9.3 milestone Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duckdb The DuckDB backend performance Issues related to ibis's performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(geospatial): casting of literals preventing filter push down to parquet reader
2 participants