Skip to content

Commit

Permalink
[ksqlDB.RestApi.Client]: Linq fixed warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfabian committed Mar 5, 2024
1 parent ad65692 commit 121989b
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 94 deletions.
56 changes: 28 additions & 28 deletions ksqlDb.RestApi.Client/KSql/Linq/IAggregations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public interface IAggregations<out TSource> : IAggregations
#region CollectList

/// <summary>
/// Gather all of the values from an input grouping into a single Array field.
/// Gather all the values from an input grouping into a single Array field.
/// Although this aggregate works on both Stream and Table inputs, the order of entries in the result array is
/// not guaranteed when working on Table input data.
/// This version limits the size of the resultant Array to 1000 entries, beyond which any further values will
Expand All @@ -122,7 +122,7 @@ public interface IAggregations<out TSource> : IAggregations
bool[] CollectList(Func<TSource, bool> selector);

/// <summary>
/// Gather all of the values from an input grouping into a single Array field.
/// Gather all the values from an input grouping into a single Array field.
/// Although this aggregate works on both Stream and Table inputs, the order of entries in the result array is
/// not guaranteed when working on Table input data.
/// This version limits the size of the resultant Array to 1000 entries, beyond which any further values will
Expand All @@ -133,18 +133,18 @@ public interface IAggregations<out TSource> : IAggregations
string[] CollectList(Func<TSource, string> selector);

/// <summary>
/// Gather all of the values from an input grouping into a single Array field.
/// Gather all the values from an input grouping into a single Array field.
/// Although this aggregate works on both Stream and Table inputs, the order of entries in the result array is
/// not guaranteed when working on Table input data.
/// This version limits the size of the resultant Array to 1000 entries, beyond which any further values will
/// be silently ignored.
/// </summary>
/// <param name="selector"></param>
/// <returns>collect values of a Int field into a single Array</returns>
/// <returns>collect values of an Int field into a single Array</returns>
int[] CollectList(Func<TSource, int> selector);

/// <summary>
/// Gather all of the values from an input grouping into a single Array field.
/// Gather all the values from an input grouping into a single Array field.
/// Although this aggregate works on both Stream and Table inputs, the order of entries in the result array is
/// not guaranteed when working on Table input data.
/// This version limits the size of the resultant Array to 1000 entries, beyond which any further values will
Expand All @@ -155,7 +155,7 @@ public interface IAggregations<out TSource> : IAggregations
long[] CollectList(Func<TSource, long> selector);

/// <summary>
/// Gather all of the values from an input grouping into a single Array field.
/// Gather all the values from an input grouping into a single Array field.
/// Although this aggregate works on both Stream and Table inputs, the order of entries in the result array is
/// not guaranteed when working on Table input data.
/// This version limits the size of the resultant Array to 1000 entries, beyond which any further values will
Expand All @@ -176,80 +176,80 @@ public interface IAggregations<out TSource> : IAggregations
#region CollectSet

/// <summary>
/// Gather all of the distinct values from an input grouping into a single Array.
/// Gather all the distinct values from an input grouping into a single Array.
/// Not available for aggregating values from an input Table.
/// This version limits the size of the resultant Array to 1000 entries, beyond which any further values will
/// silently ignored.
/// be silently ignored.
/// </summary>
/// <param name="selector"></param>
/// <returns></returns>
bool[] CollectSet(Func<TSource, bool> selector);

/// <summary>
/// Gather all of the distinct values from an input grouping into a single Array.
/// Gather all the distinct values from an input grouping into a single Array.
/// Not available for aggregating values from an input Table.
/// This version limits the size of the resultant Array to 1000 entries, beyond which any further values will
/// silently ignored.
/// be silently ignored.
/// </summary>
/// <param name="selector"></param>
/// <returns></returns>

string[] CollectSet(Func<TSource, string> selector);
/// <summary>
/// Gather all of the distinct values from an input grouping into a single Array.
/// Gather all the distinct values from an input grouping into a single Array.
/// Not available for aggregating values from an input Table.
/// This version limits the size of the resultant Array to 1000 entries, beyond which any further values will
/// silently ignored.
/// be silently ignored.
/// </summary>
/// <param name="selector"></param>
/// <returns></returns>
short[] CollectSet(Func<TSource, short> selector);

/// <summary>
/// Gather all of the distinct values from an input grouping into a single Array.
/// Gather all the distinct values from an input grouping into a single Array.
/// Not available for aggregating values from an input Table.
/// This version limits the size of the resultant Array to 1000 entries, beyond which any further values will
/// silently ignored.
/// be silently ignored.
/// </summary>
/// <param name="selector"></param>
/// <returns></returns>
int[] CollectSet(Func<TSource, int> selector);

/// <summary>
/// Gather all of the distinct values from an input grouping into a single Array.
/// Gather all the distinct values from an input grouping into a single Array.
/// Not available for aggregating values from an input Table.
/// This version limits the size of the resultant Array to 1000 entries, beyond which any further values will
/// silently ignored.
/// be silently ignored.
/// </summary>
/// <param name="selector"></param>
/// <returns></returns>
long[] CollectSet(Func<TSource, long> selector);

/// <summary>
/// Gather all of the distinct values from an input grouping into a single Array.
/// Gather all the distinct values from an input grouping into a single Array.
/// Not available for aggregating values from an input Table.
/// This version limits the size of the resultant Array to 1000 entries, beyond which any further values will
/// silently ignored.
/// be silently ignored.
/// </summary>
/// <param name="selector"></param>
/// <returns></returns>
float[] CollectSet(Func<TSource, float> selector);

