Skip to content

Commit 48a41aa

Browse files
Huameng (Michael) Jiangmeta-codesync[bot]
authored andcommitted
Make statistics physical size threadsafe (#451)
Summary: Pull Request resolved: #451 There is a thread safety issue when updating the physical size statistics with parallel encodings. Previously the code holds one state per stream id, but now the accounting unit is per schema node, causing the contention. The fix is to specifically make the physical size state atomic in the column statistics. Reviewed By: apurva-meta Differential Revision: D91933623 fbshipit-source-id: 3aad65f9d4bd0e0abf90d2c535398d13272ed1ae
1 parent f46436b commit 48a41aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dwio/nimble/velox/stats/ColumnStatistics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class ColumnStatistics {
8484
uint64_t valueCount_{0};
8585
uint64_t nullCount_{0};
8686
uint64_t logicalSize_{0};
87-
uint64_t physicalSize_{0};
87+
std::atomic_uint64_t physicalSize_{0};
8888
};
8989

9090
class StringStatistics : public ColumnStatistics {

0 commit comments

Comments
 (0)