wuwenchi commented on a change in pull request #4162:
URL: https://github.com/apache/iceberg/pull/4162#discussion_r812515068
##########
File path:
core/src/main/java/org/apache/iceberg/actions/BaseRewriteDataFilesAction.java
##########
@@ -300,6 +302,10 @@ void doReplace(Iterable<DataFile> deletedDataFiles,
Iterable<DataFile> addedData
private boolean isPartialFileScan(CombinedScanTask task) {
if (task.files().size() == 1) {
FileScanTask fileScanTask = task.files().iterator().next();
+ if (fileScanTask.file().format() == FileFormat.PARQUET) {
+ // in parquet format, there is an initial offset of 4 bytes
+ return fileScanTask.file().fileSizeInBytes() != (fileScanTask.length()
+ PARQUET_MAGIC_BYTES);
+ }
Review comment:
If you include offset 0 in the **first Parquet** task, we may have the
following doubts: Why deal with the first one? And why only do parquet
processing? It is difficult for us to think that the operation here is for the
judgment of whether it is a complete file...
We know that there will be a magic bytes in the parquet file. If we want to
get the size of the data (not directly read the data content), we will skip
these 4 bytes naturally.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]