Skip to content

Commit

Permalink
Fix partition filter on date column
Browse files Browse the repository at this point in the history
  • Loading branch information
rui-mo authored and glutenperfbot committed May 21, 2024
1 parent 02e086a commit c3667a3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions velox/connectors/hive/HiveConnectorUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "velox/dwio/common/Reader.h"
#include "velox/expression/Expr.h"
#include "velox/expression/ExprToSubfieldFilter.h"
#include "velox/type/TimestampConversion.h"

namespace facebook::velox::connector::hive {

Expand Down Expand Up @@ -616,6 +617,13 @@ bool testFilters(
VELOX_CHECK(handlesIter != partitionKeysHandle.end());

// This is a non-null partition key
if (handlesIter->second->dataType()->isDate()) {
const int64_t dateValue = util::castFromDateString(
StringView(iter->second.value()),
util::ParseMode::kStandardCast);
return applyFilter(*child->filter(), dateValue);
}

return applyPartitionFilter(
handlesIter->second->dataType()->kind(),
iter->second.value(),
Expand Down

0 comments on commit c3667a3

Please sign in to comment.