-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Long Decimal Type in Native Parquet Reader #2822
Add support for Long Decimal Type in Native Parquet Reader #2822
Conversation
✅ Deploy Preview for meta-velox canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build is not successful yet
velox/dwio/common/ColumnVisitors.h
Outdated
template <typename A> | ||
struct LoadIndices<int128_t, A> { | ||
static xsimd::batch<int32_t, A> apply(const int128_t* values, const A& arch) { | ||
VELOX_UNSUPPORTED("LoadIndices for int128_t type is not supported"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about just VELOX_UNREACHABLE()
?
velox/dwio/common/IntDecoder.h
Outdated
reinterpret_cast<char*>(&result) + (16 - numBytes), | ||
reinterpret_cast<const char*>(valueOffset), | ||
numBytes); | ||
auto low = __builtin_bswap64(result >> 64); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use __builtin_bswap128
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my mac, I see the following error. I guess this version is not supported everywhere.
error: use of undeclared identifier '__builtin_bswap128'
return __builtin_bswap128(result);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do this?
#if __has_builtin(__builtin_bswap128)
return __builtin_bswap128(result);
#else
return buildInt128(__builtin_bswap64(result), __builtin_bswap64(result >> 64));
#endif
velox/dwio/common/TypeUtil.h
Outdated
@@ -53,6 +53,11 @@ struct make_index<uint64_t> { | |||
using type = uint64_t; | |||
}; | |||
|
|||
template <> | |||
struct make_index<int128_t> { | |||
using type = int128_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uint128_t
? Also if this is not really used, can we make sure it is not used at compile time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used. I fixed it.
velox/dwio/common/IntCodecCommon.h
Outdated
@@ -43,4 +44,9 @@ constexpr int64_t MAX_NANOS = 999'999'999; | |||
// 1 is reduced to epoch, as writer adds 1 for negative seconds. | |||
constexpr int64_t MIN_SECONDS = INT64_MIN + (EPOCH_OFFSET - 1); | |||
|
|||
#if not __has_builtin(__builtin_bswap128) | |||
#define __builtin_bswap128(X) \ | |||
buildInt128(__builtin_bswap64(X), __builtin_bswap64(X >> 64)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put extra parenthesis to avoid operator precedence issue: buildInt128(__builtin_bswap64((X)), __builtin_bswap64((X) >> 64))
Or just define an inline function, it's better this way because it also avoids duplicate evaluation if X
is an expensive expression or has side-effect
91f8af8
to
3905d3d
Compare
@Yuhta, all tests are passing. Can you take another look? Thanks. |
@Yuhta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
3905d3d
to
0371d08
Compare
@majetideepak the |
@Yuhta fixed. I missed a change during rebase. Thanks! |
@Yuhta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
…Velox memory pool instances for one Spark memory consumer (facebookincubator#2843) Closes facebookincubator#2822
No description provided.