/// <summary> /// Finds common substrings for each position in the texts of the specified column. /// It uses a batch approach to query for several positions (specified using SubstringQueryColumnCount) /// using a single query. /// </summary> private static async Task <SubstringsData> ExploreSubstrings( DConnection conn, ExplorerContext ctx, int substringQueryColumnCount, params int[] substringLengths) { var substrings = new SubstringsData(); foreach (var length in substringLengths) { var hasRows = true; for (var pos = 0; hasRows; pos += substringQueryColumnCount) { var query = new TextColumnSubstring(ctx.Table, ctx.Column, pos, length, substringQueryColumnCount); var sstrResult = await conn.Exec(query); hasRows = false; foreach (var row in sstrResult.Rows) { if (row.HasValue) { hasRows = true; substrings.Add(pos + row.Index, row.Value, row.Count); } } } } return(substrings); }
private static async Task <bool> CheckIsEmail(DConnection conn, ExplorerContext ctx) { var emailCheck = await conn.Exec( new TextColumnTrim(ctx.Table, ctx.Column, TextColumnTrimType.Both, Constants.EmailAddressChars)); return(emailCheck.Rows.All(r => r.IsNull || (!r.IsSuppressed && r.Value == "@"))); }
/// <summary> /// Configure a column exploration. /// </summary> /// <param name="conn">A DConnection configured for the Api backend.</param> /// <param name="ctx">An <see cref="ExplorerContext" /> defining the exploration parameters.</param> /// <param name="componentConfiguration"> /// An action to add and configure the components to use in this exploration. /// </param> /// <returns>A new ColumnExploration object.</returns> public ColumnExploration LaunchColumnExploration( DConnection conn, ExplorerContext ctx, Action <ExplorationConfig> componentConfiguration) { // This scope (and all the components resolved within) should live until the end of the Task. return(ExploreColumn(rootContainer.GetNestedContainer(), conn, ctx, componentConfiguration)); }
public NumericHistogramComponent( DConnection conn, ExplorerContext ctx, ResultProvider <SimpleStats <double> .Result> statsResultProvider) { this.conn = conn; this.ctx = ctx; this.statsResultProvider = statsResultProvider; }
public TextLengthComponent( DConnection conn, ExplorerContext ctx, ResultProvider <IsolatorCheckComponent.Result> isolatorCheck) { this.ctx = ctx; this.conn = conn; this.isolatorCheck = isolatorCheck; }
private static async Task <SubstringWithCountList> ExploreEmailDomains(DConnection conn, ExplorerContext ctx) { var domains = await conn.Exec(new TextColumnTrim( ctx.Table, ctx.Column, TextColumnTrimType.Leading, Constants.EmailAddressChars)); return(SubstringWithCountList.FromValueWithCountEnum( domains.Rows .Where(r => r.HasValue && r.Value.StartsWith("@", StringComparison.InvariantCulture)))); }
public TextGeneratorComponent(DConnection conn, ExplorerContext ctx, EmailCheckComponent emailChecker) { this.conn = conn; this.ctx = ctx; this.emailChecker = emailChecker; GeneratedValuesCount = DefaultGeneratedValuesCount; EmailDomainsCountThreshold = DefaultEmailDomainsCountThreshold; SubstringQueryColumnCount = DefaultSubstringQueryColumnCount; }
/// <summary> /// Configure a column exploration within a given scope. /// </summary> /// <param name="scope">The scoped container to use for object resolution.</param> /// <param name="conn">A DConnection configured for the Api backend.</param> /// <param name="ctx">An <see cref="ExplorerContext" /> defining the exploration parameters.</param> /// <param name="componentConfiguration"> /// An action to add and configure the components to use in this exploration. /// </param> /// <returns>A new ColumnExploration object.</returns> public static ColumnExploration ExploreColumn( INestedContainer scope, DConnection conn, ExplorerContext ctx, Action <ExplorationConfig> componentConfiguration) { // Configure a new Exploration var config = new ExplorationConfig(scope); config.UseConnection(conn); config.UseContext(ctx); config.Compose(componentConfiguration); return(new ColumnExploration(config, scope, ctx.Column)); }
public CyclicalTimeBuckets(DConnection conn, ExplorerContext ctx) { this.conn = conn; this.ctx = ctx; }
public EmailCheckComponent(DConnection conn, ExplorerContext ctx) { this.conn = conn; this.ctx = ctx; }
/// <summary> /// Configure an exploration. /// </summary> /// <param name="dataSource">The data source name on which to execute the exploration.</param> /// <param name="table">The table name on which to execute the exploration.</param> /// <param name="conn">A DConnection configured for the Api backend.</param> /// <param name="explorationSettings"> /// A list of tuples containing the exploration parameters and /// the action to add and configure the components to use in this exploration. /// </param> /// <returns>A new Exploration object.</returns> public Exploration LaunchExploration( string dataSource, string table, DConnection conn, IEnumerable <(Action <ExplorationConfig> ComponentConfig, ExplorerContext Context)> explorationSettings)
public MinMaxRefiner(DConnection conn, ExplorerContext ctx) { this.ctx = ctx; this.conn = conn; }
private static async Task <SubstringWithCountList> ExploreEmailTopLevelDomains(DConnection conn, ExplorerContext ctx) { var suffixes = await conn.Exec(new TextColumnSuffix(ctx.Table, ctx.Column, 3, 7)); return(SubstringWithCountList.FromValueWithCountEnum( suffixes.Rows .Where(r => r.HasValue && r.Value.StartsWith(".", StringComparison.InvariantCulture)))); }
public LinearTimeBuckets(DConnection conn, ExplorerContext ctx) { this.conn = conn; this.ctx = ctx; }
public IsolatorCheckComponent(DConnection conn, ExplorerContext ctx) { this.ctx = ctx; this.conn = conn; }
public SimpleStats(DConnection conn, ExplorerContext ctx) { this.conn = conn; this.ctx = ctx; }
public DistinctValuesComponent(DConnection conn, ExplorerContext ctx) { this.ctx = ctx; this.conn = conn; }
public void UseConnection(DConnection conn) => scope.Inject(conn);