in csharp/Microsoft.Azure.Databricks.Client/Models/ClusterAttributes.cs [253:291]
private static string DatabricksAllowedReplLang(bool enableTableAccessControl, ClusterMode clusterMode) =>
enableTableAccessControl ? "python,sql" : clusterMode == ClusterMode.HighConcurrency ? "sql,python,r" : null;
/// <summary>
/// When enabled:
/// Allows users to run SQL, Python, and PySpark commands. Users are restricted to the SparkSQL API and DataFrame API, and therefore cannot use Scala, R, RDD APIs, or clients that directly read the data from cloud storage, such as DBUtils.
/// Cannot acquire direct access to data in the cloud via DBFS or by reading credentials from the cloud provider’s metadata service.
/// Requires that clusters run Databricks Runtime 3.5 or above.
/// Must run their commands on cluster nodes as a low-privilege user forbidden from accessing sensitive parts of the filesystem or creating network connections to ports other than 80 and 443.
/// </summary>
private bool _enableTableAccessControl;
public ClusterAttributes WithTableAccessControl(bool enableTableAccessControl)
{
_enableTableAccessControl = enableTableAccessControl;
SparkConfiguration ??= new Dictionary<string, string>();
if (enableTableAccessControl)
{
SparkConfiguration["spark.databricks.acl.dfAclsEnabled"] = "true";
}
else
{
SparkConfiguration.Remove("spark.databricks.acl.dfAclsEnabled");
}
var allowedReplLang = DatabricksAllowedReplLang(enableTableAccessControl, _clusterMode);
if (string.IsNullOrEmpty(allowedReplLang))
{
SparkConfiguration.Remove("spark.databricks.repl.allowedLanguages");
}
else
{
SparkConfiguration["spark.databricks.repl.allowedLanguages"] = allowedReplLang;
}
return this;
}