From bd300cd9c66cd032ae498a0dd4984500dc1811e6 Mon Sep 17 00:00:00 2001 From: thorfour Date: Thu, 30 May 2024 16:43:18 -0500 Subject: [PATCH] Fix validation of queries with Sample --- query/logicalplan/logicalplan.go | 7 +++++++ 1 file changed, 7 insertions(+) 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")