-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from RevealBi/data-source/snowflake
Update Snowflake datasource / datasource item
- Loading branch information
Showing
7 changed files
with
190 additions
and
25 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,50 @@ | ||
using Reveal.Sdk.Dom; | ||
using Reveal.Sdk.Dom.Data; | ||
using Reveal.Sdk.Dom.Visualizations; | ||
using System.Collections.Generic; | ||
|
||
namespace Sandbox.DashboardFactories | ||
{ | ||
internal class SnowflakeDashboard : IDashboardCreator | ||
{ | ||
public string Name => "Snowflake Data Source"; | ||
|
||
public RdashDocument CreateDashboard() | ||
{ | ||
var snowflakeDS = new SnowflakeDataSource() | ||
{ | ||
Id = "SnowflakeDSId", | ||
Title = "Snowflake Data source", | ||
Subtitle = "Snowflake Subtitle", | ||
Account = "pqwkobs-xb90908", | ||
DefaultRefreshRate = "120", | ||
Host = "gpiskyj-al16914.snowflakecomputing.com", | ||
Database = "SNOWFLAKE_SAMPLE_DATA", | ||
Warehouse = "COMPUTE_WH", | ||
Schema = "TPCDS_SF100TCL" | ||
}; | ||
|
||
var snowflakeDSI = new SnowflakeDataSourceItem("Snowflake DSI Title", snowflakeDS) | ||
{ | ||
Id = "SnowflakeDSItemId", | ||
Title = "Snowflake data source Item", | ||
Subtitle = "Snowflake data source Item Subtitle", | ||
Schema = "TPCH_SF10", | ||
Table = "ORDERS", | ||
Database = "SNOWFLAKE_SAMPLE_DATA", | ||
Fields = new List<IField> | ||
{ | ||
new NumberField("O_ORDERKEY"), | ||
new NumberField("O_CUSTKEY"), | ||
new TextField("O_ORDERPRIORITY"), | ||
} | ||
}; | ||
|
||
var document = new RdashDocument("Snowflake Dashboard"); | ||
|
||
document.Visualizations.Add(new PieChartVisualization("Snowflake Order Priorities", snowflakeDSI) | ||
.SetLabel("O_ORDERPRIORITY").SetValues("O_CUSTKEY")); | ||
return document; | ||
} | ||
} | ||
} |
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
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