-
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.
Added PropertyStatistics structure for tracking nulls
- Loading branch information
1 parent
85dd412
commit 732229d
Showing
20 changed files
with
338 additions
and
93 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#pragma once | ||
|
||
#include "common/types/types.h" | ||
|
||
namespace kuzu { | ||
namespace storage { | ||
|
||
class PropertyStatistics { | ||
public: | ||
PropertyStatistics() = default; | ||
explicit PropertyStatistics(bool mayHaveNullValue) : mayHaveNullValue{mayHaveNullValue} {} | ||
|
||
inline bool mayHaveNull() const { return mayHaveNullValue; } | ||
|
||
void serialize(common::FileInfo* fileInfo, uint64_t& offset); | ||
static std::unique_ptr<PropertyStatistics> deserialize( | ||
common::FileInfo* fileInfo, uint64_t& offset); | ||
|
||
inline void setHasNull() { mayHaveNullValue = true; } | ||
|
||
private: | ||
// Stores whether or not the property is known to have contained a null value | ||
// If false, the property is guaranteed to not contain any nulls | ||
bool mayHaveNullValue = false; | ||
}; | ||
|
||
class TablesStatistics; | ||
|
||
// Accessor used by NodeColumn, so that it doesn't need to handle the TableStatistics directly | ||
class RWPropertyStats { | ||
public: | ||
RWPropertyStats(TablesStatistics* tablesStatistics, common::table_id_t tableID, | ||
common::property_id_t propertyID); | ||
|
||
static RWPropertyStats empty() { return RWPropertyStats(nullptr, 0, 0); } | ||
|
||
bool mayHaveNull(); | ||
void setHasNull(); | ||
|
||
private: | ||
TablesStatistics* tablesStatistics; | ||
common::table_id_t tableID; | ||
common::property_id_t propertyID; | ||
}; | ||
|
||
} // namespace storage | ||
} // 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
Oops, something went wrong.