Skip to content

Commit

Permalink
refactor: Make compare return int32_t instead of int64_t (#11544)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #11544

Address previous pr coments: #11499

We can use int32_t instead of int64_t since that's what the underlying vectors are returning.

Reviewed By: kevinwilfong

Differential Revision: D65973724

fbshipit-source-id: e170df285560f705599cf0ab80f75dc10c5fad1d
  • Loading branch information
yuandagits authored and facebook-github-bot committed Nov 19, 2024
1 parent e598534 commit 463ebad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions velox/expression/ComplexViewTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct ViewWithComparison {
}

private:
int64_t compareOrThrow(
int32_t compareOrThrow(
const T& other,
CompareFlags flags = CompareFlags{
.nullHandlingMode =
Expand Down Expand Up @@ -1015,7 +1015,7 @@ class RowView
return result;
}

std::optional<int64_t> compare(const RowView& other, const CompareFlags flags)
std::optional<int32_t> compare(const RowView& other, const CompareFlags flags)
const {
return compareImpl(other, flags);
}
Expand All @@ -1026,7 +1026,7 @@ class RowView
}

template <std::size_t Is = 0>
std::optional<int64_t> compareImpl(
std::optional<int32_t> compareImpl(
const RowView& other,
const CompareFlags flags) const {
if constexpr (Is < sizeof...(T)) {
Expand Down Expand Up @@ -1173,7 +1173,7 @@ class GenericView : public ViewWithComparison<GenericView> {
return decoded_.index(index_);
}

std::optional<int64_t> compare(
std::optional<int32_t> compare(
const GenericView& other,
const CompareFlags flags) const {
return decoded_.base()->compare(
Expand Down

0 comments on commit 463ebad

Please sign in to comment.