-
-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug: empty logical type container is created if there is no matching …
…logical type (#314) * do not create a logical type container if there is no corresponding logical type * fix test asserts and bump version to 4.9.2
- Loading branch information
Showing
4 changed files
with
86 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: 'Full Workflow' | ||
|
||
env: | ||
VERSION: 4.9.1 | ||
VERSION: 4.9.2 | ||
ASM_VERSION: 4.0.0 | ||
|
||
on: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/Parquet.Test/Integration/WriteQuestionableTypesTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Parquet.Data; | ||
using Parquet.Schema; | ||
using Xunit; | ||
using F = System.IO.File; | ||
using Path = System.IO.Path; | ||
|
||
namespace Parquet.Test.Integration { | ||
public class WriteQuestionableTypesTest : IntegrationBase { | ||
|
||
private async Task<string> ReadWithPQT(ParquetSchema schema, DataColumn dc) { | ||
string testFileName = Path.GetFullPath($"temp.{nameof(WriteQuestionableTypesTest)}.parquet"); | ||
if(F.Exists(testFileName)) | ||
F.Delete(testFileName); | ||
|
||
using(Stream s = F.OpenWrite(testFileName)) { | ||
using(ParquetWriter writer = await ParquetWriter.CreateAsync(schema, s)) { | ||
using ParquetRowGroupWriter rgw = writer.CreateRowGroup(); | ||
|
||
await rgw.WriteColumnAsync(dc); | ||
} | ||
} | ||
|
||
string? json = ExecMrCat(testFileName); | ||
return json ?? string.Empty; | ||
} | ||
|
||
[Fact] | ||
public async Task DateTime_Default() { | ||
var schema = new ParquetSchema(new DataField<DateTime>("qtype")); | ||
var dc = new DataColumn(schema.DataFields.First(), new[] { new DateTime(2023, 04, 25, 1, 2, 3) }); | ||
string json = await ReadWithPQT(schema, dc); | ||
Assert.Equal("{\"qtype\":\"AK4X1GIDAACciSUA\"}", json); | ||
} | ||
|
||
[Fact] | ||
public async Task Timestamp_Default() { | ||
var schema = new ParquetSchema(new DataField<TimeSpan>("qtype")); | ||
var dc = new DataColumn(schema.DataFields.First(), new[] { TimeSpan.FromHours(7) }); | ||
string json = await ReadWithPQT(schema, dc); | ||
Assert.Equal("{\"qtype\":25200000}", json); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters