Skip to content

Commit f8ae1f1

Browse files
[cli] Bump VPAX 1.7.0, add advanced export options (#137)
* Bump version 1.2 * Bump VPAX version 1.7.0 * Add advanced export options Adds `--direct-query-mode`, `--direct-lake-mode` and `--column-batch-size`
1 parent 1cd1869 commit f8ae1f1

File tree

5 files changed

+43
-9
lines changed

5 files changed

+43
-9
lines changed

src/Dax.Vpax.CLI/Commands/ExportCommand.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ internal static Command GetCommand()
1414
PathArgument,
1515
ConnectionStringArgument,
1616
OverwriteOption,
17+
// advanced options
1718
ExcludeTomOption,
18-
ExcludeVpaOption
19+
ExcludeVpaOption,
20+
DirectQueryModeOption,
21+
DirectLakeModeOption,
22+
ColumnBatchSizeOption,
1923
};
2024
command.Handler = s_handler;
2125
return command;

src/Dax.Vpax.CLI/Commands/ExportCommandHandler.cs

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.CommandLine.Invocation;
1+
using System.CommandLine;
2+
using System.CommandLine.Invocation;
23
using System.CommandLine.IO;
34
using Dax.Metadata;
45
using Dax.Model.Extractor;
@@ -23,6 +24,9 @@ public async Task<int> InvokeAsync(InvocationContext context)
2324
var overwrite = context.ParseResult.GetValueForOption(OverwriteOption);
2425
var excludeTom = context.ParseResult.GetValueForOption(ExcludeTomOption);
2526
var excludeVpa = context.ParseResult.GetValueForOption(ExcludeVpaOption);
27+
var directQueryMode = context.ParseResult.GetValueForOption(DirectQueryModeOption);
28+
var directLakeMode = context.ParseResult.GetValueForOption(DirectLakeModeOption);
29+
var columnBatchSize = context.ParseResult.GetValueForOption(ColumnBatchSizeOption);
2630

2731
using var vpaxStream = new MemoryStream();
2832

@@ -34,9 +38,10 @@ public async Task<int> InvokeAsync(InvocationContext context)
3438
applicationName: extractorAppName,
3539
applicationVersion: extractorAppVersion,
3640
readStatisticsFromData: true,
37-
sampleRows: 0, // RI violation sampling is not applicable to VPAX files
38-
analyzeDirectQuery: true,
39-
analyzeDirectLake: DirectLakeExtractionMode.Full
41+
sampleRows: 0, // not applicable for VPAX export
42+
analyzeDirectQuery: directQueryMode != DirectQueryExtractionMode.None,
43+
analyzeDirectLake: directLakeMode,
44+
statsColumnBatchSize: columnBatchSize
4045
);
4146

4247
var vpaModel = excludeVpa ? null : new ViewVpaExport.Model(daxModel);

src/Dax.Vpax.CLI/Commands/ExportCommandOptions.cs

+26-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
using System.CommandLine;
1+
using Dax.Metadata;
2+
using Dax.Model.Extractor;
3+
using System.CommandLine;
24
using System.Data.Common;
35

46
namespace Dax.Vpax.CLI.Commands;
@@ -43,4 +45,27 @@ internal static class ExportCommandOptions
4345
getDefaultValue: () => false,
4446
description: "Exclude the VPA model (DaxVpaView.json) from the export"
4547
);
48+
49+
public static readonly Option<DirectQueryExtractionMode> DirectQueryModeOption = new(
50+
name: "--direct-query-mode",
51+
getDefaultValue: () => DirectQueryExtractionMode.Full,
52+
description: "Direct Query extraction mode"
53+
);
54+
55+
public static readonly Option<DirectLakeExtractionMode> DirectLakeModeOption = new(
56+
name: "--direct-lake-mode",
57+
getDefaultValue: () => DirectLakeExtractionMode.Full,
58+
description: "Direct Lake extraction mode"
59+
);
60+
61+
public static readonly Option<int> ColumnBatchSizeOption = new(
62+
name: "--column-batch-size",
63+
getDefaultValue: () => StatExtractor.DefaultColumnBatchSize,
64+
description: "Number of rows processed at a time during column statistics analysis"
65+
);
66+
67+
//static ExportCommandOptions()
68+
//{
69+
// //ExtractorDirectLakeMode.FromAmong();
70+
//}
4671
}

src/Dax.Vpax.CLI/Dax.Vpax.CLI.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
</PropertyGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="Dax.Model.Extractor" Version="1.6.0" />
31-
<PackageReference Include="Dax.Vpax" Version="1.6.0" />
30+
<PackageReference Include="Dax.Model.Extractor" Version="1.7.0" />
31+
<PackageReference Include="Dax.Vpax" Version="1.7.0" />
3232
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
3333
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" PrivateAssets="all" />
3434
</ItemGroup>

src/Dax.Vpax.CLI/version.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "1.1",
3+
"version": "1.2",
44
"nugetPackageVersion": {
55
"semVer": 2
66
},

0 commit comments

Comments
 (0)