-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
65972: colbuilder: optimize casting in edge cases r=yuzefovich a=yuzefovich **colbuilder: return custom error for LocalPlanNode core** If a particular processor core is not supported, we return a general error (in order to not incur any allocations when printing out the type of the core). However, `LocalPlanNode` core is quite special (because we don't have any plans on vectorizing it at the moment, if ever), so it deserves a separate error object. Release note: None **colbuilder: optimize casting in edge cases** In order to make sure that `NewColOperator` call produces the type schema as expected, we are planning casts between the mismatched types. If a particular cast is not supported natively by the vectorized engine, we have to fallback to wrapping a row-execution noop processor. Previously, we would create a separate processor for each such mismatched column. However, this is quite inefficient if multiple columns need to be casted this way (the processor itself isn't free but also we need to plan another pair of materializer - columnarizer wrappers). This commit switches that casting planning to be a bit smarter - to check explicitly whether all necessary casts are supported natively - which allows us to plan a single row-execution processor to handle all unsupported casts at once. Currently, if a row-execution processor is needed, we will use it to handle all mismatched types, even the ones for which we have native cast operation. The reasoning behind this change is that this commit needs to be backportable (so it must be as bullet-proof as possible) but also it might be actually a better option since all vectorized casts will append more columns to go through the materializer-columnarizer pair. It is left as a TODO to explore which way is better in more detail. Fixes: https://github.com/cockroachlabs/support/issues/1008. Release note: None Co-authored-by: Yahor Yuzefovich <[email protected]>
- Loading branch information
Showing
3 changed files
with
307 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.