[SUPPORT]parquet is not a Parquet file (too small length:4)
MOR + Spark Environment Description
- Hudi version : 0.9
- Spark version : spark2
Stacktrace
Add the stacktrace of the error.

@wangzhongz can you share the complete hoodie configs and any code snippet you're running to get this dataset? this is tricky to troubleshoot unless it can be reproduced successfully, so we'd need as much info as possible to reproduce it.
hoodie configs: override def getHudiConfig(): HudiConfigBuilder = { super.getHudiConfig() .properties(Map[String, String]( HoodieTableConfig.TYPE.key() -> MOR_TABLE_TYPE_OPT_VAL ,HoodieTableConfig.RECORDKEY_FIELDS.key() -> "start,end" ,HoodieTableConfig.PARTITION_FIELDS.key() -> "relation" ,HoodieTableConfig.PRECOMBINE_FIELD.key() -> "lastUTS" ,HoodieTableConfig.KEY_GENERATOR_CLASS_NAME.key() -> classOf[ComplexKeyGenerator].getName
,TABLE_TYPE.key() -> MOR_TABLE_TYPE_OPT_VAL
,OPERATION.key() -> UPSERT_OPERATION_OPT_VAL
,RECORDKEY_FIELD.key() -> "start,end"
,PARTITIONPATH_FIELD.key() -> "relation"
,HIVE_STYLE_PARTITIONING.key() -> "true"
,RECONCILE_SCHEMA.key() -> "true"
,HoodieWriteConfig.PRECOMBINE_FIELD_NAME.key() -> "lastUTS"
,HoodieWriteConfig.BULKINSERT_PARALLELISM_VALUE.key() -> "200"
,HoodieWriteConfig.INSERT_PARALLELISM_VALUE.key() -> "200"
,HoodieWriteConfig.UPSERT_PARALLELISM_VALUE.key() -> "200"
,HoodieWriteConfig.BULK_INSERT_SORT_MODE.key() -> BulkInsertSortMode.PARTITION_SORT.toString
,HoodieWriteConfig.WRITE_PAYLOAD_CLASS_NAME.key() -> classOf[GraphHoodieRecordPayload].getName
,HoodieWriteConfig.KEYGENERATOR_TYPE.key() -> "COMPLEX"
,HoodieWriteConfig.KEYGENERATOR_CLASS_NAME.key() -> classOf[ComplexKeyGenerator].getName
,HoodieIndexConfig.INDEX_TYPE.key() -> "BLOOM"
,HoodieIndexConfig.BLOOM_FILTER_NUM_ENTRIES_VALUE.key() -> "200000"
,HoodiePayloadConfig.ORDERING_FIELD.key() -> "lastUTS"
,HoodiePayloadConfig.EVENT_TIME_FIELD.key() -> "lastUTS"
,HoodieStorageConfig.PARQUET_MAX_FILE_SIZE.key() -> String.valueOf(128 * 1024 * 1024)
,HoodieStorageConfig.PARQUET_BLOCK_SIZE.key() -> String.valueOf(128 * 1024 * 1024)
,HoodieStorageConfig.LOGFILE_MAX_SIZE.key() -> String.valueOf(1024 * 1024 * 1024)
,HoodieStorageConfig.LOGFILE_DATA_BLOCK_MAX_SIZE.key() -> String.valueOf(256 * 1024 * 1024)
,HoodieCompactionConfig.PAYLOAD_CLASS_NAME.key() -> classOf[GraphHoodieRecordPayload].getName
,HoodieCompactionConfig.ASYNC_CLEAN.key() -> "true"
,HoodieCompactionConfig.CLEANER_COMMITS_RETAINED.key() -> "3"
,HoodieCompactionConfig.INLINE_COMPACT_NUM_DELTA_COMMITS.key() -> "1"
,HoodieCompactionConfig.INLINE_COMPACT.key() -> "true"
,HoodieCompactionConfig.CLEANER_PARALLELISM_VALUE.key() -> "200"
))
}
df.write.format("org.apache.hudi"). options(c.getHudiConfig().build()). option(OPERATION.key(), "upsert"). option(HoodieWriteConfig.BULKINSERT_PARALLELISM_VALUE.key() ,argument.parallelism.toInt ). option(HoodieWriteConfig.INSERT_PARALLELISM_VALUE.key(),argument.parallelism.toInt). option(HoodieWriteConfig.UPSERT_PARALLELISM_VALUE.key() , argument.parallelism.toInt). mode(SaveMode.Append). save(c.getHudiConfig().basePath)
I deleted the small file, and then I can run it . Dirty files generated by write process? I don't think it should be exposed to reader
not sure how we generated a 4 byte parquet file. even headers and footers might come to > 4 bytes. But in general, we don't expose extra files generated due to spark task failures or some other extraneous files. This 4 byte file is something new which I haven't seen.
If you retry the operation, did it succeed? or is your job stuck?
Can you post the contents of /.hoodie in your table base path. Is there any way some other hudi writer process also writes to same table?
@bhasudha @bvaradar @leesf @danny0405 : have you folks encountered this before. a parquet file of size 4 bytes.
Closing this as user is able to get past the issue. We haven't come across such dirty files with hudi in general. Hudi cleans up any partially written files in general. Also, if a commit is partially failed, hudi should never be attempting to read it. thanks for reporting. If you encounter the issue again, feel free to re-open. Or if you can provide us w/ reproducing steps, would definitely look into debugging it.
this staff is also happened to me . when i use spark to read hudi table file .here is error: Caused by: java.io.IOException: Could not read footer for file: FileStatus{path=hdfs://HACluster/home/cloudeng/styx/cloud/hudi/fileSecurity/2022.01.08/4b2a8fc1-aa10-4987-aea1-49efd9875d19_2-12-48_20220110000308.parquet; isDirectory=false; length=4; replication=0; blocksize=0; modification_time=0; access_time=0; owner=; group=; permission=rw-rw-rw-; isSymlink=false}
me too. parquet is not a Parquet file (too small length: 0)

I guess this is a parquet that not committed, and the cleaner has not cleaned it yet when the reader reads this file.
I guess this is a parquet that not committed, and the cleaner has not cleaned it yet when the reader reads this file.
it seems that cleaner does not work well.

I guess this is a parquet that not committed, and the cleaner has not cleaned it yet when the reader reads this file.
it seems that cleaner does not work well.
One way to quickly fix it is to delete this empty file, or maybe we can delete this file when the reader encounter it, not a good pattern though.
hey @danny0405 we are encountering this issue of 0-byte parquet files during presto read. probably this happened when the job was getting failed due to the OffsetOutofRangeException. PFA stacktrace
com.facebook.presto.spi.PrestoException: wasb://[[email protected]/data/pipelines/hudi/kafka/telemetrics_v2/d2.v2/dt=2022-03-13/01972e41-3192-46ca-bc1b-6488f225deca-0_47-73-4745_20220315024339.parquet](http://[email protected]/data/pipelines/hudi/kafka/telemetrics_v2/d2.v2/dt=2022-03-13/01972e41-3192-46ca-bc1b-6488f225deca-0_47-73-4745_20220315024339.parquet) is not a valid Parquet File
at com.facebook.presto.hive.parquet.ParquetPageSourceFactory.createParquetPageSource(ParquetPageSourceFactory.java:315)
at com.facebook.presto.hive.parquet.ParquetPageSourceFactory.createPageSource(ParquetPageSourceFactory.java:172)
at com.facebook.presto.hive.HivePageSourceProvider.createHivePageSource(HivePageSourceProvider.java:394)
at com.facebook.presto.hive.HivePageSourceProvider.createPageSource(HivePageSourceProvider.java:184)
at com.facebook.presto.spi.connector.classloader.ClassLoaderSafeConnectorPageSourceProvider.createPageSource(ClassLoaderSafeConnectorPageSourceProvider.java:63)
at com.facebook.presto.split.PageSourceManager.createPageSource(PageSourceManager.java:80)
at com.facebook.presto.operator.ScanFilterAndProjectOperator.getOutput(ScanFilterAndProjectOperator.java:232)
at com.facebook.presto.operator.Driver.processInternal(Driver.java:418)
at com.facebook.presto.operator.Driver.lambda$processFor$9(Driver.java:301)
at com.facebook.presto.operator.Driver.tryWithLock(Driver.java:722)
at com.facebook.presto.operator.Driver.processFor(Driver.java:294)
at com.facebook.presto.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:1077)
at com.facebook.presto.execution.executor.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:162)
at com.facebook.presto.execution.executor.TaskExecutor$TaskRunner.run(TaskExecutor.java:599)
at com.facebook.presto.$gen.Presto_0_256_2ed7f73____20220314_124616_1.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.facebook.presto.parquet.ParquetCorruptionException: wasb://[[email protected]/data/pipelines/hudi/kafka/telemetrics_v2/d2.v2/dt=2022-03-13/01972e41-3192-46ca-bc1b-6488f225deca-0_47-73-4745_20220315024339.parquet](http://[email protected]/data/pipelines/hudi/kafka/telemetrics_v2/d2.v2/dt=2022-03-13/01972e41-3192-46ca-bc1b-6488f225deca-0_47-73-4745_20220315024339.parquet) is not a valid Parquet File
at com.facebook.presto.parquet.ParquetValidationUtils.validateParquet(ParquetValidationUtils.java:28)
at com.facebook.presto.parquet.cache.MetadataReader.readFooter(MetadataReader.java:81)
at com.facebook.presto.parquet.cache.MetadataReader.getParquetMetadata(MetadataReader.java:306)
at com.facebook.presto.hive.parquet.ParquetPageSourceFactory.createParquetPageSource(ParquetPageSourceFactory.java:223)
... 17 more
I have the same problem using Flink Offline compaction, the MOR table cannot be merged, is this a bug?
@stym06 Is your table a MOR table too ?
Can you post the contents of /.hoodie in your table base path. Is there any way some other hudi writer process also writes to same table?
@nsivabalan Can multiple hudi writer process writes to same table cause this?
Can you post the contents of /.hoodie in your table base path. Is there any way some other hudi writer process also writes to same table?
@nsivabalan Can multiple hudi writer process writes to same table cause this?
yes, I am using two hudi write processes on same table and getting this error.
I also encountered this mistake. flink -> hudi mor table.
This is the specific error message:
Maybe related with: https://github.com/apache/hudi/issues/8892#issuecomment-1663573970