Skip to content

Commit 2b5e92d

Browse files
author
Wan Yang
committed
update NewAzureSynapseSparkPool
1 parent b9d2fa2 commit 2b5e92d

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/Synapse/Synapse/Commands/ManagementCommands/SparkPool/NewAzureSynapseSparkPool.cs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class NewAzureSynapseSparkPool : SynapseCmdletBase
4848
[ValidateNotNull]
4949
public Hashtable Tag { get; set; }
5050

51-
[Parameter(ValueFromPipelineByPropertyName = false, Mandatory = true,
51+
[Parameter(ValueFromPipelineByPropertyName = false, Mandatory = false,
5252
HelpMessage = HelpMessages.NodeCount)]
5353
[ValidateRange(3, 200)]
5454
public int NodeCount { get; set; }
@@ -139,7 +139,17 @@ public override void ExecuteCmdlet()
139139
throw new SynapseException(string.Format(Resources.WorkspaceDoesNotExist, this.WorkspaceName));
140140
}
141141

142-
LibraryRequirements libraryRequirements = null;
142+
// NodeCount and EnableAutoScale are given at the same time
143+
if (this.NodeCount != 0 && EnableAutoScale.IsPresent)
144+
{
145+
throw new SynapseException(string.Format("",""));
146+
}
147+
// both NodeCount and EnableAutoScale are not given
148+
if (this.NodeCount == 0 && !EnableAutoScale.IsPresent) {
149+
throw new SynapseException(string.Format("", ""));
150+
}
151+
152+
LibraryRequirements libraryRequirements = null;
143153
if (this.IsParameterBound(c => c.LibraryRequirementsFilePath))
144154
{
145155
var powerShellDestinationPath = SessionState.Path.GetUnresolvedProviderPathFromPSPath(LibraryRequirementsFilePath);
@@ -155,7 +165,10 @@ public override void ExecuteCmdlet()
155165
{
156166
Location = existingWorkspace.Location,
157167
Tags = TagsConversionHelper.CreateTagDictionary(this.Tag, validate: true),
158-
NodeCount = this.NodeCount,
168+
//NodeCount = this.NodeCount,
169+
170+
NodeCount = EnableAutoScale.IsPresent ? (int?) null : this.NodeCount,
171+
159172
NodeSizeFamily = NodeSizeFamily.MemoryOptimized,
160173
NodeSize = NodeSize,
161174
AutoScale = !EnableAutoScale.IsPresent ? null : new AutoScaleProperties

0 commit comments

Comments
 (0)