Skip to content

Commit 308a8fd

Browse files
huaxingaomaropu
authored andcommitted
[SPARK-31326][SQL][DOCS] Create Function docs structure for SQL Reference
### What changes were proposed in this pull request? Create Function docs structure for SQL Reference... ### Why are the changes needed? so the Function docs can be added later, also want to get a consensus about what to document for Functions in SQL Reference. ### Does this PR introduce any user-facing change? Yes <img width="1050" alt="Screen Shot 2020-04-02 at 12 09 20 AM" src="https://user-images.githubusercontent.com/13592258/78220451-68b6e100-7476-11ea-9a21-733b41652785.png"> <img width="1051" alt="Screen Shot 2020-04-02 at 12 09 44 AM" src="https://user-images.githubusercontent.com/13592258/78220460-6ce2fe80-7476-11ea-887c-defefd55c19d.png"> <img width="1051" alt="Screen Shot 2020-04-02 at 12 10 05 AM" src="https://user-images.githubusercontent.com/13592258/78220463-6f455880-7476-11ea-81fc-fd4137db7c3f.png"> ### How was this patch tested? Manually build and check Closes #28099 from huaxingao/function. Authored-by: Huaxin Gao <huaxing@us.ibm.com> Signed-off-by: Takeshi Yamamuro <yamamuro@apache.org> (cherry picked from commit 4e45c07) Signed-off-by: Takeshi Yamamuro <yamamuro@apache.org>
1 parent 2249653 commit 308a8fd

8 files changed

Lines changed: 115 additions & 29 deletions

docs/_data/menu-sql.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,5 +225,26 @@
225225
url: sql-ref-syntax-aux-resource-mgmt-list-file.html
226226
- text: LIST JAR
227227
url: sql-ref-syntax-aux-resource-mgmt-list-jar.html
228+
- text: Functions
229+
url: sql-ref-functions.html
230+
subitems:
231+
- text: Build-in Functions
232+
url: sql-ref-functions-builtin.html
233+
subitems:
234+
- text: Build-in Aggregate Functions
235+
url: sql-ref-functions-builtin-aggregate.html
236+
- text: Build-in Array Functions
237+
url: sql-ref-functions-builtin-array.html
238+
- text: Build-in Date Time Functions
239+
url: sql-ref-functions-builtin-date-time.html
240+
- text: UDFs (User-Defined Functions)
241+
url: sql-ref-functions-udf.html
242+
subitems:
243+
- text: Scalar UDFs (User-Defined Functions)
244+
url: sql-ref-functions-udf-scalar.html
245+
- text: UDAFs (User-Defined Aggregate Functions)
246+
url: sql-ref-functions-udf-aggregate.html
247+
- text: Integration with Hive UDFs/UDAFs/UDTFs
248+
url: sql-ref-functions-udf-hive.html
228249
- text: Datetime Pattern
229250
url: sql-ref-datetime-pattern.html
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
---
22
layout: global
3-
title: Builtin Aggregate Functions
4-
displayTitle: Builtin Aggregate Functions
3+
title: Built-in Aggregate Functions
4+
displayTitle: Built-in Aggregate Functions
55
license: |
66
Licensed to the Apache Software Foundation (ASF) under one or more
77
contributor license agreements. See the NOTICE file distributed with
88
this work for additional information regarding copyright ownership.
99
The ASF licenses this file to You under the Apache License, Version 2.0
1010
(the "License"); you may not use this file except in compliance with
1111
the License. You may obtain a copy of the License at
12-
12+
1313
http://www.apache.org/licenses/LICENSE-2.0
14-
14+
1515
Unless required by applicable law or agreed to in writing, software
1616
distributed under the License is distributed on an "AS IS" BASIS,
1717
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1818
See the License for the specific language governing permissions and
1919
limitations under the License.
2020
---
2121

22-
**This page is under construction**
22+
Aggregate functions
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
layout: global
3+
title: Built-in Array Functions
4+
displayTitle: Built-in Array Functions
5+
license: |
6+
Licensed to the Apache Software Foundation (ASF) under one or more
7+
contributor license agreements. See the NOTICE file distributed with
8+
this work for additional information regarding copyright ownership.
9+
The ASF licenses this file to You under the Apache License, Version 2.0
10+
(the "License"); you may not use this file except in compliance with
11+
the License. You may obtain a copy of the License at
12+
13+
http://www.apache.org/licenses/LICENSE-2.0
14+
15+
Unless required by applicable law or agreed to in writing, software
16+
distributed under the License is distributed on an "AS IS" BASIS,
17+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
See the License for the specific language governing permissions and
19+
limitations under the License.
20+
---
21+
22+
Array Functions
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
layout: global
3+
title: Built-in Date and Time Functions
4+
displayTitle: Built-in Date and Time Functions
5+
license: |
6+
Licensed to the Apache Software Foundation (ASF) under one or more
7+
contributor license agreements. See the NOTICE file distributed with
8+
this work for additional information regarding copyright ownership.
9+
The ASF licenses this file to You under the Apache License, Version 2.0
10+
(the "License"); you may not use this file except in compliance with
11+
the License. You may obtain a copy of the License at
12+
13+
http://www.apache.org/licenses/LICENSE-2.0
14+
15+
Unless required by applicable law or agreed to in writing, software
16+
distributed under the License is distributed on an "AS IS" BASIS,
17+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
See the License for the specific language governing permissions and
19+
limitations under the License.
20+
---
21+
22+
Date-Time Functions

