Skip to content

Parquet export fails ungracefully on empty source table #6318

@jerrinot

Description

@jerrinot

To reproduce

When exporting an empty table to Parquet the procedure fails ungracefully when the source has no rows. When done via web console it saves a file a 3B byte named as questdb-query-1761566962054.lCYhugmN.parquet.part and then the connection is abruptly closed.

This is not ideal, as there are various use cases for exporting an empty file. Think of various automations, batch jobs, reporting (e.g. running a query to find outliers and there happens to be no outliers in the dataset) etc.

QuestDB version:

27c807e

OS, in case of Docker specify Docker and the Host OS:

ubuntu

File System, in case of Docker specify Host File System:

ext4

Full Name:

Jaromir Hamala

Affiliation:

QuestDB

Have you followed Linux, MacOs kernel configuration steps to increase Maximum open files and Maximum virtual memory areas limit?

  • Yes, I have

Additional context

server log:

2025-10-27T12:00:01.021922Z I i.q.c.h.p.JsonQueryProcessorState [324270031885] timings [compiler: 0, count: 0, execute: 218710, q=`wal_tables()`]
2025-10-27T12:00:01.038093Z I i.q.g.e.QueryProgress exe [id=178, sql=`select * from 🙂`, principal=admin, cache=true, jit=false]
2025-10-27T12:00:01.038929Z I i.q.c.p.SerialParquetExporter starting to create temporary table and populate with data [id=2d572b60904075c8, table=zzz.copy.2d572b60904075c8]
2025-10-27T12:00:01.039263Z I i.q.c.CairoEngine locked [table=zzz.copy.2d572b60904075c8, thread=47]
2025-10-27T12:00:01.049630Z I c.q.s.EntDdlListener parquet export temp table has been created [principal=admin, name=zzz.copy.2d572b60904075c8]
2025-10-27T12:00:01.049683Z I i.q.c.TableWriter open 'zzz.copy.2d572b60904075c8'
2025-10-27T12:00:01.049883Z I i.q.c.TableWriter switched partition [path=/zzz.copy.2d572b60904075c8/default, rowCount=0]
2025-10-27T12:00:01.051086Z I i.q.c.CairoEngine unlocked [table=zzz.copy.2d572b60904075c8]
2025-10-27T12:00:01.051150Z I i.q.c.p.SerialParquetExporter completed creating temporary table and populating with data [id=2d572b60904075c8, table=zzz.copy.2d572b60904075c8]
2025-10-27T12:00:01.051474Z E i.q.c.p.SerialParquetExporter export to parquet failed, table is empty [id=2d572b60904075c8]
2025-10-27T12:00:01.051607Z I i.q.c.TableWriter closed [table=zzz.copy.2d572b60904075c8]
2025-10-27T12:00:01.051611Z I i.q.c.p.WriterPool closed [table=zzz.copy.2d572b60904075c8, reason=LOCKED, by=47]
2025-10-27T12:00:01.051669Z I i.q.c.p.ReaderPool closed [table=zzz.copy.2d572b60904075c8, at=0:0, reason=LOCKED]
2025-10-27T12:00:01.051675Z I i.q.c.CairoEngine locked [table=zzz.copy.2d572b60904075c8, thread=47]
2025-10-27T12:00:01.051803Z I i.q.c.MetadataCache dropped [table=zzz.copy.2d572b60904075c8]
2025-10-27T12:00:01.051885Z E i.q.c.h.p.ExportQueryProcessor partial parquet response sent, closing connection on error [fd=319975064588, parquetFileOffset=3, errorMessage=empty table]

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions