-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f72c7a
commit ff601fe
Showing
10 changed files
with
148 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#pragma once | ||
|
||
#include <cstdint> | ||
|
||
namespace kuzu { | ||
namespace common { | ||
|
||
class NullBytes { | ||
|
||
public: | ||
constexpr static const uint64_t NUM_NULL_MASKS_PER_BYTE = 8; | ||
|
||
static inline bool isNull(const uint8_t* nullBytes, uint64_t valueIdx) { | ||
return nullBytes[valueIdx / NUM_NULL_MASKS_PER_BYTE] & | ||
(1 << (valueIdx % NUM_NULL_MASKS_PER_BYTE)); | ||
} | ||
|
||
static inline void setNull(uint8_t* nullBytes, uint64_t valueIdx) { | ||
nullBytes[valueIdx / NUM_NULL_MASKS_PER_BYTE] |= | ||
(1 << (valueIdx % NUM_NULL_MASKS_PER_BYTE)); | ||
} | ||
|
||
static inline uint64_t getNumBytesForNullValues(uint64_t numValues) { | ||
return (numValues + NUM_NULL_MASKS_PER_BYTE - 1) / NUM_NULL_MASKS_PER_BYTE; | ||
} | ||
|
||
static inline void initNullBytes(uint8_t* nullBytes, uint64_t numValues) { | ||
memset(nullBytes, 0 /* value */, getNumBytesForNullValues(numValues)); | ||
} | ||
}; | ||
|
||
} // namespace common | ||
} // namespace kuzu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.