Skip to content

Commit

Permalink
Merge #40094
Browse files Browse the repository at this point in the history
40094: exec: randomize types when testing columnar operators against processors r=yuzefovich a=yuzefovich

This commit adds type randomization when testing columnar operators
against processors. A few edge cases have been uncovered in the vectorize
engine when handling special values, and those are now fixed (we might need
to revisit the fixes though).

Additionally, the generation of random datums has been adjusted to
take into account the requested width for integers and floats. Without
the adjustment, we observe different behavior between the row and the
vectorized engines since the former always upcasts to the maximum
width type. For example, if a special math.MaxInt64 value was generated,
but the requested type was Int4, then the row engine would use the full
int64 value, but the vectorized engine would use only the int32 value.

Release note: None

Co-authored-by: Yahor Yuzefovich <[email protected]>
  • Loading branch information
craig[bot] and yuzefovich committed Aug 28, 2019
2 parents f0e9166 + f724300 commit 45c4543
Show file tree
Hide file tree
Showing 5 changed files with 278 additions and 111 deletions.
6 changes: 6 additions & 0 deletions pkg/sql/distsqlrun/column_exec_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,12 @@ func (r *newColOperatorResult) planFilterExpr(
if err != nil {
return columnTypes, err
}
if helper.expr == tree.DNull {
// The filter expression is tree.DNull meaning that it is always false, so
// we put a zero operator.
r.op = exec.NewZeroOp(r.op)
return columnTypes, nil
}
var filterColumnTypes []types.T
r.op, _, filterColumnTypes, selectionMem, err = planSelectionOperators(flowCtx.NewEvalCtx(), helper.expr, columnTypes, r.op)
if err != nil {
Expand Down
Loading

0 comments on commit 45c4543

Please sign in to comment.