diff --git a/query/logicalplan/logicalplan.go b/query/logicalplan/logicalplan.go index 81aca31bf4..d529f3a08c 100644 --- a/query/logicalplan/logicalplan.go +++ b/query/logicalplan/logicalplan.go @@ -160,6 +160,13 @@ func (plan *LogicalPlan) DataTypeForExpr(expr Expr) (arrow.DataType, error) { return nil, fmt.Errorf("data type for expr %v within Distinct: %w", expr, err) } + return t, nil + case plan.Sample != nil: + t, err := expr.DataType(plan.Input) + if err != nil { + return nil, fmt.Errorf("data type for expr %v within Sample: %w", expr, err) + } + return t, nil default: return nil, fmt.Errorf("unknown logical plan")