Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/_data/menu-sql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,5 +225,26 @@
url: sql-ref-syntax-aux-resource-mgmt-list-file.html
- text: LIST JAR
url: sql-ref-syntax-aux-resource-mgmt-list-jar.html
- text: Functions
url: sql-ref-functions.html
subitems:
- text: Build-in Functions
url: sql-ref-functions-builtin.html
subitems:
- text: Build-in Aggregate Functions
url: sql-ref-functions-builtin-aggregate.html
- text: Build-in Array Functions
url: sql-ref-functions-builtin-array.html
- text: Build-in Date Time Functions
url: sql-ref-functions-builtin-date-time.html
- text: UDFs (User-Defined Functions)
url: sql-ref-functions-udf.html
subitems:
- text: Scalar UDFs (User-Defined Functions)
url: sql-ref-functions-udf-scalar.html
- text: UDAFs (User-Defined Aggregate Functions)
url: sql-ref-functions-udf-aggregate.html
- text: Integration with Hive UDFs/UDAFs/UDTFs
url: sql-ref-functions-udf-hive.html
- text: Datetime Pattern
url: sql-ref-datetime-pattern.html
10 changes: 5 additions & 5 deletions docs/sql-ref-functions-builtin-aggregate.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
layout: global
title: Builtin Aggregate Functions
displayTitle: Builtin Aggregate Functions
title: Built-in Aggregate Functions
displayTitle: Built-in Aggregate Functions
license: |
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
---

**This page is under construction**
Aggregate functions
22 changes: 22 additions & 0 deletions docs/sql-ref-functions-builtin-array.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
layout: global
title: Built-in Array Functions
displayTitle: Built-in Array Functions
license: |
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
---

Array Functions
22 changes: 22 additions & 0 deletions docs/sql-ref-functions-builtin-date-time.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
layout: global
title: Built-in Date and Time Functions
displayTitle: Built-in Date and Time Functions
license: |
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
---

Date-Time Functions
17 changes: 9 additions & 8 deletions docs/sql-ref-functions-builtin.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
---
layout: global
title: Reference
displayTitle: Reference
title: Built-in Functions
displayTitle: Built-in Functions
license: |
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
---

Spark SQL is Apache Spark's module for working with structured data.
This guide is a reference for Structured Query Language (SQL) for Apache
Spark. This document describes the SQL constructs supported by Spark in detail
along with usage examples when applicable.
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.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[here](api/sql/) links to the built-in function page https://spark.apache.org/docs/latest/api/sql/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you choose these three special catalogries decumented here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially wanted to have scalar built-in functions and aggregate built-in functions to be parallel to the sections in UDFs, but then I think it's not worthwhile to document scalar built-in functions separately. I guess it makes more sense to document some special functions, such as array functions, date and time functions, and maybe window functions and string functions as well. I also don't want to document too many here, because I need to finish quickly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean that just the link to the full bulitin method list is not enough? What are you planning to describe here about the special three categories? more examples?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw other SQL references (such as Oracle, Hive, Snowflake) document the built-in functions in different categories. I think it's nice for us to have that too. The full built-in function list doesn't separate the functions into different categories. I think we at least need to document the aggregate functions.


* [Aggregate Functions](sql-ref-functions-builtin-aggregate.html)
* [Array Functions](sql-ref-functions-builtin-array.html)
* [Date and Time Functions](sql-ref-functions-builtin-date-time.html)
22 changes: 22 additions & 0 deletions docs/sql-ref-functions-udf-hive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
layout: global
title: Integration with Hive UDFs/UDAFs/UDTFs
displayTitle: Integration with Hive UDFs/UDAFs/UDTFs
license: |
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
---

Integration with Hive UDFs/UDAFs/UDTFs
17 changes: 9 additions & 8 deletions docs/sql-ref-functions-udf.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
---
layout: global
title: Reference
displayTitle: Reference
title: UDFs (User-Defined Functions)
displayTitle: UDFs (User-Defined Functions)
license: |
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
---

Spark SQL is Apache Spark's module for working with structured data.
This guide is a reference for Structured Query Language (SQL) for Apache
Spark. This document describes the SQL constructs supported by Spark in detail
along with usage examples when applicable.
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.

* [Scalar User-Defined Functions (UDFs)](sql-ref-functions-udf-scalar.html)
* [User-Defined Aggregate Functions (UDAFs)](sql-ref-functions-udf-aggregate.html)
* [Integration with Hive UDFs/UDAFs/UDTFs](sql-ref-functions-udf-hive.html)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add a page for Hive UDFs

13 changes: 5 additions & 8 deletions docs/sql-ref-functions.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
---
layout: global
title: Reference
displayTitle: Reference
title: Functions
displayTitle: Functions
license: |
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
---

Spark SQL is Apache Spark's module for working with structured data.
This guide is a reference for Structured Query Language (SQL) for Apache
Spark. This document describes the SQL constructs supported by Spark in detail
along with usage examples when applicable.
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.