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] sbyte and byte types swapped #75

Closed maurikke closed 1 year ago

maurikke commented 1 year ago

Parquet Viewer Version Version 2.7.0.0.

Where was the parquet file created? My own tool

Describe the bug In the parquet viewer SByte and Bye are mixed up:

your code:

    private static Type ParquetNetTypeToCSharpType(Parquet.Thrift.SchemaElement thriftSchema, Parquet.Schema.DataType type)
        {
            Type columnType;
            switch (type)
            {
---removed some lines---
                case Parquet.Schema.DataType.Byte:
                    columnType = typeof(sbyte);    --> should be typeof(byte) as a .Net byte is unsigned
                    break;
---removed some lines---
                case Parquet.Schema.DataType.SignedByte:
                    columnType = typeof(byte);   --> should be typeof(sbyte) as a .Net byte is unsigned
                    break;
---removed some lines---            }

            return columnType;
        }

atleast fixed solved the problem for my test.

Kind regards, Maurice,

mukunku commented 1 year ago

Thanks for the report. This has been fixed now in: https://github.com/mukunku/ParquetViewer/releases/tag/v2.7.0.3