Skip to content

Conversation

@WZhuo
Copy link
Contributor

@WZhuo WZhuo commented Jan 12, 2026

No description provided.

Result<std::unique_ptr<UnboundPredicate>> ProjectStrict(
std::string_view name, const std::shared_ptr<BoundPredicate>& predicate);

/// \brief Returns a human-readable String representation of a transformed value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// \brief Returns a human-readable String representation of a transformed value.
/// \brief Returns a human-readable string representation of a transformed value.

/// \brief Returns a human-readable String representation of a transformed value.
///
/// \param value The literal value to be transformed.
/// \return A human-readable String representation of the value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// \return A human-readable String representation of the value
/// \return A human-readable string representation of the value

}

Result<std::string> Transform::ToHumanString(const Literal& value) {
if (value.IsNull()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's return error when IsAboveMax() or IsBelowMin() is true.


switch (transform_type_) {
case TransformType::kYear:
return TransformUtil::HumanYear(std::get<int32_t>(value.value()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might need to check the literal type before calling std::get on the variant value to avoid exception.

return TransformUtil::HumanDay(std::get<int32_t>(value.value()));
case TransformType::kHour:
return TransformUtil::HumanHour(std::get<int32_t>(value.value()));
default: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this default and add all other branches explicitly to avoid forgetting to update here in the future once we add a new transform type?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants