-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EES-5017 Create indicators Parquet meta table
- Loading branch information
Showing
8 changed files
with
97 additions
and
2 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
12 changes: 12 additions & 0 deletions
12
src/GovUk.Education.ExploreEducationStatistics.Public.Data.Model/Parquet/ParquetIndicator.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,12 @@ | ||
namespace GovUk.Education.ExploreEducationStatistics.Public.Data.Model.Parquet; | ||
|
||
public class ParquetIndicator | ||
{ | ||
public required string Id { get; set; } | ||
|
||
public required string Label { get; set; } | ||
|
||
public string Unit { get; set; } = string.Empty; | ||
|
||
public byte DecimalPlaces { get; set; } | ||
} |
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
31 changes: 31 additions & 0 deletions
31
....Education.ExploreEducationStatistics.Public.Data.Model/Parquet/Tables/IndicatorsTable.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,31 @@ | ||
namespace GovUk.Education.ExploreEducationStatistics.Public.Data.Model.Parquet.Tables; | ||
|
||
public static class IndicatorsTable | ||
{ | ||
public const string TableName = "indicators"; | ||
|
||
public static class Cols | ||
{ | ||
public const string Id = "id"; | ||
public const string Label = "label"; | ||
public const string Unit = "unit"; | ||
public const string DecimalPlaces = "decimal_places"; | ||
} | ||
|
||
public static string Alias(IndicatorMeta indicator) => $"\"{indicator.PublicId}\""; | ||
|
||
private static readonly TableRef DefaultRef = new(TableName); | ||
|
||
public static TableRef Ref(IndicatorMeta? indicator = null) | ||
=> indicator is not null ? new(Alias(indicator)) : DefaultRef; | ||
|
||
public class TableRef(string table) | ||
{ | ||
public readonly string Id = $"{table}.{Cols.Id}"; | ||
public readonly string Label = $"{table}.{Cols.Label}"; | ||
public readonly string Unit = $"{table}.{Cols.Unit}"; | ||
public readonly string DecimalPlaces = $"{table}.{Cols.DecimalPlaces}"; | ||
|
||
public string Col(string column) => $"{table}.\"{column}\""; | ||
} | ||
} |
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
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