Skip to content

Commit ee85445

Browse files
committed
Review feedback
1 parent 049862d commit ee85445

File tree

7 files changed

+32
-30
lines changed

7 files changed

+32
-30
lines changed

src/Functions/array/arrayDifference.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,12 @@ REGISTER_FUNCTION(ArrayDifference)
168168
{
169169
FunctionDocumentation::Description description = R"(
170170
Calculates an array of differences between adjacent array elements.
171-
The first element of the result array will be 0, the second `a[1] - a[0]`, the third `a[2] - a[1]`, etc.
171+
The first element of the result array will be 0, the second `arr[1] - arr[0]`, the third `arr[2] - arr[1]`, etc.
172172
The type of elements in the result array are determined by the type inference rules for subtraction (e.g. `UInt8` - `UInt8` = `Int16`).
173173
)";
174-
FunctionDocumentation::Syntax syntax = "arrayDifference(x)";
174+
FunctionDocumentation::Syntax syntax = "arrayDifference(arr)";
175175
FunctionDocumentation::Arguments argument = {
176-
{"x", "Array for which to calculate differences between adjacent elements. [`Array`](/sql-reference/data-types/array)."},
176+
{"arr", "Array for which to calculate differences between adjacent elements. [`Array(T)`](/sql-reference/data-types/array)."},
177177
};
178178
FunctionDocumentation::ReturnedValue returned_value = "Returns an array of differences between adjacent array elements. [`UInt*`](/sql-reference/data-types/int-uint#integer-ranges), [`Int*`](/sql-reference/data-types/int-uint#integer-ranges), [`Float*`](/sql-reference/data-types/float).";
179179
FunctionDocumentation::Examples examples = {

src/Functions/array/arrayDistinct.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,11 @@ void FunctionArrayDistinct::executeHashed(
290290
REGISTER_FUNCTION(ArrayDistinct)
291291
{
292292
FunctionDocumentation::Description description = "Returns an array containing only the distinct elements of an array.";
293-
FunctionDocumentation::Syntax syntax = "arrayDistinct(x)";
293+
FunctionDocumentation::Syntax syntax = "arrayDistinct(arr)";
294294
FunctionDocumentation::Arguments argument = {
295-
{"x", "Array for which to extract distinct elements. [`Array`](/sql-reference/data-types/array)."},
295+
{"arr", "Array for which to extract distinct elements. [`Array(T)`](/sql-reference/data-types/array)."},
296296
};
297-
FunctionDocumentation::ReturnedValue returned_value = "Returns an array containing the distinct elements.";
297+
FunctionDocumentation::ReturnedValue returned_value = "Returns an array containing the distinct elements. [`Array(T)`](/sql-reference/data-types/array).";
298298
FunctionDocumentation::Examples examples = {{"Usage example", "SELECT arrayDistinct([1, 2, 2, 3, 1]);", "[1,2,3]"}};
299299
FunctionDocumentation::IntroducedIn introduced_in = {1, 1};
300300
FunctionDocumentation::Category category = FunctionDocumentation::Category::Array;

src/Functions/array/arrayEnumerateDense.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ class FunctionArrayEnumerateDense : public FunctionArrayEnumerateExtended<Functi
1717
REGISTER_FUNCTION(ArrayEnumerateDense)
1818
{
1919
FunctionDocumentation::Description description = "Returns an array of the same size as the source array, indicating where each element first appears in the source array.";
20-
FunctionDocumentation::Syntax syntax = "arrayEnumerateDense(x)";
20+
FunctionDocumentation::Syntax syntax = "arrayEnumerateDense(arr)";
2121
FunctionDocumentation::Arguments arguments = {
22-
{"x", "The array to enumerate. [`Array`](/sql-reference/data-types/array)."}
22+
{"arr", "The array to enumerate. [`Array(T)`](/sql-reference/data-types/array)."}
2323
};
24-
FunctionDocumentation::ReturnedValue returned_value = "Returns an array of the same size as `x`, indicating where each element first appears in the source array. [`Array`](/sql-reference/data-types/array).";
24+
FunctionDocumentation::ReturnedValue returned_value = "Returns an array of the same size as `arr`, indicating where each element first appears in the source array. [`Array(T)`](/sql-reference/data-types/array).";
2525
FunctionDocumentation::Examples examples = {{"Usage example", "SELECT arrayEnumerateDense([10, 20, 10, 30])", "[1,2,1,3]"}};
2626
FunctionDocumentation::IntroducedIn introduced_in = {18, 12};
2727
FunctionDocumentation::Category category = FunctionDocumentation::Category::Array;

src/Functions/array/arrayEnumerateDenseRanked.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ REGISTER_FUNCTION(ArrayEnumerateDenseRanked)
2020
FunctionDocumentation::Syntax syntax = "arrayEnumerateDenseRanked(clear_depth, arr, max_array_depth)";
2121
FunctionDocumentation::Arguments arguments = {
2222
{"clear_depth", "Enumerate elements at the specified level separately. Positive [Integer](../data-types/int-uint.md) less than or equal to `max_arr_depth`."},
23-
{"x", "N-dimensional array to enumerate. [Array](/sql-reference/data-types/array)."},
24-
{"max_array_depth", "The maximum effective depth. Positive [Integer](../data-types/int-uint.md) less than or equal to the depth of `arr`."},
23+
{"arr", "N-dimensional array to enumerate. [`Array(T)`](/sql-reference/data-types/array)."},
24+
{"max_array_depth", "The maximum effective depth. Positive [(U)Int*](../data-types/int-uint.md) less than or equal to the depth of `arr`."},
2525
};
2626
FunctionDocumentation::ReturnedValue returned_value = "Returns an array denoting where each element first appears in the source array. [Array](/sql-reference/data-types/array).";
2727
FunctionDocumentation::Examples examples = {

src/Functions/array/arrayIntersect.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -767,9 +767,9 @@ using ArraySymmetricDifference = FunctionArrayIntersect<ArrayModeSymmetricDiffer
767767
REGISTER_FUNCTION(ArrayIntersect)
768768
{
769769
FunctionDocumentation::Description intersect_description = "Takes multiple arrays and returns an array with elements which are present in all source arrays. The result contains only unique values.";
770-
FunctionDocumentation::Syntax intersect_syntax = "arrayIntersect(x, x1, ..., xN)";
771-
FunctionDocumentation::Arguments intersect_argument = {{"xN", "N arrays from which to make the new array. [`Array`](/sql-reference/data-types/array)."}};
772-
FunctionDocumentation::ReturnedValue intersect_returned_value = "Returns an array with distinct elements that are present in all N arrays. [`Array`](/sql-reference/data-types/array).";
770+
FunctionDocumentation::Syntax intersect_syntax = "arrayIntersect(arr, arr1, ..., arrN)";
771+
FunctionDocumentation::Arguments intersect_argument = {{"arrN", "N arrays from which to make the new array. [`Array(T)`](/sql-reference/data-types/array)."}};
772+
FunctionDocumentation::ReturnedValue intersect_returned_value = "Returns an array with distinct elements that are present in all N arrays. [`Array(T)`](/sql-reference/data-types/array).";
773773
FunctionDocumentation::Examples intersect_example = {{"Usage example",
774774
R"(SELECT
775775
arrayIntersect([1, 2], [1, 3], [2, 3]) AS empty_intersection,
@@ -786,9 +786,9 @@ arrayIntersect([1, 2], [1, 3], [1, 4]) AS non_empty_intersection
786786
factory.registerFunction<ArrayIntersect>(intersect_documentation);
787787

788788
FunctionDocumentation::Description union_description = "Takes multiple arrays and returns an array which contains all elements that are present in one of the source arrays.The result contains only unique values.";
789-
FunctionDocumentation::Syntax union_syntax = "arrayUnion(x1, x2, ..., xN)";
790-
FunctionDocumentation::Arguments union_argument = {{"xN", "N arrays from which to make the new array. [`Array`](/sql-reference/data-types/array)."}};
791-
FunctionDocumentation::ReturnedValue union_returned_value = "Returns an array with distinct elements from the source arrays. [`Array`](/sql-reference/data-types/array).";
789+
FunctionDocumentation::Syntax union_syntax = "arrayUnion(arr1, arr2, ..., arrN)";
790+
FunctionDocumentation::Arguments union_argument = {{"arrN", "N arrays from which to make the new array. [`Array(T)`](/sql-reference/data-types/array)."}};
791+
FunctionDocumentation::ReturnedValue union_returned_value = "Returns an array with distinct elements from the source arrays. [`Array(T)`](/sql-reference/data-types/array).";
792792
FunctionDocumentation::Examples union_example = {{"Usage example",
793793
R"(SELECT
794794
arrayUnion([-2, 1], [10, 1], [-2], []) as num_example,
@@ -813,9 +813,9 @@ as the set of all input elements which occur in an odd number of input sets.
813813
In contrast, function `arraySymmetricDifference` simply returns the set of input elements which do not occur in all input sets.
814814
:::
815815
)";
816-
FunctionDocumentation::Syntax symdiff_syntax = "arraySymmetricDifference(x1, x2, ..., xN)";
817-
FunctionDocumentation::Arguments symdiff_argument = {{"xN", "N arrays from which to make the new array. [`Array`](/sql-reference/data-types/array)."}};
818-
FunctionDocumentation::ReturnedValue symdiff_returned_value = "Returns an array of distinct elements not present in all source arrays. [`Array`](/sql-reference/data-types/array).";
816+
FunctionDocumentation::Syntax symdiff_syntax = "arraySymmetricDifference(arr1, arr2, ... , arrN)";
817+
FunctionDocumentation::Arguments symdiff_argument = {{"arrN", "N arrays from which to make the new array. [`Array(T)`](/sql-reference/data-types/array)."}};
818+
FunctionDocumentation::ReturnedValue symdiff_returned_value = "Returns an array of distinct elements not present in all source arrays. [`Array(T)`](/sql-reference/data-types/array).";
819819
FunctionDocumentation::Examples symdiff_example = {{"Usage example", R"(SELECT
820820
arraySymmetricDifference([1, 2], [1, 2], [1, 2]) AS empty_symmetric_difference,
821821
arraySymmetricDifference([1, 2], [1, 2], [1, 3]) AS non_empty_symmetric_difference;

src/Functions/array/arrayJoin.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ and Aggregate Functions which take a group of rows and "compress" or "reduce" th
8585
All the values in the columns are simply copied, except the values in the column where this function is applied;
8686
these are replaced with the corresponding array value.
8787
)";
88-
FunctionDocumentation::Syntax syntax = "arrayJoin(x)";
88+
FunctionDocumentation::Syntax syntax = "arrayJoin(arr)";
8989
FunctionDocumentation::Arguments arguments = {
90-
{"x", "An array to unfold. [`Array`](/sql-reference/data-types/array)"}
90+
{"arr", "An array to unfold. [`Array(T)`](/sql-reference/data-types/array)."}
9191
};
92-
FunctionDocumentation::ReturnedValue returned_value = "Returns a set of rows unfolded from `x`.";
92+
FunctionDocumentation::ReturnedValue returned_value = "Returns a set of rows unfolded from `arr`.";
9393
FunctionDocumentation::Examples examples = {
9494
{"Basic usage", R"(SELECT arrayJoin([1, 2, 3] AS src) AS dst, 'Hello', src)", R"(
9595
┌─dst─┬─\'Hello\'─┬─src─────┐

src/Functions/array/arrayUniq.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -329,24 +329,26 @@ For example `SELECT arrayUniq([1,2], [3,4], [5,6])` will form the following tupl
329329
330330
It will then count the number of unique tuples. In this case `2`.
331331
332+
All arrays passed must have the same length.
333+
332334
:::tip
333335
If you want to get a list of unique items in an array, you can use `arrayReduce('groupUniqArray', arr)`.
334336
:::
335337
)";
336-
FunctionDocumentation::Syntax syntax = "arrayUniq(x[, ...yN])";
338+
FunctionDocumentation::Syntax syntax = "arrayUniq(arr1[, arr2, ..., arrN])";
337339
FunctionDocumentation::Arguments arguments = {
338340
{
339-
"x",
340-
"Array for which to count the number of unique elements. [`Array`](/sql-reference/data-types/array)."
341+
"arr1",
342+
"Array for which to count the number of unique elements. [`Array(T)`](/sql-reference/data-types/array)."
341343
},
342344
{
343-
"...yN (optional)",
344-
"Additional same-size arrays used to count the number of unique tuples of elements at corresponding positions in multiple arrays. [`Array`](/sql-reference/data-types/array)."
345+
"[, arr2, ..., arrN] (optional)",
346+
"Optional. Additional arrays used to count the number of unique tuples of elements at corresponding positions in multiple arrays. [`Array(T)`](/sql-reference/data-types/array)."
345347
}
346348
};
347349
FunctionDocumentation::Examples examples =
348-
{{"Single argument", "SELECT arrayUniq([1,1,2,2])", "2"},
349-
{"Multiple argument", "SELECT arrayUniq([1,2,3], [4,5,6])", "3"}};
350+
{{"Single argument", "SELECT arrayUniq([1, 1, 2, 2])", "2"},
351+
{"Multiple argument", "SELECT arrayUniq([1, 2, 3, 1], [4, 5, 6, 4])", "3"}};
350352
FunctionDocumentation::ReturnedValue returned_value = R"(
351353
For a single argument returns the number of unique
352354
elements. For multiple arguments returns the number of unique tuples made from

0 commit comments

Comments
 (0)