-
Notifications
You must be signed in to change notification settings - Fork 208
Expand file tree
/
Copy pathCatalogSamples.cs
More file actions
28 lines (25 loc) · 946 Bytes
/
CatalogSamples.cs
File metadata and controls
28 lines (25 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
namespace Microsoft.Spark.CSharp.Samples
{
class CatalogSamples
{
[Sample]
internal static void CatalogSample()
{
var catalog = SparkSessionSamples.GetSparkSession().Catalog;
var currentDatabase = catalog.CurrentDatabase;
var databasesList = SparkSessionSamples.GetSparkSession().Catalog.ListDatabases().Collect();
if (SparkCLRSamples.Configuration.IsValidationEnabled)
{
var defaultDatabase = databasesList.First(row => row.Get("name").Equals("default")); //throws exception if First() is missing
}
}
}
}