mukunku / ParquetViewer

Simple Windows desktop application for viewing & querying Apache Parquet files
GNU General Public License v3.0
687 stars 82 forks source link

[BUG] Exception repeatedly thrown when widening window to include a column containing arrays of bytes #79

Closed Dave-Kiwi closed 10 months ago

Dave-Kiwi commented 1 year ago

Parquet Viewer Version Version 2.6.0 and later. Works just fine on earlier versions.

Where was the parquet file created? Locally using C#

Sample File Contains PHI. I can make a sanitized one if you think it is needed. Let me know if you have trouble reproducing with a parquet file containing a byte[] column.

Describe the bug When the window is widened to the column in question, the application repeatedly throws the exception in the attachment

Screenshots image

Additional context I suspect the app is having a problem with a column of type byte[]

Note: This tool relies on the parquet-dotnet library for all the actual Parquet processing. So any issues where that library cannot process a parquet file will not be addressed by us. Please open a ticket on that library's repo to address such issues.

MachineParadox101 commented 12 months ago

Have the same issue with v2.6 throwing error for byte columns. 2.4.7834 also threw an error 'encoding RLE_Dictionary is not supported' for the same file.

Edit: also an issue in 2.7.0.3

mukunku commented 10 months ago

I haven't been able to replicate this issue on my end. I tried with a parquet file containing byte and byte[] fields.

image

Any chance you folks could provide a sample file?

Dave-Kiwi commented 10 months ago

I haven't been able to replicate this issue on my end. I tried with a parquet file containing byte and byte[] fields.

image

Any chance you folks could provide a sample file?

Sure thing - the attached one fails pretty hard on Version 2.7.1.0. In 2.6.0.2 it shows just the first two columns, but not the last (byte[]) column. In 2.4.2.0 it works great (shows all three columns, including last byte[] column). BytesFailsIn2.7.1.0.zip

mukunku commented 10 months ago

Thanks a lot for the sample file @Dave-Kiwi .

I added a temporary patch to support converting byte[] data to string so it can be displayed. This is available now in v2.7.2.1 image

Details

So this is an issue with the fact that we use AutoGenerateColumns = true when generating the gridview. And the internal .net framework logic thinks byte[] types are for images. So it tries to render an image with your byte data and fails. And it fails for each cell so that might be why it triggers so often.

I also put in a fix so any time a value can't be rendered it will be skipped like so: image

A real proper fix would be to do our own column generation and handle all the different data types ourselves. This is something I'll have to pursue another time; if there's more desire to support different array types.

Dave-Kiwi commented 10 months ago

Thanks @mukunku! Yes, the byte[] in the sample file is a 3D mask we use for our application that does not correspond to any well-known file type. I think the solution you have provided is excellent, and will serve our purposes very nicely.