Skip to content

Commit cf9da7e

Browse files
committed
Fix style
1 parent 9f80ca6 commit cf9da7e

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

src/Functions/array/arrayIntersect.cpp

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -766,41 +766,35 @@ using ArraySymmetricDifference = FunctionArrayIntersect<ArrayModeSymmetricDiffer
766766

767767
REGISTER_FUNCTION(ArrayIntersect)
768768
{
769-
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.";
769+
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.";
770770
FunctionDocumentation::Syntax intersect_syntax = "arrayIntersect(x, x1, ..., xN)";
771771
FunctionDocumentation::Arguments intersect_argument = {{"xN", "N arrays from which to make the new array. [`Array`](/sql-reference/data-types/array)."}};
772772
FunctionDocumentation::ReturnedValue intersect_returned_value = "Returns an array with distinct elements that are present in all N arrays. [`Array`](/sql-reference/data-types/array).";
773773
FunctionDocumentation::Examples intersect_example = {{"Usage example",
774-
R"(
775-
SELECT
774+
R"(SELECT
776775
arrayIntersect([1, 2], [1, 3], [2, 3]) AS empty_intersection,
777776
arrayIntersect([1, 2], [1, 3], [1, 4]) AS non_empty_intersection
778777
)", R"(
779778
┌─non_empty_intersection─┬─empty_intersection─┐
780779
│ [] │ [1] │
781780
└────────────────────────┴────────────────────┘
782-
)"}};
781+
)"}};
783782
FunctionDocumentation::IntroducedIn intersect_introduced_in = {1, 1};
784783
FunctionDocumentation::Category intersect_category = FunctionDocumentation::Category::Array;
785784
FunctionDocumentation intersect_documentation = {intersect_description, intersect_syntax, intersect_argument, intersect_returned_value, intersect_example, intersect_introduced_in, intersect_category};
786785

787786
factory.registerFunction<ArrayIntersect>(intersect_documentation);
788787

789-
FunctionDocumentation::Description union_description = R"(
790-
Takes multiple arrays and returns an array which contains all elements that are present in one of the source arrays.
791-
The result contains only unique values.
792-
)";
788+
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.";
793789
FunctionDocumentation::Syntax union_syntax = "arrayUnion(x1, x2, ..., xN)";
794790
FunctionDocumentation::Arguments union_argument = {{"xN", "N arrays from which to make the new array. [`Array`](/sql-reference/data-types/array)."}};
795791
FunctionDocumentation::ReturnedValue union_returned_value = "Returns an array with distinct elements from the source arrays. [`Array`](/sql-reference/data-types/array).";
796792
FunctionDocumentation::Examples union_example = {{"Usage example",
797-
R"(
798-
SELECT
793+
R"(SELECT
799794
arrayUnion([-2, 1], [10, 1], [-2], []) as num_example,
800795
arrayUnion(['hi'], [], ['hello', 'hi']) as str_example,
801796
arrayUnion([1, 3, NULL], [2, 3, NULL]) as null_example
802-
)",
803-
R"(
797+
)",R"(
804798
┌─num_example─┬─str_example────┬─null_example─┐
805799
│ [10,-2,1] │ ['hello','hi'] │ [3,2,1,NULL] │
806800
└─────────────┴────────────────┴──────────────┘
@@ -811,8 +805,7 @@ R"(
811805

812806
factory.registerFunction<ArrayUnion>(union_documentation);
813807

814-
FunctionDocumentation::Description symdiff_description = R"(
815-
Takes multiple arrays and returns an array with elements that are not present in all source arrays. The result contains only unique values.
808+
FunctionDocumentation::Description symdiff_description = R"(Takes multiple arrays and returns an array with elements that are not present in all source arrays. The result contains only unique values.
816809
817810
:::note
818811
The symmetric difference of _more than two sets_ is [mathematically defined](https://en.wikipedia.org/wiki/Symmetric_difference#n-ary_symmetric_difference)
@@ -822,13 +815,11 @@ In contrast, function `arraySymmetricDifference` simply returns the set of input
822815
)";
823816
FunctionDocumentation::Syntax symdiff_syntax = "arraySymmetricDifference(x1, x2, ..., xN)";
824817
FunctionDocumentation::Arguments symdiff_argument = {{"xN", "N arrays from which to make the new array. [`Array`](/sql-reference/data-types/array)."}};
825-
FunctionDocumentation::ReturnedValue symdiff_returned_value = "Returns an array distinct elements not present in all source arrays. [`Array`](/sql-reference/data-types/array).";
826-
FunctionDocumentation::Examples symdiff_example = {{"Usage example", R"(
827-
SELECT
818+
FunctionDocumentation::ReturnedValue symdiff_returned_value = "Returns an array of distinct elements not present in all source arrays. [`Array`](/sql-reference/data-types/array).";
819+
FunctionDocumentation::Examples symdiff_example = {{"Usage example", R"(SELECT
828820
arraySymmetricDifference([1, 2], [1, 2], [1, 2]) AS empty_symmetric_difference,
829821
arraySymmetricDifference([1, 2], [1, 2], [1, 3]) AS non_empty_symmetric_difference;
830-
)",
831-
R"(
822+
)", R"(
832823
┌─empty_symmetric_difference─┬─non_empty_symmetric_difference─┐
833824
│ [] │ [3] │
834825
└────────────────────────────┴────────────────────────────────┘

src/Functions/array/arrayUniq.cpp

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,8 @@ void FunctionArrayUniq::executeHashed(
319319

320320
REGISTER_FUNCTION(ArrayUniq)
321321
{
322-
FunctionDocumentation::Description description = R"(
322+
FunctionDocumentation::Description description = R"(
323323
For a single argument passed, counts the number of different elements in the array.
324-
325324
For multiple arguments passed, it counts the number of different **tuples** made of elements at matching positions across multiple arrays.
326325
327326
For example `SELECT arrayUniq([1,2], [3,4], [5,6])` will form the following tuples:
@@ -334,16 +333,26 @@ It will then count the number of unique tuples. In this case `2`.
334333
If you want to get a list of unique items in an array, you can use `arrayReduce('groupUniqArray', arr)`.
335334
:::
336335
)";
337-
FunctionDocumentation::Syntax syntax = "arrayUniq(x[, ...yN])";
336+
FunctionDocumentation::Syntax syntax = "arrayUniq(x[, ...yN])";
338337
FunctionDocumentation::Arguments arguments = {
339-
{"x", "Array for which to count the number of unique elements. [`Array`](/sql-reference/data-types/array)."},
340-
{"...yN (optional)", "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)."}
341-
};
342-
FunctionDocumentation::ReturnedValue returned_value = "For a single arguments returns the number of unique elements. For multiple arguments returns the number of unique tuples made from elements at corresponding positions across the arrays. [`UInt32`](/sql-reference/data-types/int-uint)";
343-
FunctionDocumentation::Examples examples = {
344-
{"Single argument", "SELECT arrayUniq([1,1,2,2])", "2"},
345-
{"Multiple argument", "SELECT arrayUniq([1,2,3], [4,5,6])", "3"}
338+
{
339+
"x",
340+
"Array for which to count the number of unique elements. [`Array`](/sql-reference/data-types/array)."
341+
},
342+
{
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+
}
346346
};
347+
FunctionDocumentation::ReturnedValue returned_value = R"(
348+
For a single argument returns the number of unique
349+
elements. For multiple arguments returns the number of unique tuples made from
350+
elements at corresponding positions across the arrays.
351+
[`UInt32`](/sql-reference/data-types/int-uint).
352+
)";
353+
FunctionDocumentation::Examples examples =
354+
{{"Single argument", "SELECT arrayUniq([1,1,2,2])", "2"},
355+
{"Multiple argument", "SELECT arrayUniq([1,2,3], [4,5,6])", "3"}};
347356
FunctionDocumentation::IntroducedIn introduced_in = {1, 1};
348357
FunctionDocumentation::Category category = FunctionDocumentation::Category::Array;
349358
FunctionDocumentation documentation = {description, syntax, arguments, returned_value, examples, introduced_in, category};

0 commit comments

Comments
 (0)