Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aloneguid committed Oct 11, 2022
2 parents c1db3be + 8795b4b commit 14b15e5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/Parquet.Test/ParquetReaderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ public async Task Reads_multi_page_file() {
}
}

[Fact]
public async Task Reads_rle_dictionary_encoded_columns() {
using(ParquetReader reader = await ParquetReader.CreateAsync(OpenTestFile("rle_dictionary_encoded_columns.parquet"), leaveStreamOpen: false)) {
DataColumn[] data = await reader.ReadEntireRowGroupAsync();

//If we made it this far we were able to read all the columns
Assert.Single(data[0].Data);
Assert.Equal(40539, ((float?[])data[0].Data)[0]);
}
}

[Fact]
public async Task Reads_byte_arrays() {
byte[] nameValue;
Expand Down
Binary file not shown.
3 changes: 2 additions & 1 deletion src/Parquet/File/DataColumnReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ private void ReadColumn(BinaryReader reader, Thrift.Encoding encoding, long tota
break;

case Thrift.Encoding.PLAIN_DICTIONARY:
case Thrift.Encoding.RLE_DICTIONARY:
if(cd.indexes == null)
cd.indexes = new int[(int)totalValues];
indexCount = ReadPlainDictionary(reader, maxReadCount, cd.indexes, 0);
Expand Down Expand Up @@ -277,4 +278,4 @@ private static int GetRemainingLength(BinaryReader reader) {
return (int)(reader.BaseStream.Length - reader.BaseStream.Position);
}
}
}
}

0 comments on commit 14b15e5

Please sign in to comment.