Skip to content

Commit

Permalink
null node creation for interval type
Browse files Browse the repository at this point in the history
  • Loading branch information
pprudhvi committed Mar 11, 2020
1 parent 14426df commit 866dc3e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cpp/src/gandiva/tree_expr_builder.cc
Expand Up @@ -99,6 +99,14 @@ NodePtr TreeExprBuilder::MakeNull(DataTypePtr data_type) {
return std::make_shared<LiteralNode>(data_type, LiteralHolder((int64_t)0), true);
case arrow::Type::TIMESTAMP:
return std::make_shared<LiteralNode>(data_type, LiteralHolder((int64_t)0), true);
case arrow::Type::INTERVAL: {
std::shared_ptr<arrow::IntervalType> interval_type =
arrow::internal::checked_pointer_cast<arrow::IntervalType>(data_type);
if (interval_type->interval_type() == arrow::IntervalType::type::MONTHS) {
return std::make_shared<LiteralNode>(data_type, LiteralHolder((int32_t)0), true);
}
return std::make_shared<LiteralNode>(data_type, LiteralHolder((int64_t)0), true);
}
case arrow::Type::DECIMAL: {
std::shared_ptr<arrow::DecimalType> decimal_type =
arrow::internal::checked_pointer_cast<arrow::DecimalType>(data_type);
Expand Down

0 comments on commit 866dc3e

Please sign in to comment.