/// <summary>
/// Gather all of the distinct values from an input grouping into a single Array.
/// Gather all the distinct values from an input grouping into a single Array.
/// Not available for aggregating values from an input Table.
/// This version limits the size of the resultant Array to 1000 entries, beyond which any further values will
/// silently ignored.
/// be silently ignored.
/// </summary>
/// <param name="selector"></param>
/// <returns></returns>
double[] CollectSet(Func<TSource, double> selector);

/// <summary>
/// Gather all of the distinct values from an input grouping into a single Array.
/// Gather all the distinct values from an input grouping into a single Array.
/// Not available for aggregating values from an input Table.
/// This version limits the size of the resultant Array to 1000 entries, beyond which any further values will
/// silently ignored.
/// be silently ignored.
/// </summary>
/// <param name="selector"></param>
/// <returns></returns>
Expand Down Expand Up @@ -573,47 +573,47 @@ public interface IAggregations<out TSource> : IAggregations
#region TopKDistinct

/// <summary>
/// Calculates the Topk distinct values for a column, per key.
/// Calculates the TopK distinct values for a column, per key.
/// </summary>
/// <param name="selector"></param>
/// <param name="k"></param>
/// <returns>Return the distinct Top K values for the given column and window Rows that have col1 set to null are ignored.</returns>
short[] TopKDistinct(Func<TSource, short> selector, int k);

/// <summary>
/// Calculates the Topk distinct values for a column, per key.
/// Calculates the TopK distinct values for a column, per key.
/// </summary>
/// <param name="selector"></param>
/// <param name="k"></param>
/// <returns>Return the distinct Top K values for the given column and window Rows that have col1 set to null are ignored.</returns>
int[] TopKDistinct(Func<TSource, int> selector, int k);

/// <summary>
/// Calculates the Topk distinct values for a column, per key.
/// Calculates the TopK distinct values for a column, per key.
/// </summary>
/// <param name="selector"></param>
/// <param name="k"></param>
/// <returns>Return the distinct Top K values for the given column and window Rows that have col1 set to null are ignored.</returns>
long[] TopKDistinct(Func<TSource, long> selector, int k);

/// <summary>
/// Calculates the Topk distinct values for a column, per key.
/// Calculates the TopK distinct values for a column, per key.
/// </summary>
/// <param name="selector"></param>
/// <param name="k"></param>
/// <returns>Return the distinct Top K values for the given column and window Rows that have col1 set to null are ignored.</returns>
float[] TopKDistinct(Func<TSource, float> selector, int k);

/// <summary>
/// Calculates the Topk distinct values for a column, per key.
/// Calculates the TopK distinct values for a column, per key.
/// </summary>
/// <param name="selector"></param>
/// <param name="k"></param>
/// <returns>Return the distinct Top K values for the given column and window Rows that have col1 set to null are ignored.</returns>
double[] TopKDistinct(Func<TSource, double> selector, int k);

/// <summary>
/// Calculates the Topk distinct values for a column, per key.
/// Calculates the TopK distinct values for a column, per key.
/// </summary>
/// <param name="selector"></param>
/// <param name="k"></param>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Linq.Expressions;
using System.Linq.Expressions;
using System.Reflection;
using ksqlDB.RestApi.Client.KSql.Query.PullQueries;

Expand All @@ -10,9 +10,9 @@ public static class PullQueryExtensions

private static MethodInfo selectTSourceTResult;

private static MethodInfo SelectTSourceTResult(Type TSource, Type TResult) =>
private static MethodInfo SelectTSourceTResult(Type source, Type result) =>
(selectTSourceTResult ??= new Func<IPullable<object>, Expression<Func<object, object>>, IPullable<object>>(Select).GetMethodInfo().GetGenericMethodDefinition())
.MakeGenericMethod(TSource, TResult);
.MakeGenericMethod(source, result);

/// <summary>
/// Projects a single pull query response into a new form.
Expand Down Expand Up @@ -44,9 +44,9 @@ public static IPullable<TResult> Select<TSource, TResult>(this IPullable<TSource

private static MethodInfo whereTSource;

private static MethodInfo WhereTSource(Type TSource) =>
private static MethodInfo WhereTSource(Type source) =>
(whereTSource ??= new Func<IPullable<object>, Expression<Func<object, bool>>, IPullable<object>>(Where).GetMethodInfo().GetGenericMethodDefinition())
.MakeGenericMethod(TSource);
.MakeGenericMethod(source);

/// <summary>
/// The WHERE clause must contain a value for each primary-key column to retrieve and may optionally include bounds on WINDOWSTART and WINDOWEND if the materialized table is windowed.
Expand Down Expand Up @@ -77,9 +77,9 @@ public static IPullable<TSource> Where<TSource>(this IPullable<TSource> source,

private static MethodInfo takeTSource;

private static MethodInfo TakeTSource(Type TSource) =>
private static MethodInfo TakeTSource(Type source) =>
(takeTSource ??= new Func<IPullable<object>, int, IPullable<object>>(Take).GetMethodInfo().GetGenericMethodDefinition())
.MakeGenericMethod(TSource);
.MakeGenericMethod(source);

/// <summary>
/// Restrict the number of rows returned by executing a pull query over a STREAM or a TABLE. ksqldb 0.24.0
Expand Down Expand Up @@ -120,4 +120,4 @@ public static string ToQueryString<TSource>(this IPullable<TSource> source)
}

#endregion
}
}
Loading

0 comments on commit 121989b

Please sign in to comment.