Example #1
0
 public PredictorColumnSubQuery(PredictorSubQueryColumnEmbedded predictorSubQueryColumn, int predictorColumnIndex, PredictorSubQueryEntity subQuery, object?[] keys) :
     base(predictorColumnIndex)
 {
     PredictorSubQueryColumn = predictorSubQueryColumn;
     SubQuery = subQuery;
     Keys     = keys;
 }
Example #2
0
    static string?SubQueryColumn_StaticPropertyValidation(PredictorSubQueryColumnEmbedded column, PropertyInfo pi)
    {
        var sq = column.GetParentEntity <PredictorSubQueryEntity>();
        var p  = sq.GetParentEntity <PredictorEntity>() !;

        if (p.Algorithm == null || column.Usage == PredictorSubQueryColumnUsage.ParentKey || column.Usage == PredictorSubQueryColumnUsage.SplitBy)
        {
            return(null);
        }

        var algorithm = Algorithms.GetOrThrow(p.Algorithm);
        var usage     = column.Usage == PredictorSubQueryColumnUsage.Input ? PredictorColumnUsage.Input : PredictorColumnUsage.Output;

        return(algorithm.ValidateEncodingProperty(p, sq, column.Encoding, usage, column.Token));
    }
Example #3
0
    static string?GroupKey_StaticPropertyValidation(PredictorSubQueryColumnEmbedded column, PropertyInfo pi)
    {
        var sq = column.GetParentEntity <PredictorSubQueryEntity>() !;
        var p  = sq.GetParentEntity <PredictorEntity>() !;

        if (column.Token != null && column.Usage == PredictorSubQueryColumnUsage.ParentKey)
        {
            var index  = sq.Columns.Where(a => a.Usage == PredictorSubQueryColumnUsage.ParentKey).IndexOf(column);
            var tokens = GetParentKeys(p.MainQuery);
            var token  = tokens.ElementAtOrDefault(index);

            if (token == null)
            {
                return(null);
            }

            if (!Compatible(token, column.Token.Token))
            {
                return(PredictorMessage.TheTypeOf01DoesNotMatch23.NiceToString(column.Token.Token, column.Token.Token.NiceTypeName, token, token.NiceTypeName));
            }
        }

        return(null);
    }