record count for row group size check configurable
- Ngôn ngữ chính
- Java
- Star
- 3.1k
- Fork
- 1.6k
- Merge trung bình
- 3 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 33
Mô tả
org.apache.parquet.hadoop.InternalParquetRecordWriter#checkBlockSizeReached
```java
private void checkBlockSizeReached() throws IOException {
if (recordCount >= recordCountForNextMemCheck) { // checking the memory size is relatively expensive, so let's not do it for every record.
long memSize = columnStore.getBufferedSize();
long recordSize = memSize / recordCount;
// flush the row group if it is within ~2 records of the limit
// it is much better to be slightly under size than to be over at all
if (memSize > (nextRowGroupSize - 2 * recordSize)) {
LOG.info("mem size {} > {}: flushing {} records to disk.", memSize, nextRowGroupSize, recordCount);
flushRowGroupToStore();
initStore();
recordCountForNextMemCheck = min(max(MINIMUM_RECORD_COUNT_FOR_CHECK, recordCount / 2), MAXIMUM_RECORD_COUNT_FOR_CHECK);
this.lastRowGroupEndPos = parquetFileWriter.getPos();
} else {
recordCountForNextMemCheck = min(
max(MINIMUM_RECORD_COUNT_FOR_CHECK, (recordCount + (long)(nextRowGroupSize / ((float)recordSize))) / 2), // will check halfway
recordCount + MAXIMUM_RECORD_COUNT_FOR_CHECK // will not look more than max records ahead
);
LOG.debug("Checked mem at {} will check again at: {}", recordCount, recordCountForNextMemCheck);
}
}
}
```
in this code,if the block size is small ,for example 8M,and the first 100 lines record size is small and after 100 lines the record size is big,it will cause big row group,in our real scene,it will more than 64M. So i think the size for block check can configurable.
**Reporter**: [xjlem](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=xjlem)
**Note**: *This issue was originally created as [PARQUET-2242](https://issues.apache.org/jira/browse/PARQUET-2242). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu với org.apache.parquet.hadoop.InternalParquetRecordWriter#checkBlockSizeReached và theo dõi cách nextRowGroupSize và recordCountForNextMemCheck được khởi tạo và sử dụng. Xác định đường dẫn cấu hình hiện có và các bài kiểm thử writer liên quan, sau đó xác định hoàn thành là cho phép cấu hình việc xác định kích thước kiểm tra bộ nhớ và ngăn chặn hành vi row-group có kích thước vượt quá được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- data-engineering
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 42/100