diff --git a/velox/exec/LocalPlanner.cpp b/velox/exec/LocalPlanner.cpp index 3645e737b83e8..8112318819235 100644 --- a/velox/exec/LocalPlanner.cpp +++ b/velox/exec/LocalPlanner.cpp @@ -76,15 +76,13 @@ std::unique_ptr createScaleWriterLocalPartition( const std::shared_ptr& localPartitionNode, int32_t operatorId, DriverCtx* ctx) { - if (dynamic_cast( + if (dynamic_cast( &localPartitionNode->partitionFunctionSpec())) { - return std::make_unique( + return std::make_unique( operatorId, ctx, localPartitionNode); } - VELOX_CHECK_NOT_NULL(dynamic_cast( - &localPartitionNode->partitionFunctionSpec())); - return std::make_unique( + return std::make_unique( operatorId, ctx, localPartitionNode); } diff --git a/velox/exec/ScaleWriterLocalPartition.cpp b/velox/exec/ScaleWriterLocalPartition.cpp index c4995d0975281..b243e2b808bb6 100644 --- a/velox/exec/ScaleWriterLocalPartition.cpp +++ b/velox/exec/ScaleWriterLocalPartition.cpp @@ -57,10 +57,6 @@ ScaleWriterPartitioningLocalPartition::ScaleWriterPartitioningLocalPartition( : planNode->partitionFunctionSpec().create( numTablePartitions_, /*localExchange=*/true); - if (partitionFunction_ != nullptr) { - VELOX_CHECK_NOT_NULL( - dynamic_cast(partitionFunction_.get())); - } } void ScaleWriterPartitioningLocalPartition::initialize() {