Skip to content

Commit

Permalink
Rename ExtractorSettings to ExtractorProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
albertospelta committed Mar 26, 2024
1 parent 977bfb5 commit 6fb7f9e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
namespace Dax.Metadata;

using Newtonsoft.Json;
using System.ComponentModel;

public sealed class ExtractorSettings
public sealed class ExtractorProperties
{
/// <summary>
/// Specifies whether to enable statistics collection from the data instead of relying on the the DMVs. The result is more accurate statistics, but it can be slower.
/// </summary>
public bool StatisticsEnabled { get; set; }

/// <remarks>
/// This settings only applies when <see cref="StatisticsEnabled"/> is <see langword="true"/>.
/// </remarks>
[JsonIgnore] // Ignored in JSON serialization because RI violation values are not serialized
public int ReferentialIntegrityViolationSamples { get; set; }

/// <remarks>
/// This settings only applies when <see cref="StatisticsEnabled"/> is <see langword="true"/>.
/// </remarks>
Expand Down
4 changes: 2 additions & 2 deletions src/Dax.Metadata/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class Model
/// <summary>
/// Specifies settings used by the extractor
/// </summary>
public ExtractorSettings ExtractorSettings { get; set; }
public ExtractorProperties ExtractorProperties { get; set; }
/// <summary>
/// Library that manages the model info (e.g. Dax.Model)
/// </summary>
Expand Down Expand Up @@ -100,7 +100,7 @@ public class Model

public Model()
{
ExtractorSettings = new();
ExtractorProperties = new();
this.Tables = new List<Table>();
this.Relationships = new List<Relationship>();
this.Roles = new List<Role>();
Expand Down
10 changes: 5 additions & 5 deletions src/Dax.Model.Extractor/StatExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ protected IDbCommand CreateCommand(string commandText)
[Obsolete("This method may produce incomplete results if used on a model with DirectLake partitions and DirectLakeExtractionMode parameter set to anything other than ResidentOnly. Use TomExtractor.GetDaxModel instead.")]
public static void UpdateStatisticsModel(Dax.Metadata.Model daxModel, IDbConnection connection, int sampleRows = 0, bool analyzeDirectQuery = false , DirectLakeExtractionMode analyzeDirectLake = DirectLakeExtractionMode.ResidentOnly)
{
// TODO: Remove this code and use the ExtractorSettings as a parameter.
daxModel.ExtractorSettings.StatisticsEnabled = true;
daxModel.ExtractorSettings.DirectQueryMode = analyzeDirectQuery ? DirectQueryExtractionMode.Full : DirectQueryExtractionMode.None;
daxModel.ExtractorSettings.DirectLakeMode = analyzeDirectLake;
daxModel.ExtractorSettings.ReferentialIntegrityViolationSamples = sampleRows;
// TODO: Remove after rafactoring the code to use ExtractorSettings: ExtractorProperties as a parameter
daxModel.ExtractorProperties.StatisticsEnabled = true;
daxModel.ExtractorProperties.DirectQueryMode = analyzeDirectQuery ? DirectQueryExtractionMode.Full : DirectQueryExtractionMode.None;
daxModel.ExtractorProperties.DirectLakeMode = analyzeDirectLake;
//daxModel.ExtractorProperties.ReferentialIntegrityViolationSamples = sampleRows;

StatExtractor extractor = new StatExtractor(daxModel, connection);
extractor.LoadTableStatistics(analyzeDirectQuery, analyzeDirectLake);
Expand Down

0 comments on commit 6fb7f9e

Please sign in to comment.