docs/sql-ref-functions-builtin.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
---
22
layout: global
3-
title: Reference
4-
displayTitle: Reference
3+
title: Built-in Functions
4+
displayTitle: Built-in Functions
55
license: |
66
Licensed to the Apache Software Foundation (ASF) under one or more
77
contributor license agreements. See the NOTICE file distributed with
88
this work for additional information regarding copyright ownership.
99
The ASF licenses this file to You under the Apache License, Version 2.0
1010
(the "License"); you may not use this file except in compliance with
1111
the License. You may obtain a copy of the License at
12-
12+
1313
http://www.apache.org/licenses/LICENSE-2.0
14-
14+
1515
Unless required by applicable law or agreed to in writing, software
1616
distributed under the License is distributed on an "AS IS" BASIS,
1717
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1818
See the License for the specific language governing permissions and
1919
limitations under the License.
2020
---
2121

22-
Spark SQL is Apache Spark's module for working with structured data.
23-
This guide is a reference for Structured Query Language (SQL) for Apache
24-
Spark. This document describes the SQL constructs supported by Spark in detail
25-
along with usage examples when applicable.
22+
Spark SQL defines built-in functions to use, a complete list of which can be found [here](api/sql/). Among them, Spark SQL has several special categories of built-in functions: [Aggregate Functions](sql-ref-functions-builtin-aggregate.html) to operate on a group of rows, [Array Functions](sql-ref-functions-builtin-array.html) to operate on Array columns, and [Date and Time Functions](sql-ref-functions-builtin-date-time.html) to operate on Date and Time.
23+
24+
* [Aggregate Functions](sql-ref-functions-builtin-aggregate.html)
25+
* [Array Functions](sql-ref-functions-builtin-array.html)
26+
* [Date and Time Functions](sql-ref-functions-builtin-date-time.html)

docs/sql-ref-functions-udf-hive.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
layout: global
3+
title: Integration with Hive UDFs/UDAFs/UDTFs
4+
displayTitle: Integration with Hive UDFs/UDAFs/UDTFs
5+
license: |
6+
Licensed to the Apache Software Foundation (ASF) under one or more
7+
contributor license agreements. See the NOTICE file distributed with
8+
this work for additional information regarding copyright ownership.
9+
The ASF licenses this file to You under the Apache License, Version 2.0
10+
(the "License"); you may not use this file except in compliance with
11+
the License. You may obtain a copy of the License at
12+
13+
http://www.apache.org/licenses/LICENSE-2.0
14+
15+
Unless required by applicable law or agreed to in writing, software
16+
distributed under the License is distributed on an "AS IS" BASIS,
17+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
See the License for the specific language governing permissions and
19+
limitations under the License.
20+
---
21+
22+
Integration with Hive UDFs/UDAFs/UDTFs

docs/sql-ref-functions-udf.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
---
22
layout: global
3-
title: Reference
4-
displayTitle: Reference
3+
title: UDFs (User-Defined Functions)
4+
displayTitle: UDFs (User-Defined Functions)
55
license: |
66
Licensed to the Apache Software Foundation (ASF) under one or more
77
contributor license agreements. See the NOTICE file distributed with
88
this work for additional information regarding copyright ownership.
99
The ASF licenses this file to You under the Apache License, Version 2.0
1010
(the "License"); you may not use this file except in compliance with
1111
the License. You may obtain a copy of the License at
12-
12+
1313
http://www.apache.org/licenses/LICENSE-2.0
14-
14+
1515
Unless required by applicable law or agreed to in writing, software
1616
distributed under the License is distributed on an "AS IS" BASIS,
1717
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1818
See the License for the specific language governing permissions and
1919
limitations under the License.
2020
---
2121

22-
Spark SQL is Apache Spark's module for working with structured data.
23-
This guide is a reference for Structured Query Language (SQL) for Apache
24-
Spark. This document describes the SQL constructs supported by Spark in detail
25-
along with usage examples when applicable.
22+
User-Defined Functions (UDFs) are a feature of Spark SQL that allows users to define their own functions when the system's built-in functions are not enough to perform the desired task. To use UDFs in Spark SQL, users must first define the function, then register the function with Spark, and finally call the registered function. The User-Defined Functions can act on a single row or act on multiple rows at once. Spark SQL also supports integration of existing Hive implementations of UDFs, UDAFs and UDTFs.
23+
24+
* [Scalar User-Defined Functions (UDFs)](sql-ref-functions-udf-scalar.html)
25+
* [User-Defined Aggregate Functions (UDAFs)](sql-ref-functions-udf-aggregate.html)
26+
* [Integration with Hive UDFs/UDAFs/UDTFs](sql-ref-functions-udf-hive.html)

docs/sql-ref-functions.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
---
22
layout: global
3-
title: Reference
4-
displayTitle: Reference
3+
title: Functions
4+
displayTitle: Functions
55
license: |
66
Licensed to the Apache Software Foundation (ASF) under one or more
77
contributor license agreements. See the NOTICE file distributed with
88
this work for additional information regarding copyright ownership.
99
The ASF licenses this file to You under the Apache License, Version 2.0
1010
(the "License"); you may not use this file except in compliance with
1111
the License. You may obtain a copy of the License at
12-
12+
1313
http://www.apache.org/licenses/LICENSE-2.0
14-
14+
1515
Unless required by applicable law or agreed to in writing, software
1616
distributed under the License is distributed on an "AS IS" BASIS,
1717
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1818
See the License for the specific language governing permissions and
1919
limitations under the License.
2020
---
2121

22-
Spark SQL is Apache Spark's module for working with structured data.
23-
This guide is a reference for Structured Query Language (SQL) for Apache
24-
Spark. This document describes the SQL constructs supported by Spark in detail
25-
along with usage examples when applicable.
22+
Spark SQL defines commonly used functions as built-in functions. It also provides User-Defined Functions (UDFs) to allow users to define their own functions when the system’s built-in functions are not enough to perform the desired task.

0 commit comments

Comments
 (0)