forked from tensorflow/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
61 plain non nullable types (tensorflow#68)
* added new row indexer for parquet data frame * updated all tests and code to use DateTimeOffset * added logical JSON type * added new dataset handling of rows through pivoting * Update PlainValuesReader.cs * built more single responsibility around ParquetReader type to ensure efficient deallocation of resources using IDisposable * updated reader to look at nulls * added branches to set type IList as either nullable or non-nullable and done this against the required attribute on the column header * moved BigDecimal to own file
- Loading branch information
1 parent
1e8407c
commit 4fe2758
Showing
3 changed files
with
106 additions
and
76 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System.Numerics; | ||
|
||
namespace Parquet.File.Values | ||
{ | ||
public struct BigDecimal | ||
{ | ||
public decimal Integer { get; set; } | ||
public int Scale { get; set; } | ||
public int Precision { get; set; } | ||
|
||
public BigDecimal(BigInteger integer, int scale, int precision) : this() | ||
{ | ||
Integer = (decimal) integer; | ||
Scale = scale; | ||
Precision = precision; | ||
while (Scale > 0) | ||
{ | ||
Integer /= 10; | ||
Scale -= 1; | ||
} | ||
Scale = scale; | ||
} | ||
|
||
public static explicit operator decimal(BigDecimal bd) | ||
{ | ||
return bd.Integer; | ||
} | ||
|
||
// TODO: Add to byte array for writer | ||
} | ||
} |
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
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