From 0b20432450d0b496ec7b8cf7705a176d8bc25d63 Mon Sep 17 00:00:00 2001 From: Kat Batuigas Date: Thu, 21 May 2026 12:24:14 -0700 Subject: [PATCH 01/16] Built out SQL landing page --- modules/sql/pages/index.adoc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/sql/pages/index.adoc b/modules/sql/pages/index.adoc index c439a7212..2f23bb411 100644 --- a/modules/sql/pages/index.adoc +++ b/modules/sql/pages/index.adoc @@ -1,3 +1,15 @@ = Redpanda SQL :description: Redpanda SQL is an analytical query engine built into Redpanda Cloud that enables real-time SQL analytics directly on your streaming data. :page-layout: index + +Redpanda SQL is an OLAP query engine in Redpanda Cloud BYOC clusters. Query your streaming topic data, and the Iceberg history of Iceberg-enabled topics, using a PostgreSQL-compatible SQL dialect, the `psql` client, or any PostgreSQL driver. + +Use Redpanda SQL to: + +* xref:sql:query-data/query-streaming-topics.adoc[Query streaming topics] in real time. +* xref:sql:query-data/query-iceberg-topics.adoc[Query Iceberg-enabled topics] across live and historical data. +* xref:sql:query-data/query-nested-fields.adoc[Map and query nested schema fields] as typed columns. + +Try the xref:sql:get-started/sql-quickstart.adoc[Redpanda SQL quickstart]. + +TIP: If you're new to OLAP and analytical SQL, see xref:sql:get-started/oltp-vs-olap.adoc[OLTP vs OLAP] and xref:sql:get-started/redpanda-sql-vs-postgresql.adoc[Redpanda SQL vs PostgreSQL] before you start. From 250f2648b9c72acaefccc07e41de172994556fb4 Mon Sep 17 00:00:00 2001 From: Kat Batuigas Date: Thu, 21 May 2026 12:37:25 -0700 Subject: [PATCH 02/16] Add SQL to What's New in Cloud --- modules/get-started/pages/whats-new-cloud.adoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/get-started/pages/whats-new-cloud.adoc b/modules/get-started/pages/whats-new-cloud.adoc index 6e2a8e070..f8b2bdf63 100644 --- a/modules/get-started/pages/whats-new-cloud.adoc +++ b/modules/get-started/pages/whats-new-cloud.adoc @@ -8,6 +8,10 @@ This page lists new features added to Redpanda Cloud. == May 2026 +=== Redpanda SQL: GA on AWS BYOC + +Redpanda SQL is generally available on BYOC clusters running on AWS. Run real-time SQL queries on Redpanda topic data, including the Iceberg history of Iceberg-enabled topics, using standard PostgreSQL syntax. Connect with `psql` or any PostgreSQL driver. See the xref:sql:get-started/sql-quickstart.adoc[quickstart guide] and xref:sql:get-started/overview.adoc[Redpanda SQL Overview]. + === Centralized egress for BYOC on AWS: beta You can route all BYOC cluster egress through your own AWS Transit Gateway and hub VPC instead of a per-VPC NAT Gateway, so outbound traffic exits through your centralized inspection point. This is useful for regulated environments that prohibit per-VPC NAT Gateways and for consolidating egress behind a single, predictable public IP for outbound allowlisting. Centralized egress is in a glossterm:beta[] release and is enabled per organization. Contact your account team for access. See xref:networking:byoc/aws/nat-free-egress.adoc[Configure Centralized Egress with AWS Transit Gateway]. From 72d7386cbeb75dc727107f46a435de1aa3f8fdb3 Mon Sep 17 00:00:00 2001 From: Kat Batuigas Date: Thu, 21 May 2026 15:06:17 -0700 Subject: [PATCH 03/16] Page title capitalization --- modules/reference/pages/sql/sql-clauses/index.adoc | 2 +- .../reference/pages/sql/sql-clauses/set-operations/index.adoc | 2 +- modules/reference/pages/sql/sql-data-types/array.adoc | 2 +- modules/reference/pages/sql/sql-data-types/bool.adoc | 2 +- modules/reference/pages/sql/sql-data-types/date.adoc | 2 +- modules/reference/pages/sql/sql-data-types/geography.adoc | 2 +- modules/reference/pages/sql/sql-data-types/geometry.adoc | 2 +- modules/reference/pages/sql/sql-data-types/index.adoc | 2 +- modules/reference/pages/sql/sql-data-types/interval.adoc | 2 +- modules/reference/pages/sql/sql-data-types/json.adoc | 2 +- .../sql-data-types/numeric-type/numeric-data-type-aliases.adoc | 2 +- .../pages/sql/sql-data-types/numeric-type/numeric.adoc | 2 +- modules/reference/pages/sql/sql-data-types/row.adoc | 2 +- modules/reference/pages/sql/sql-data-types/text.adoc | 2 +- .../pages/sql/sql-data-types/time-type/time-operators.adoc | 2 +- modules/reference/pages/sql/sql-data-types/time-type/time.adoc | 2 +- .../pages/sql/sql-data-types/timestamp-with-time-zone.adoc | 2 +- .../pages/sql/sql-data-types/timestamp-without-time-zone.adoc | 2 +- .../pages/sql/sql-functions/aggregate-functions/avg.adoc | 2 +- .../pages/sql/sql-functions/aggregate-functions/bool-and.adoc | 2 +- .../pages/sql/sql-functions/aggregate-functions/bool-or.adoc | 2 +- .../pages/sql/sql-functions/aggregate-functions/count.adoc | 2 +- .../pages/sql/sql-functions/aggregate-functions/distinct.adoc | 2 +- .../pages/sql/sql-functions/aggregate-functions/for-max.adoc | 2 +- .../pages/sql/sql-functions/aggregate-functions/for-min.adoc | 2 +- .../pages/sql/sql-functions/aggregate-functions/max.adoc | 2 +- .../pages/sql/sql-functions/aggregate-functions/min.adoc | 2 +- .../ordered-set-aggregate-functions/mode.adoc | 2 +- .../ordered-set-aggregate-functions/percentile-cont.adoc | 2 +- .../ordered-set-aggregate-functions/percentile-disc.adoc | 2 +- .../sql/sql-functions/aggregate-functions/statistics/corr.adoc | 2 +- .../sql-functions/aggregate-functions/statistics/covar-pop.adoc | 2 +- .../aggregate-functions/statistics/covar-samp.adoc | 2 +- .../sql-functions/aggregate-functions/statistics/regr-avgx.adoc | 2 +- .../sql-functions/aggregate-functions/statistics/regr-avgy.adoc | 2 +- .../aggregate-functions/statistics/regr-count.adoc | 2 +- .../aggregate-functions/statistics/regr-intercept.adoc | 2 +- .../sql-functions/aggregate-functions/statistics/regr-r2.adoc | 2 +- .../aggregate-functions/statistics/regr-slope.adoc | 2 +- .../sql-functions/aggregate-functions/statistics/regr-sxx.adoc | 2 +- .../sql-functions/aggregate-functions/statistics/regr-sxy.adoc | 2 +- .../sql-functions/aggregate-functions/statistics/regr-syy.adoc | 2 +- .../aggregate-functions/statistics/stddev-pop.adoc | 2 +- .../aggregate-functions/statistics/stddev-samp.adoc | 2 +- .../sql-functions/aggregate-functions/statistics/stddev.adoc | 2 +- .../sql-functions/aggregate-functions/statistics/var-pop.adoc | 2 +- .../sql-functions/aggregate-functions/statistics/var-samp.adoc | 2 +- .../sql-functions/aggregate-functions/statistics/variance.adoc | 2 +- .../pages/sql/sql-functions/aggregate-functions/sum.adoc | 2 +- .../pages/sql/sql-functions/boolean-functions/if-function.adoc | 2 +- .../boolean-functions/is-distinct-from-operator.adoc | 2 +- .../boolean-functions/is-not-distinct-from-operator.adoc | 2 +- .../sql/sql-functions/json-functions/json-array-extract.adoc | 2 +- .../sql/sql-functions/json-functions/json-array-length.adoc | 2 +- .../sql-functions/json-functions/json-extract-path-text.adoc | 2 +- .../sql/sql-functions/json-functions/json-extract-path.adoc | 2 +- .../reference/pages/sql/sql-functions/math-functions/abs.adoc | 2 +- .../reference/pages/sql/sql-functions/math-functions/cbrt.adoc | 2 +- .../reference/pages/sql/sql-functions/math-functions/ceil.adoc | 2 +- .../reference/pages/sql/sql-functions/math-functions/cosh.adoc | 2 +- .../reference/pages/sql/sql-functions/math-functions/exp.adoc | 2 +- .../reference/pages/sql/sql-functions/math-functions/floor.adoc | 2 +- .../pages/sql/sql-functions/math-functions/greatest.adoc | 2 +- .../reference/pages/sql/sql-functions/math-functions/least.adoc | 2 +- .../reference/pages/sql/sql-functions/math-functions/ln.adoc | 2 +- .../reference/pages/sql/sql-functions/math-functions/log.adoc | 2 +- .../reference/pages/sql/sql-functions/math-functions/power.adoc | 2 +- .../pages/sql/sql-functions/math-functions/random.adoc | 2 +- .../reference/pages/sql/sql-functions/math-functions/round.adoc | 2 +- .../reference/pages/sql/sql-functions/math-functions/sign.adoc | 2 +- .../reference/pages/sql/sql-functions/math-functions/sin.adoc | 2 +- .../reference/pages/sql/sql-functions/math-functions/sinh.adoc | 2 +- .../reference/pages/sql/sql-functions/math-functions/sqrt.adoc | 2 +- .../sql/sql-functions/math-functions/to-char-from-number.adoc | 2 +- .../pages/sql/sql-functions/other-functions/coalesce.adoc | 2 +- .../sql/sql-functions/other-functions/col-description.adoc | 2 +- .../sql/sql-functions/other-functions/current-database.adoc | 2 +- .../pages/sql/sql-functions/other-functions/current-schema.adoc | 2 +- .../sql/sql-functions/other-functions/generate-series.adoc | 2 +- .../sql/sql-functions/other-functions/has-schema-privilege.adoc | 2 +- .../pages/sql/sql-functions/other-functions/index.adoc | 2 +- .../pages/sql/sql-functions/other-functions/nullif.adoc | 2 +- .../sql/sql-functions/other-functions/obj-description.adoc | 2 +- .../pages/sql/sql-functions/other-functions/pg-backend-pid.adoc | 2 +- .../sql/sql-functions/other-functions/pg-encoding-to-char.adoc | 2 +- .../sql/sql-functions/other-functions/pg-get-constraintdef.adoc | 2 +- .../pages/sql/sql-functions/other-functions/pg-get-expr.adoc | 2 +- .../sql/sql-functions/other-functions/pg-get-indexdef.adoc | 2 +- .../other-functions/pg-get-statisticsobjdef-columns.adoc | 2 +- .../sql/sql-functions/other-functions/pg-get-userbyid.adoc | 2 +- .../other-functions/pg-relation-is-publishable.adoc | 2 +- .../pages/sql/sql-functions/other-functions/pg-size-pretty.adoc | 2 +- .../sql/sql-functions/other-functions/pg-table-is-visible.adoc | 2 +- .../pages/sql/sql-functions/other-functions/pg-table-size.adoc | 2 +- .../sql-functions/other-functions/pg-total-relation-size.adoc | 2 +- .../pages/sql/sql-functions/other-functions/pg-typeof.adoc | 2 +- .../sql/sql-functions/other-functions/shobj-description.adoc | 2 +- .../pages/sql/sql-functions/string-functions/concat.adoc | 2 +- .../pages/sql/sql-functions/string-functions/ends-with.adoc | 2 +- .../pages/sql/sql-functions/string-functions/length.adoc | 2 +- .../pages/sql/sql-functions/string-functions/lower.adoc | 2 +- .../pages/sql/sql-functions/string-functions/position.adoc | 2 +- .../sql/sql-functions/string-functions/regex/regexp-match.adoc | 2 +- .../sql-functions/string-functions/regex/regexp-replace.adoc | 2 +- .../pages/sql/sql-functions/string-functions/replace.adoc | 2 +- .../pages/sql/sql-functions/string-functions/starts-with.adoc | 2 +- .../pages/sql/sql-functions/string-functions/strpos.adoc | 2 +- .../pages/sql/sql-functions/string-functions/substr.adoc | 2 +- .../pages/sql/sql-functions/string-functions/substring.adoc | 2 +- .../pages/sql/sql-functions/string-functions/upper.adoc | 2 +- .../sql-functions/timestamp-functions/current-timestamp.adoc | 2 +- .../pages/sql/sql-functions/timestamp-functions/date-trunc.adoc | 2 +- .../pages/sql/sql-functions/timestamp-functions/extract.adoc | 2 +- .../sql/sql-functions/timestamp-functions/format-timestamp.adoc | 2 +- .../sql/sql-functions/timestamp-functions/timestamp-micros.adoc | 2 +- .../sql/sql-functions/timestamp-functions/timestamp-millis.adoc | 2 +- .../sql-functions/timestamp-functions/timestamp-seconds.adoc | 2 +- .../sql/sql-functions/timestamp-functions/timestamp-trunc.adoc | 2 +- .../pages/sql/sql-functions/timestamp-functions/to-char.adoc | 2 +- .../sql/sql-functions/timestamp-functions/to-timestamp.adoc | 2 +- .../sql/sql-functions/timestamp-functions/unix-micros.adoc | 2 +- .../sql/sql-functions/timestamp-functions/unix-millis.adoc | 2 +- .../sql/sql-functions/timestamp-functions/unix-seconds.adoc | 2 +- .../reference/pages/sql/sql-functions/window-functions/avg.adoc | 2 +- .../pages/sql/sql-functions/window-functions/bool-and.adoc | 2 +- .../pages/sql/sql-functions/window-functions/bool-or.adoc | 2 +- .../pages/sql/sql-functions/window-functions/count.adoc | 2 +- .../pages/sql/sql-functions/window-functions/cume-dist.adoc | 2 +- .../pages/sql/sql-functions/window-functions/dense-rank.adoc | 2 +- .../pages/sql/sql-functions/window-functions/first-value.adoc | 2 +- .../reference/pages/sql/sql-functions/window-functions/lag.adoc | 2 +- .../pages/sql/sql-functions/window-functions/last-value.adoc | 2 +- .../pages/sql/sql-functions/window-functions/lead.adoc | 2 +- .../reference/pages/sql/sql-functions/window-functions/max.adoc | 2 +- .../reference/pages/sql/sql-functions/window-functions/min.adoc | 2 +- .../pages/sql/sql-functions/window-functions/nth-value.adoc | 2 +- .../pages/sql/sql-functions/window-functions/ntile.adoc | 2 +- .../pages/sql/sql-functions/window-functions/percent-rank.adoc | 2 +- .../pages/sql/sql-functions/window-functions/rank.adoc | 2 +- .../pages/sql/sql-functions/window-functions/row-number.adoc | 2 +- .../reference/pages/sql/sql-functions/window-functions/sum.adoc | 2 +- .../reference/pages/sql/sql-operators/bitwise-shift-left.adoc | 2 +- .../reference/pages/sql/sql-operators/bitwise-shift-right.adoc | 2 +- modules/reference/pages/sql/sql-statements/index.adoc | 2 +- 144 files changed, 144 insertions(+), 144 deletions(-) diff --git a/modules/reference/pages/sql/sql-clauses/index.adoc b/modules/reference/pages/sql/sql-clauses/index.adoc index 3d6333c33..6338d15b7 100644 --- a/modules/reference/pages/sql/sql-clauses/index.adoc +++ b/modules/reference/pages/sql/sql-clauses/index.adoc @@ -1,4 +1,4 @@ -= SQL clauses += SQL Clauses :description: SQL clauses define how data is retrieved, filtered, and manipulated. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-clauses/set-operations/index.adoc b/modules/reference/pages/sql/sql-clauses/set-operations/index.adoc index 0e90e8001..81e7f633d 100644 --- a/modules/reference/pages/sql/sql-clauses/set-operations/index.adoc +++ b/modules/reference/pages/sql/sql-clauses/set-operations/index.adoc @@ -1,4 +1,4 @@ -= Set operations += Set Operations :description: Set operations combine, compare, or contrast result sets from multiple SELECT statements. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-data-types/array.adoc b/modules/reference/pages/sql/sql-data-types/array.adoc index a51bbf3b7..a782ca78a 100644 --- a/modules/reference/pages/sql/sql-data-types/array.adoc +++ b/modules/reference/pages/sql/sql-data-types/array.adoc @@ -1,4 +1,4 @@ -= Array += array :description: In Redpanda SQL, an array stores a collection of elements that have the same data type (any built-in data type can be used). :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-data-types/bool.adoc b/modules/reference/pages/sql/sql-data-types/bool.adoc index 6be575b41..ba99286a5 100644 --- a/modules/reference/pages/sql/sql-data-types/bool.adoc +++ b/modules/reference/pages/sql/sql-data-types/bool.adoc @@ -1,4 +1,4 @@ -= Bool += bool :description: BOOL is a data type for expressions that return one of two possible values: true or false. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-data-types/date.adoc b/modules/reference/pages/sql/sql-data-types/date.adoc index f8e2d18dd..7612ed220 100644 --- a/modules/reference/pages/sql/sql-data-types/date.adoc +++ b/modules/reference/pages/sql/sql-data-types/date.adoc @@ -1,4 +1,4 @@ -= Date += date :description: The DATE data type stores calendar dates without a time zone in Redpanda SQL. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-data-types/geography.adoc b/modules/reference/pages/sql/sql-data-types/geography.adoc index 17dfc3c3f..7c9cf88bc 100644 --- a/modules/reference/pages/sql/sql-data-types/geography.adoc +++ b/modules/reference/pages/sql/sql-data-types/geography.adoc @@ -1,4 +1,4 @@ -= Geography += geography :description: The GEOGRAPHY data type stores geodetic (spherical) spatial point values using the WGS84 coordinate system (SRID 4326). :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-data-types/geometry.adoc b/modules/reference/pages/sql/sql-data-types/geometry.adoc index 85e023708..63c85215c 100644 --- a/modules/reference/pages/sql/sql-data-types/geometry.adoc +++ b/modules/reference/pages/sql/sql-data-types/geometry.adoc @@ -1,4 +1,4 @@ -= Geometry += geometry :description: The GEOMETRY data type stores planar (Cartesian) spatial point values as two double-precision coordinates. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-data-types/index.adoc b/modules/reference/pages/sql/sql-data-types/index.adoc index caa066036..2402c7c88 100644 --- a/modules/reference/pages/sql/sql-data-types/index.adoc +++ b/modules/reference/pages/sql/sql-data-types/index.adoc @@ -1,4 +1,4 @@ -= SQL data types += SQL Data Types :description: Redpanda SQL supports a wide range of data types, each designed to handle specific types of data efficiently. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-data-types/interval.adoc b/modules/reference/pages/sql/sql-data-types/interval.adoc index a33f4694f..513a60cb7 100644 --- a/modules/reference/pages/sql/sql-data-types/interval.adoc +++ b/modules/reference/pages/sql/sql-data-types/interval.adoc @@ -1,4 +1,4 @@ -= Interval += interval :description: The Interval data type represents periods between dates or times, which can be precisely calculated and expressed through various units. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-data-types/json.adoc b/modules/reference/pages/sql/sql-data-types/json.adoc index 0e0bf966f..06a3ff3ec 100644 --- a/modules/reference/pages/sql/sql-data-types/json.adoc +++ b/modules/reference/pages/sql/sql-data-types/json.adoc @@ -1,4 +1,4 @@ -= JSON += json :description: JSON stands for JavaScript Object Notation. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-data-types/numeric-type/numeric-data-type-aliases.adoc b/modules/reference/pages/sql/sql-data-types/numeric-type/numeric-data-type-aliases.adoc index 4085015d2..360e5c795 100644 --- a/modules/reference/pages/sql/sql-data-types/numeric-type/numeric-data-type-aliases.adoc +++ b/modules/reference/pages/sql/sql-data-types/numeric-type/numeric-data-type-aliases.adoc @@ -1,4 +1,4 @@ -= Numeric Data Type - Aliases += Numeric Data Type Aliases :description: Aliases for the primary numeric data types in Redpanda SQL, mapped to their primary types during processing. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-data-types/numeric-type/numeric.adoc b/modules/reference/pages/sql/sql-data-types/numeric-type/numeric.adoc index 943e19e66..07ea72a30 100644 --- a/modules/reference/pages/sql/sql-data-types/numeric-type/numeric.adoc +++ b/modules/reference/pages/sql/sql-data-types/numeric-type/numeric.adoc @@ -1,4 +1,4 @@ -= Numeric += numeric :description: The INT data type represents whole numbers without decimal points. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-data-types/row.adoc b/modules/reference/pages/sql/sql-data-types/row.adoc index 7fa37cd76..ec7dd1415 100644 --- a/modules/reference/pages/sql/sql-data-types/row.adoc +++ b/modules/reference/pages/sql/sql-data-types/row.adoc @@ -1,4 +1,4 @@ -= ROW += row :description: The ROW data type represents a composite value containing one or more fields of different types. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-data-types/text.adoc b/modules/reference/pages/sql/sql-data-types/text.adoc index 1e939f028..6caa03c22 100644 --- a/modules/reference/pages/sql/sql-data-types/text.adoc +++ b/modules/reference/pages/sql/sql-data-types/text.adoc @@ -1,4 +1,4 @@ -= Text += text :description: The text data type is a UTF8-encoded text with Unicode support, which stores a sequence of characters (text). :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-data-types/time-type/time-operators.adoc b/modules/reference/pages/sql/sql-data-types/time-type/time-operators.adoc index 5bca19a53..c5874e275 100644 --- a/modules/reference/pages/sql/sql-data-types/time-type/time-operators.adoc +++ b/modules/reference/pages/sql/sql-data-types/time-type/time-operators.adoc @@ -1,4 +1,4 @@ -= Time operators += Time Operators :description: Time operators in Redpanda SQL perform various operations on dates, times, and intervals. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-data-types/time-type/time.adoc b/modules/reference/pages/sql/sql-data-types/time-type/time.adoc index 8f825d1ca..fc4ec34b3 100644 --- a/modules/reference/pages/sql/sql-data-types/time-type/time.adoc +++ b/modules/reference/pages/sql/sql-data-types/time-type/time.adoc @@ -1,4 +1,4 @@ -= Time += time :description: The TIME data type in Redpanda SQL stores time values without any date information. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-data-types/timestamp-with-time-zone.adoc b/modules/reference/pages/sql/sql-data-types/timestamp-with-time-zone.adoc index 3bc7ba95c..80b0fece1 100644 --- a/modules/reference/pages/sql/sql-data-types/timestamp-with-time-zone.adoc +++ b/modules/reference/pages/sql/sql-data-types/timestamp-with-time-zone.adoc @@ -1,4 +1,4 @@ -= Timestamp with Time Zone += timestamp with time zone :description: Redpanda SQL provides you with two data types for handling timestamps: :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-data-types/timestamp-without-time-zone.adoc b/modules/reference/pages/sql/sql-data-types/timestamp-without-time-zone.adoc index 6c7c4eb0f..0818a3329 100644 --- a/modules/reference/pages/sql/sql-data-types/timestamp-without-time-zone.adoc +++ b/modules/reference/pages/sql/sql-data-types/timestamp-without-time-zone.adoc @@ -1,4 +1,4 @@ -= Timestamp Without Time Zone += timestamp without time zone :description: The timestamp data type stores time and date values without a time zone. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/avg.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/avg.adoc index 64a0d336e..7865b3f07 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/avg.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/avg.adoc @@ -1,4 +1,4 @@ -= AVG += avg :description: The AVG() function calculates the average value of records. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/bool-and.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/bool-and.adoc index a6eeab627..ebd6445c3 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/bool-and.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/bool-and.adoc @@ -1,4 +1,4 @@ -= BOOL_AND += bool_and :description: The BOOL_AND() function calculates all the boolean values in the aggregated group, which will have these results: :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/bool-or.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/bool-or.adoc index 3864fb744..bc5668c55 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/bool-or.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/bool-or.adoc @@ -1,4 +1,4 @@ -= BOOL_OR += bool_or :description: The BOOL_OR() function calculates all the boolean values in the aggregated group, which will have these results: :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/count.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/count.adoc index 9f3d8f5cb..4e09df5fa 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/count.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/count.adoc @@ -1,4 +1,4 @@ -= COUNT += count :description: The COUNT() function retrieves the number of records that match a specific condition. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/distinct.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/distinct.adoc index e48a01fcb..a600cf9a5 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/distinct.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/distinct.adoc @@ -1,4 +1,4 @@ -= DISTINCT += distinct :description: When using aggregation functions, they can contain the DISTINCT keyword. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/for-max.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/for-max.adoc index b0e22450a..40a41aedf 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/for-max.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/for-max.adoc @@ -1,4 +1,4 @@ -= FOR_MAX() += for_max :description: The FOR_MAX() function searches for a maximum in a specific column and returns a value related to that maximum from another column. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/for-min.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/for-min.adoc index e7791ceda..349e96e26 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/for-min.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/for-min.adoc @@ -1,4 +1,4 @@ -= FOR_MIN() += for_min :description: The FOR_MIN() function searches for a minimum in a specific column and returns a value related to that minimum from another column. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/max.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/max.adoc index 256158401..c97d72124 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/max.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/max.adoc @@ -1,4 +1,4 @@ -= MAX += max :description: MAX() is a function that returns the maximum value from a set of records. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/min.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/min.adoc index ec0a57bdb..52f7b2965 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/min.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/min.adoc @@ -1,4 +1,4 @@ -= MIN += min :description: MIN() is a function that returns the minimum value from a set of records. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/mode.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/mode.adoc index 963fad42b..3a8e5697d 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/mode.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/mode.adoc @@ -1,4 +1,4 @@ -= MODE() += mode :description: MODE() is an ordered-set aggregate function that returns the most frequently occurring value (the mode) from a set of values. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/percentile-cont.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/percentile-cont.adoc index 0c48e7641..0f6307bdc 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/percentile-cont.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/percentile-cont.adoc @@ -1,4 +1,4 @@ -= PERCENTILE_CONT() += percentile_cont :description: PERCENTILE_CONT() is an ordered-set aggregate function used to compute continuous percentiles from a set of values. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/percentile-disc.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/percentile-disc.adoc index 23a6f9bfc..bc82554e1 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/percentile-disc.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/percentile-disc.adoc @@ -1,4 +1,4 @@ -= PERCENTILE_DISC() += percentile_disc :description: PERCENTILE_DISC() is an ordered-set aggregate function used to compute discrete percentiles from a set of values. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/corr.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/corr.adoc index e8c589cfd..9374c05be 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/corr.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/corr.adoc @@ -1,4 +1,4 @@ -= CORR() += corr :description: The CORR() aggregate function calculates the Pearson correlation coefficient between two sets of number pairs. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/covar-pop.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/covar-pop.adoc index 1391e0912..932073d9b 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/covar-pop.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/covar-pop.adoc @@ -1,4 +1,4 @@ -= COVAR_POP() += covar_pop :description: The COVAR_POP() aggregate function calculates the population covariance between two sets of number pairs. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/covar-samp.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/covar-samp.adoc index 7857f8149..489b0f69d 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/covar-samp.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/covar-samp.adoc @@ -1,4 +1,4 @@ -= COVAR_SAMP += covar_samp :description: The COVAR_SAMP() aggregate function calculates the sample covariance between two sets of number pairs. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-avgx.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-avgx.adoc index e5ae969f7..f51d64928 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-avgx.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-avgx.adoc @@ -1,4 +1,4 @@ -= REGR_AVGX() += regr_avgx :description: The REGR_AVGX() aggregate function calculates the average of the independent variable (x) for non-null pairs of dependent (y) and independent (x) vari :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-avgy.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-avgy.adoc index 979b523b5..e3a424125 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-avgy.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-avgy.adoc @@ -1,4 +1,4 @@ -= REGR_AVGY() += regr_avgy :description: The REGR_AVGY() aggregate function calculates the mean of the dependent variable (y) for non-null pairs of dependent (y) and independent (x) variables :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-count.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-count.adoc index bc3141da4..3db3431e3 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-count.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-count.adoc @@ -1,4 +1,4 @@ -= REGR_COUNT() += regr_count :description: The REGR_COUNT() aggregate function calculates the number of non-null value pairs for a dependent variable (y) and an independent variable (x). :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-intercept.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-intercept.adoc index 4aa70b705..52c5f479b 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-intercept.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-intercept.adoc @@ -1,4 +1,4 @@ -= REGR_INTERCEPT() += regr_intercept :description: The REGR_INTERCEPT() aggregate function calculates the y-intercept of the univariate linear regression line for a group of data points, where the depe :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-r2.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-r2.adoc index 20ca8bf02..80e6a6f04 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-r2.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-r2.adoc @@ -1,4 +1,4 @@ -= REGR_R2() += regr_r2 :description: The REGR_R2() aggregate function calculates the coefficient of determination (R2) for a linear regression model. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-slope.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-slope.adoc index 54df6656a..10f3ab052 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-slope.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-slope.adoc @@ -1,4 +1,4 @@ -= REGR_SLOPE() += regr_slope :description: The REGR_SLOPE() aggregate function calculates the slope of the regression line for a linear relationship between a dependent variable (y) and an inde :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-sxx.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-sxx.adoc index 3df266edb..76233bd12 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-sxx.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-sxx.adoc @@ -1,4 +1,4 @@ -= REGR_SXX() += regr_sxx :description: The REGR_SXX() aggregate function calculates the sum of squares of deviations for the independent variable (x) in a linear regression analysis. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-sxy.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-sxy.adoc index 45cac9d69..5b093e127 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-sxy.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-sxy.adoc @@ -1,4 +1,4 @@ -= REGR_SXY() += regr_sxy :description: The REGR_SXY() aggregate function calculates the sum of products od deviations for the dependent variable (y) and the independent variable (x) in a li :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-syy.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-syy.adoc index 002e90046..9cb53fa4b 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-syy.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-syy.adoc @@ -1,4 +1,4 @@ -= REGR_SYY() += regr_syy :description: The REGR_SYY() aggregate function calculates the sum of squares of deviations for the dependent variable (y) in a linear regression analysis. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev-pop.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev-pop.adoc index abf8a982e..316a09938 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev-pop.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev-pop.adoc @@ -1,4 +1,4 @@ -= STDDEV_POP() += stddev_pop :description: The STDDEV_POP() aggregate function calculates the population stardard deviation of a set of numeric values. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev-samp.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev-samp.adoc index c50947cf0..c80c0d0ad 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev-samp.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev-samp.adoc @@ -1,4 +1,4 @@ -= STDDEV_SAMP() += stddev_samp :description: The STDDEV_SAMP() aggregate function calculates the sample standard deviation of a set of numeric values. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev.adoc index c261397bd..26fadc9cf 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev.adoc @@ -1,4 +1,4 @@ -= STDDEV() += stddev :description: The STDDEV() aggregate function calculates the sample standard deviation of a set of numeric values. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/var-pop.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/var-pop.adoc index a3be4550d..03dd7a9d0 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/var-pop.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/var-pop.adoc @@ -1,4 +1,4 @@ -= VAR_POP() += var_pop :description: The VAR_POP() aggregate function calculates the population variance of a set of numeric values. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/var-samp.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/var-samp.adoc index d3992438c..08e79ffb8 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/var-samp.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/var-samp.adoc @@ -1,4 +1,4 @@ -= VAR_SAMP() += var_samp :description: The VAR_SAMP() aggregate function calculates the sample variance of a set of numeric values. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/variance.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/variance.adoc index c5616d5ee..cbb6ea0ea 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/variance.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/variance.adoc @@ -1,4 +1,4 @@ -= VARIANCE() += variance :description: The VARIANCE() aggregate function calculate the sample variance of a set of numeric values. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/sum.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/sum.adoc index 5d6bd8156..2dbacf8a7 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/sum.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/sum.adoc @@ -1,4 +1,4 @@ -= SUM += sum :description: SUM() calculates the sum of values from stored records. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/boolean-functions/if-function.adoc b/modules/reference/pages/sql/sql-functions/boolean-functions/if-function.adoc index b6243e4db..2e23f889e 100644 --- a/modules/reference/pages/sql/sql-functions/boolean-functions/if-function.adoc +++ b/modules/reference/pages/sql/sql-functions/boolean-functions/if-function.adoc @@ -1,4 +1,4 @@ -= IF() += if :description: The IF() function returns one value if the condition is TRUE and another value if the condition is FALSE. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/boolean-functions/is-distinct-from-operator.adoc b/modules/reference/pages/sql/sql-functions/boolean-functions/is-distinct-from-operator.adoc index 3253f0ab0..10b223bbc 100644 --- a/modules/reference/pages/sql/sql-functions/boolean-functions/is-distinct-from-operator.adoc +++ b/modules/reference/pages/sql/sql-functions/boolean-functions/is-distinct-from-operator.adoc @@ -1,4 +1,4 @@ -= IS DISTINCT FROM Operator += IS DISTINCT FROM :description: The IS DISTINCT FROM operator compares two values, considering them distinct even when both are NULL. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/boolean-functions/is-not-distinct-from-operator.adoc b/modules/reference/pages/sql/sql-functions/boolean-functions/is-not-distinct-from-operator.adoc index 296a2d8a9..491d074fb 100644 --- a/modules/reference/pages/sql/sql-functions/boolean-functions/is-not-distinct-from-operator.adoc +++ b/modules/reference/pages/sql/sql-functions/boolean-functions/is-not-distinct-from-operator.adoc @@ -1,4 +1,4 @@ -= IS NOT DISTINCT FROM Operator += IS NOT DISTINCT FROM :description: The IS NOT DISTINCT FROM operator is a counterpart to IS DISTINCT FROM. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/json-functions/json-array-extract.adoc b/modules/reference/pages/sql/sql-functions/json-functions/json-array-extract.adoc index b0a8bef5e..be8f0ec07 100644 --- a/modules/reference/pages/sql/sql-functions/json-functions/json-array-extract.adoc +++ b/modules/reference/pages/sql/sql-functions/json-functions/json-array-extract.adoc @@ -1,4 +1,4 @@ -= JSON_ARRAY_EXTRACT += json_array_extract :description: The JSON_ARRAY_EXTRACT() function returns the JSON array as a set of JSON values. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/json-functions/json-array-length.adoc b/modules/reference/pages/sql/sql-functions/json-functions/json-array-length.adoc index 956f54d3c..23884f930 100644 --- a/modules/reference/pages/sql/sql-functions/json-functions/json-array-length.adoc +++ b/modules/reference/pages/sql/sql-functions/json-functions/json-array-length.adoc @@ -1,4 +1,4 @@ -= JSON_ARRAY_LENGTH += json_array_length :description: The JSON_ARRAY_LENGTH() function returns the length of a specified JSON array. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path-text.adoc b/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path-text.adoc index 17b25dfcf..529fb4192 100644 --- a/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path-text.adoc +++ b/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path-text.adoc @@ -1,4 +1,4 @@ -= JSON_EXTRACT_PATH_TEXT += json_extract_path_text :description: The JSON_EXTRACT_PATH_TEXT() function extracts JSON nested value from a specified JSON value according to the defined path. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path.adoc b/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path.adoc index 1d2888640..6f327df10 100644 --- a/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path.adoc +++ b/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path.adoc @@ -1,4 +1,4 @@ -= JSON_EXTRACT_PATH += json_extract_path :description: JSON_EXTRACT_PATH() function extracts JSON nested value from a specified path. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/math-functions/abs.adoc b/modules/reference/pages/sql/sql-functions/math-functions/abs.adoc index d0b9413f0..c2943efe5 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/abs.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/abs.adoc @@ -1,4 +1,4 @@ -= ABS += abs :description: The ABS() function returns an absolute number (for example, the positive value of a number). :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/math-functions/cbrt.adoc b/modules/reference/pages/sql/sql-functions/math-functions/cbrt.adoc index c9e65bf73..402b64345 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/cbrt.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/cbrt.adoc @@ -1,4 +1,4 @@ -= CBRT += cbrt :description: The CBRT() function calculates and returns the cube root of a given number. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/math-functions/ceil.adoc b/modules/reference/pages/sql/sql-functions/math-functions/ceil.adoc index 49fd4a73f..d323dd126 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/ceil.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/ceil.adoc @@ -1,4 +1,4 @@ -= CEIL += ceil :description: The CEIL() function returns the nearest positive or negative integer value greater than or equal to the provided decimal input number. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/math-functions/cosh.adoc b/modules/reference/pages/sql/sql-functions/math-functions/cosh.adoc index 357143aaa..b885b04f1 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/cosh.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/cosh.adoc @@ -1,4 +1,4 @@ -= COSH += cosh :description: The COSH() function returns the hyperbolic cosine of a specified numeric argument. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/math-functions/exp.adoc b/modules/reference/pages/sql/sql-functions/math-functions/exp.adoc index c4712341b..92b582e84 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/exp.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/exp.adoc @@ -1,4 +1,4 @@ -= EXP += exp :description: The EXP() function returns the exponential value of a number specified in the argument. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/math-functions/floor.adoc b/modules/reference/pages/sql/sql-functions/math-functions/floor.adoc index c25092e54..085dcdc0e 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/floor.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/floor.adoc @@ -1,4 +1,4 @@ -= FLOOR += floor :description: The FLOOR() returns a number rounded down that is less than or equal to the specified argument. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/math-functions/greatest.adoc b/modules/reference/pages/sql/sql-functions/math-functions/greatest.adoc index 464f0fc0c..9c5224b2c 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/greatest.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/greatest.adoc @@ -1,4 +1,4 @@ -= GREATEST += greatest :description: The GREATEST() function extracts the greatest or largest value from a set of values. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/math-functions/least.adoc b/modules/reference/pages/sql/sql-functions/math-functions/least.adoc index 3e4f97964..89e22ee2c 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/least.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/least.adoc @@ -1,4 +1,4 @@ -= LEAST += least :description: The LEAST() function returns the least or smallest value in a list of values. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/math-functions/ln.adoc b/modules/reference/pages/sql/sql-functions/math-functions/ln.adoc index 38d815873..75db58e78 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/ln.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/ln.adoc @@ -1,4 +1,4 @@ -= LN += ln :description: The LN() function returns the natural logarithm of its argument. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/math-functions/log.adoc b/modules/reference/pages/sql/sql-functions/math-functions/log.adoc index f653edec0..5a05d1835 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/log.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/log.adoc @@ -1,4 +1,4 @@ -= LOG += log :description: The LOG() function returns the base-10 logarithm or logarithm of the specified base of a given number. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/math-functions/power.adoc b/modules/reference/pages/sql/sql-functions/math-functions/power.adoc index 8ed02bdb1..e512528ad 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/power.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/power.adoc @@ -1,4 +1,4 @@ -= POWER += power :description: The POWER() function calculates the value of a number raised to the power of another number specified in the arguments. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/math-functions/random.adoc b/modules/reference/pages/sql/sql-functions/math-functions/random.adoc index 74e96b67a..09adda53e 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/random.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/random.adoc @@ -1,4 +1,4 @@ -= RANDOM += random :description: The RANDOM() function in Redpanda SQL generates a random number within a defined range. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/math-functions/round.adoc b/modules/reference/pages/sql/sql-functions/math-functions/round.adoc index fd8d1bec7..0d201cf50 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/round.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/round.adoc @@ -1,4 +1,4 @@ -= ROUND += round :description: The ROUND() function rounds numbers using round half to even method (bankers rounding). :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/math-functions/sign.adoc b/modules/reference/pages/sql/sql-functions/math-functions/sign.adoc index 832285e5b..6d57bf6c4 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/sign.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/sign.adoc @@ -1,4 +1,4 @@ -= SIGN += sign :description: The SIGN() function returns a sign of an argument. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/math-functions/sin.adoc b/modules/reference/pages/sql/sql-functions/math-functions/sin.adoc index a2020100d..5936f8ab7 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/sin.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/sin.adoc @@ -1,4 +1,4 @@ -= SIN += sin :description: SIN() is a numeric function that returns the trigonometric sine value of a specified angle in radians. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/math-functions/sinh.adoc b/modules/reference/pages/sql/sql-functions/math-functions/sinh.adoc index d1c2fed27..3f50731a8 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/sinh.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/sinh.adoc @@ -1,4 +1,4 @@ -= SINH += sinh :description: The SINH() function returns the hyperbolic sine of a specified numeric argument. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/math-functions/sqrt.adoc b/modules/reference/pages/sql/sql-functions/math-functions/sqrt.adoc index 5a047ba11..5b09b5880 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/sqrt.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/sqrt.adoc @@ -1,4 +1,4 @@ -= SQRT += sqrt :description: The SQRT() function returns the square root of a given positive number. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/math-functions/to-char-from-number.adoc b/modules/reference/pages/sql/sql-functions/math-functions/to-char-from-number.adoc index 0e385e94f..cf11f4cf3 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/to-char-from-number.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/to-char-from-number.adoc @@ -1,4 +1,4 @@ -= TO_CHAR from Number += to_char (number) :description: The TO_CHAR function formats a number into a string using a given format. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/coalesce.adoc b/modules/reference/pages/sql/sql-functions/other-functions/coalesce.adoc index 3c9bbe870..c6bb4f2e4 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/coalesce.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/coalesce.adoc @@ -1,4 +1,4 @@ -= coalesce() += coalesce :description: The COALESCE() function returns the first non-NULL argument from a list of arguments. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/col-description.adoc b/modules/reference/pages/sql/sql-functions/other-functions/col-description.adoc index ea518193c..b4f60d771 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/col-description.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/col-description.adoc @@ -1,4 +1,4 @@ -= col_description() += col_description :description: The link:https://www.postgresql.org/docs/current/functions-info.html#FUNCTIONS-INFO-COMMENT[col_description()^] is a comment information function that :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/current-database.adoc b/modules/reference/pages/sql/sql-functions/other-functions/current-database.adoc index d03d11c75..3af0fdd77 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/current-database.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/current-database.adoc @@ -1,4 +1,4 @@ -= current_database() += current_database :description: The link:https://www.postgresql.org/docs/current/functions-info.html#FUNCTIONS-INFO-SESSION[current_database()^] is a session information function that :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/current-schema.adoc b/modules/reference/pages/sql/sql-functions/other-functions/current-schema.adoc index 7d5a152dd..ef2629cae 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/current-schema.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/current-schema.adoc @@ -1,4 +1,4 @@ -= current_schema() += current_schema :description: The link:https://www.postgresql.org/docs/current/functions-info.html#FUNCTIONS-INFO-SESSION[current_schema()^] is a session information function that r :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/generate-series.adoc b/modules/reference/pages/sql/sql-functions/other-functions/generate-series.adoc index b89735a55..0f2cfa0c0 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/generate-series.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/generate-series.adoc @@ -1,4 +1,4 @@ -= GENERATE_SERIES += generate_series :description: The GENERATE_SERIES function generates a set of values from start to stop with an optional step increment. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/has-schema-privilege.adoc b/modules/reference/pages/sql/sql-functions/other-functions/has-schema-privilege.adoc index 6f1e18e13..a0b0c38c7 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/has-schema-privilege.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/has-schema-privilege.adoc @@ -1,4 +1,4 @@ -= has_schema_privilege() += has_schema_privilege :description: The has_schema_privilege() function checks whether the current user has specific privileges on a schema. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/index.adoc b/modules/reference/pages/sql/sql-functions/other-functions/index.adoc index 663c440cd..063d9a19e 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/index.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/index.adoc @@ -1,4 +1,4 @@ -= Other functions += Other Functions :description: Reference for other Redpanda SQL functions, including coalesce, nullif, and PostgreSQL system information functions. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/nullif.adoc b/modules/reference/pages/sql/sql-functions/other-functions/nullif.adoc index d7b160cc7..91015f5be 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/nullif.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/nullif.adoc @@ -1,4 +1,4 @@ -= nullif() += nullif :description: The NULLIF() function replaces a given value with NULL if it matches a specific criterion. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/obj-description.adoc b/modules/reference/pages/sql/sql-functions/other-functions/obj-description.adoc index 77bb441f1..9ecd60814 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/obj-description.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/obj-description.adoc @@ -1,4 +1,4 @@ -= obj_description() += obj_description :description: The obj_description() function returns the comment associated with a specific database object. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/pg-backend-pid.adoc b/modules/reference/pages/sql/sql-functions/other-functions/pg-backend-pid.adoc index 3f3983c7b..1df7d4707 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/pg-backend-pid.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/pg-backend-pid.adoc @@ -1,4 +1,4 @@ -= pg_backend_pid() += pg_backend_pid :description: The pg_backend_pid() function returns the process ID (PID) of the server process handling the current session. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/pg-encoding-to-char.adoc b/modules/reference/pages/sql/sql-functions/other-functions/pg-encoding-to-char.adoc index 0c7b79879..d03f44969 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/pg-encoding-to-char.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/pg-encoding-to-char.adoc @@ -1,4 +1,4 @@ -= pg_encoding_to_char() += pg_encoding_to_char :description: The pg_encoding_to_char() function converts an encoding internal identifier to a human-readable name. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/pg-get-constraintdef.adoc b/modules/reference/pages/sql/sql-functions/other-functions/pg-get-constraintdef.adoc index 38c96b973..64f4fdd71 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/pg-get-constraintdef.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/pg-get-constraintdef.adoc @@ -1,4 +1,4 @@ -= pg_get_constraintdef() += pg_get_constraintdef :description: The pg_get_constraintdef() function retrieves the definition of a specific constraint in a human-readable format. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/pg-get-expr.adoc b/modules/reference/pages/sql/sql-functions/other-functions/pg-get-expr.adoc index 553dca1b7..3f8c6e918 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/pg-get-expr.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/pg-get-expr.adoc @@ -1,4 +1,4 @@ -= pg_get_expr() += pg_get_expr :description: The pg_get_expr() function retrieves the internal form of an individual expression, such as the default value for a column. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/pg-get-indexdef.adoc b/modules/reference/pages/sql/sql-functions/other-functions/pg-get-indexdef.adoc index 70f8ba3c5..4458c6555 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/pg-get-indexdef.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/pg-get-indexdef.adoc @@ -1,4 +1,4 @@ -= pg_get_indexdef() += pg_get_indexdef :description: The pg_get_indexdef() function reconstructs the PostgreSQL command used to retrieve the definition of a specified index. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/pg-get-statisticsobjdef-columns.adoc b/modules/reference/pages/sql/sql-functions/other-functions/pg-get-statisticsobjdef-columns.adoc index 92f3be8d7..ceca3e8ac 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/pg-get-statisticsobjdef-columns.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/pg-get-statisticsobjdef-columns.adoc @@ -1,4 +1,4 @@ -= pg_get_statisticsobjdef_columns() += pg_get_statisticsobjdef_columns :description: The pg_get_statisticsobjdef_columns() function retrieves information about the columns associated with an extended statistics object. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/pg-get-userbyid.adoc b/modules/reference/pages/sql/sql-functions/other-functions/pg-get-userbyid.adoc index 992b0638b..155b4c4ab 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/pg-get-userbyid.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/pg-get-userbyid.adoc @@ -1,4 +1,4 @@ -= pg_get_userbyid() += pg_get_userbyid :description: The pg_get_userbyid() function retrieves the name of a user (role) given its unique identifier (OID). :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/pg-relation-is-publishable.adoc b/modules/reference/pages/sql/sql-functions/other-functions/pg-relation-is-publishable.adoc index 6eb8dc11e..4ccbd75e7 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/pg-relation-is-publishable.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/pg-relation-is-publishable.adoc @@ -1,4 +1,4 @@ -= pg_relation_is_publishable() += pg_relation_is_publishable :description: Use the pg_relation_is_publishable() function to determine whether a specified relation (table) can be published in a publication. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/pg-size-pretty.adoc b/modules/reference/pages/sql/sql-functions/other-functions/pg-size-pretty.adoc index 2262794f8..6e5bb18ff 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/pg-size-pretty.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/pg-size-pretty.adoc @@ -1,4 +1,4 @@ -= pg_size_pretty() += pg_size_pretty :description: The pg_size_pretty() function converts sizes in bytes into a human-readable format. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/pg-table-is-visible.adoc b/modules/reference/pages/sql/sql-functions/other-functions/pg-table-is-visible.adoc index 15503ef3d..43c2034bf 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/pg-table-is-visible.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/pg-table-is-visible.adoc @@ -1,4 +1,4 @@ -= pg_table_is_visible() += pg_table_is_visible :description: The pg_table_is_visible() function checks whether a specified table or other database object is visible in the current schema search path. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/pg-table-size.adoc b/modules/reference/pages/sql/sql-functions/other-functions/pg-table-size.adoc index b1b2de662..1a2955438 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/pg-table-size.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/pg-table-size.adoc @@ -1,4 +1,4 @@ -= pg_table_size() += pg_table_size :description: The pg_table_size() function retrieves the size of a specific table, including its associated storage components but excluding indexes. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/pg-total-relation-size.adoc b/modules/reference/pages/sql/sql-functions/other-functions/pg-total-relation-size.adoc index cad5a6544..09c3da0db 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/pg-total-relation-size.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/pg-total-relation-size.adoc @@ -1,4 +1,4 @@ -= pg_total_relation_size() += pg_total_relation_size :description: The pg_total_relation_size() function retrieves the size of a table and is useful for monitoring storage requirements. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/pg-typeof.adoc b/modules/reference/pages/sql/sql-functions/other-functions/pg-typeof.adoc index 6fbac0532..6ed7f742e 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/pg-typeof.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/pg-typeof.adoc @@ -1,4 +1,4 @@ -= pg_typeof() += pg_typeof :description: The pg_typeof() function retrieves the data type of any given value. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/other-functions/shobj-description.adoc b/modules/reference/pages/sql/sql-functions/other-functions/shobj-description.adoc index a50fc93f6..8d01337b4 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/shobj-description.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/shobj-description.adoc @@ -1,4 +1,4 @@ -= shobj_description() += shobj_description :description: The shobj_description() function retrieves the comment associated with a shared database object. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/string-functions/concat.adoc b/modules/reference/pages/sql/sql-functions/string-functions/concat.adoc index 5c0acbddf..1f690fe9a 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/concat.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/concat.adoc @@ -1,4 +1,4 @@ -= CONCAT += concat :description: Use the CONCAT() function to concatenate one or more input values into a single result. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/string-functions/ends-with.adoc b/modules/reference/pages/sql/sql-functions/string-functions/ends-with.adoc index 214bc46e9..341504e16 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/ends-with.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/ends-with.adoc @@ -1,4 +1,4 @@ -= ENDS_WITH += ends_with :description: The ENDS_WITH() function determines whether the first argument ends with a specified string in the second argument or not. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/string-functions/length.adoc b/modules/reference/pages/sql/sql-functions/string-functions/length.adoc index 6c6a48985..d746d1e92 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/length.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/length.adoc @@ -1,4 +1,4 @@ -= LENGTH += length :description: Use the LENGTH() function to find the length of a string (for example, the number of characters in a given string). :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/string-functions/lower.adoc b/modules/reference/pages/sql/sql-functions/string-functions/lower.adoc index da123f7da..fa5c4eeb8 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/lower.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/lower.adoc @@ -1,4 +1,4 @@ -= LOWER += lower :description: The LOWER() function returns a given string, an expression, or values in a column in all lowercase letters. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/string-functions/position.adoc b/modules/reference/pages/sql/sql-functions/string-functions/position.adoc index 28053257e..3c641c85b 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/position.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/position.adoc @@ -1,4 +1,4 @@ -= POSITION += position :description: The POSITION() function returns the position of the first occurrence of a substring in a string. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/string-functions/regex/regexp-match.adoc b/modules/reference/pages/sql/sql-functions/string-functions/regex/regexp-match.adoc index f2158f9c2..780a16638 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/regex/regexp-match.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/regex/regexp-match.adoc @@ -1,4 +1,4 @@ -= REGEXP_MATCH() += regexp_match :description: The REGEXP_MATCH() function matches a POSIX regular expression pattern to a string. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/string-functions/regex/regexp-replace.adoc b/modules/reference/pages/sql/sql-functions/string-functions/regex/regexp-replace.adoc index 170428a90..027523961 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/regex/regexp-replace.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/regex/regexp-replace.adoc @@ -1,4 +1,4 @@ -= REGEXP_REPLACE() += regexp_replace :description: The REGEXP_REPLACE() function replaces all occurrences of a regular expression pattern in a string with a specified replacement string. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/string-functions/replace.adoc b/modules/reference/pages/sql/sql-functions/string-functions/replace.adoc index e376a6db2..43c98905a 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/replace.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/replace.adoc @@ -1,4 +1,4 @@ -= REPLACE() += replace :description: The REPLACE() function looks for and replaces a substring with a new one in a string. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/string-functions/starts-with.adoc b/modules/reference/pages/sql/sql-functions/string-functions/starts-with.adoc index 7f32b0d24..2261176b4 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/starts-with.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/starts-with.adoc @@ -1,4 +1,4 @@ -= STARTS_WITH += starts_with :description: The STARTS_WITH() function determines whether the first argument starts with a specified string in the second argument or not. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/string-functions/strpos.adoc b/modules/reference/pages/sql/sql-functions/string-functions/strpos.adoc index cdeba0eb0..df71f48cb 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/strpos.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/strpos.adoc @@ -1,4 +1,4 @@ -= STRPOS += strpos :description: Use the STRPOS() to return the position from where the substring (the second argument) is matched with the string (the first argument). :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/string-functions/substr.adoc b/modules/reference/pages/sql/sql-functions/string-functions/substr.adoc index c6868b14d..37e759a5a 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/substr.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/substr.adoc @@ -1,4 +1,4 @@ -= SUBSTR += substr :description: The SUBSTR() function extracts a specific number of characters from a string. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/string-functions/substring.adoc b/modules/reference/pages/sql/sql-functions/string-functions/substring.adoc index e437ed16c..d5ab75dd1 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/substring.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/substring.adoc @@ -1,4 +1,4 @@ -= SUBSTRING += substring :description: SUBSTR is an alias for SUBSTRING. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/string-functions/upper.adoc b/modules/reference/pages/sql/sql-functions/string-functions/upper.adoc index 94fe1db62..c78d0ea21 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/upper.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/upper.adoc @@ -1,4 +1,4 @@ -= UPPER += upper :description: The UPPER() function returns a given string, an expression, or values in a column in all uppercase letters. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/current-timestamp.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/current-timestamp.adoc index b2bbc88d9..dbb078fbd 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/current-timestamp.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/current-timestamp.adoc @@ -1,4 +1,4 @@ -= CURRENT_TIMESTAMP += current_timestamp :description: The CURRENT_TIMESTAMP() returns the current timestamp value representing the date and time the query was executed. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/date-trunc.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/date-trunc.adoc index 4facdc7a0..b544a1f56 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/date-trunc.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/date-trunc.adoc @@ -1,4 +1,4 @@ -= DATE_TRUNC += date_trunc :description: The DATE_TRUNC() function truncates a timestamp, timestamp with time zone or interval value to the specified precision, effectively rounding down the :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/extract.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/extract.adoc index 6bcead654..386430fb9 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/extract.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/extract.adoc @@ -1,4 +1,4 @@ -= EXTRACT += extract :description: The EXTRACT() function retrieves a specified part (field) from a given date/time or interval value. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/format-timestamp.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/format-timestamp.adoc index ea033e15f..871a75d33 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/format-timestamp.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/format-timestamp.adoc @@ -1,4 +1,4 @@ -= FORMAT_TIMESTAMP += format_timestamp :description: The FORMAT_TIMESTAMP() function returns a given timestamp value in a specified format. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-micros.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-micros.adoc index 33863845b..b1bced330 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-micros.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-micros.adoc @@ -1,4 +1,4 @@ -= TIMESTAMP_MICROS += timestamp_micros :description: The TIMESTAMP_MICROS() function converts a given UNIX timestamp value in microseconds since 1970-01-01 00:00:00 UTC into a timestamp. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-millis.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-millis.adoc index 475e65c19..0f8ae28c6 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-millis.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-millis.adoc @@ -1,4 +1,4 @@ -= TIMESTAMP_MILLIS += timestamp_millis :description: The TIMESTAMP_MILLIS() function converts a given UNIX timestamp value in milliseconds since 1970-01-01 00:00:00 UTC into a timestamp. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-seconds.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-seconds.adoc index be2a01ae2..33f755781 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-seconds.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-seconds.adoc @@ -1,4 +1,4 @@ -= TIMESTAMP_SECONDS += timestamp_seconds :description: The TIMESTAMP_SECONDS() function converts a given UNIX timestamp value in seconds from 1970-01-01 00:00:00 UTC into a timestamp. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-trunc.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-trunc.adoc index 8021f6f8e..654ac5222 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-trunc.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-trunc.adoc @@ -1,4 +1,4 @@ -= TIMESTAMP_TRUNC += timestamp_trunc :description: The TIMESTAMP_TRUNC() function rounds a timestamp to a specific day_time granularity, resulting in a truncated timestamp. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/to-char.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/to-char.adoc index 289ef28d8..11f24fb0b 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/to-char.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/to-char.adoc @@ -1,4 +1,4 @@ -= TO_CHAR += to_char :description: The TO_CHAR function formats various data types, including date/time, integer, float point and numeric into a formatted string. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/to-timestamp.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/to-timestamp.adoc index 0f0258e71..64e9b1cf0 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/to-timestamp.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/to-timestamp.adoc @@ -1,4 +1,4 @@ -= TO_TIMESTAMP += to_timestamp :description: The TO_TIMESTAMP() function converts a string into a timestamp based on the provided format. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-micros.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-micros.adoc index 97c0b13c7..d55c8f605 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-micros.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-micros.adoc @@ -1,4 +1,4 @@ -= UNIX_MICROS += unix_micros :description: The UNIX_MICROS() function returns a given timestamp into a UNIX timestamp in microseconds, from 1970-01-01 00:00:00-00 (can be negative). :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-millis.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-millis.adoc index cfc9205ef..027d9327e 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-millis.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-millis.adoc @@ -1,4 +1,4 @@ -= UNIX_MILLIS += unix_millis :description: The UNIX_MILLIS() function returns a given timestamp to a UNIX timestamp in milliseconds from 1970-01-01 00:00:00-00 (can be negative). :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-seconds.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-seconds.adoc index bfcaf6f3b..4f732d673 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-seconds.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-seconds.adoc @@ -1,4 +1,4 @@ -= UNIX_SECONDS += unix_seconds :description: The UNIX_SECONDS() function returns a given timestamp to a UNIX timestamp in seconds, from 1970-01-01 00:00:00-00. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/window-functions/avg.adoc b/modules/reference/pages/sql/sql-functions/window-functions/avg.adoc index d58e2fc13..00e1636b4 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/avg.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/avg.adoc @@ -1,4 +1,4 @@ -= AVG() += avg :description: The AVG() window function calculates the average (arithmetic mean) of a set of numeric values within a window. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/window-functions/bool-and.adoc b/modules/reference/pages/sql/sql-functions/window-functions/bool-and.adoc index d1ad4a937..d22e687c9 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/bool-and.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/bool-and.adoc @@ -1,4 +1,4 @@ -= BOOL_AND() += bool_and :description: The BOOL_AND() window function evaluates whether all values within a specified window of rows are TRUE. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/window-functions/bool-or.adoc b/modules/reference/pages/sql/sql-functions/window-functions/bool-or.adoc index 2deee927c..78ed7ce89 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/bool-or.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/bool-or.adoc @@ -1,4 +1,4 @@ -= BOOL_OR() += bool_or :description: The BOOL_OR() window function evaluates whether at least one value within a specified window of rows is TRUE. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/window-functions/count.adoc b/modules/reference/pages/sql/sql-functions/window-functions/count.adoc index d4c0b9747..9b2eb049c 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/count.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/count.adoc @@ -1,4 +1,4 @@ -= COUNT() += count :description: The COUNT() window function retrieves the number of records that meet a specific criteria. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/window-functions/cume-dist.adoc b/modules/reference/pages/sql/sql-functions/window-functions/cume-dist.adoc index d4d3a08fa..cea13fc4b 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/cume-dist.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/cume-dist.adoc @@ -1,4 +1,4 @@ -= CUME_DIST() += cume_dist :description: The CUME_DIST() function is a window function used to calculate the cumulative distribution of a value within a set of values. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/window-functions/dense-rank.adoc b/modules/reference/pages/sql/sql-functions/window-functions/dense-rank.adoc index e51d53e12..115a57f57 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/dense-rank.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/dense-rank.adoc @@ -1,4 +1,4 @@ -= DENSE_RANK() += dense_rank :description: The DENSE_RANK() window function assigns a rank for each value within a specified group, based on the ORDER BY expression in the OVER clause. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/window-functions/first-value.adoc b/modules/reference/pages/sql/sql-functions/window-functions/first-value.adoc index be5be6694..fa9741c01 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/first-value.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/first-value.adoc @@ -1,4 +1,4 @@ -= FIRST_VALUE() += first_value :description: The FIRST_VALUE() is a window function that retrieves the first value in an ordered set of values within a specified partition. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/window-functions/lag.adoc b/modules/reference/pages/sql/sql-functions/window-functions/lag.adoc index 6806cada7..a02708664 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/lag.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/lag.adoc @@ -1,4 +1,4 @@ -= LAG() += lag :description: The LAG() window function returns the values from specific rows based on the offset argument (previous to the current row in the partition). :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/window-functions/last-value.adoc b/modules/reference/pages/sql/sql-functions/window-functions/last-value.adoc index 4ac2e4999..d84125222 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/last-value.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/last-value.adoc @@ -1,4 +1,4 @@ -= LAST_VALUE() += last_value :description: The LAST_VALUE() is a window function that retrieves the last value in an ordered set of values within a specified partition. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/window-functions/lead.adoc b/modules/reference/pages/sql/sql-functions/window-functions/lead.adoc index c5c390680..3f06fc9c8 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/lead.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/lead.adoc @@ -1,4 +1,4 @@ -= LEAD() += lead :description: The LEAD() window function takes a column and an integer offset as arguments and returns the value of the cell in that column that is located at the s :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/window-functions/max.adoc b/modules/reference/pages/sql/sql-functions/window-functions/max.adoc index ce1027816..abcca2819 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/max.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/max.adoc @@ -1,4 +1,4 @@ -= MAX() += max :description: The MAX() window function computes the maximum value of an expression across a set of rows defined by a window specification. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/window-functions/min.adoc b/modules/reference/pages/sql/sql-functions/window-functions/min.adoc index f00b81c64..b8f8e529f 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/min.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/min.adoc @@ -1,4 +1,4 @@ -= MIN() += min :description: The MIN() window function computes the minimum value of an expression across a set of rows defined by a window specification. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/window-functions/nth-value.adoc b/modules/reference/pages/sql/sql-functions/window-functions/nth-value.adoc index 5080298aa..fb5d2a55d 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/nth-value.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/nth-value.adoc @@ -1,4 +1,4 @@ -= NTH_VALUE() += nth_value :description: The NTH_VALUE() is a window function that accesses the value from the nth row within a specified window frame. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/window-functions/ntile.adoc b/modules/reference/pages/sql/sql-functions/window-functions/ntile.adoc index adf4a91dd..d4c64f62b 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/ntile.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/ntile.adoc @@ -1,4 +1,4 @@ -= NTILE() += ntile :description: The NTILE() function is a window function used to divide an ordered data set into a specified number of approximately equal groups or buckets. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/window-functions/percent-rank.adoc b/modules/reference/pages/sql/sql-functions/window-functions/percent-rank.adoc index 1867d4827..5889dff4c 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/percent-rank.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/percent-rank.adoc @@ -1,4 +1,4 @@ -= PERCENT_RANK() += percent_rank :description: PERCENT_RANK() window function determines the relative rank of a value in a group of values, based on the ORDER BY expression in the OVER clause. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/window-functions/rank.adoc b/modules/reference/pages/sql/sql-functions/window-functions/rank.adoc index f2c29f7e8..016e0061e 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/rank.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/rank.adoc @@ -1,4 +1,4 @@ -= RANK() += rank :description: The RANK() window function determines the rank of a value in a group of values, based on the ORDER BY expression in the OVER clause. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/window-functions/row-number.adoc b/modules/reference/pages/sql/sql-functions/window-functions/row-number.adoc index f0ec6c158..0d4ed3fd3 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/row-number.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/row-number.adoc @@ -1,4 +1,4 @@ -= ROW_NUMBER += row_number :description: The ROW_NUMBER() window function returns the number of the current row within its partition (counting from 1), based on the ORDER BY expression in the :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-functions/window-functions/sum.adoc b/modules/reference/pages/sql/sql-functions/window-functions/sum.adoc index 2d1f82138..cc5742dd5 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/sum.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/sum.adoc @@ -1,4 +1,4 @@ -= SUM() += sum :description: The SUM() window function returns the sum of the input column or expression values. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-operators/bitwise-shift-left.adoc b/modules/reference/pages/sql/sql-operators/bitwise-shift-left.adoc index 5557db819..eb12d553d 100644 --- a/modules/reference/pages/sql/sql-operators/bitwise-shift-left.adoc +++ b/modules/reference/pages/sql/sql-operators/bitwise-shift-left.adoc @@ -1,4 +1,4 @@ -= BITWISE SHIFT LEFT += Bitwise Shift Left :description: Bitwise shift operators in Redpanda SQL manipulate the bits of integer value by shifting them left or right. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-operators/bitwise-shift-right.adoc b/modules/reference/pages/sql/sql-operators/bitwise-shift-right.adoc index e3fc67643..a086b668b 100644 --- a/modules/reference/pages/sql/sql-operators/bitwise-shift-right.adoc +++ b/modules/reference/pages/sql/sql-operators/bitwise-shift-right.adoc @@ -1,4 +1,4 @@ -= BITWISE SHIFT RIGHT += Bitwise Shift Right :description: Bitwise shift operators in Redpanda SQL manipulate the bits of integer value by shifting them left or right. :page-topic-type: reference diff --git a/modules/reference/pages/sql/sql-statements/index.adoc b/modules/reference/pages/sql/sql-statements/index.adoc index 03cdd28ed..be2cf1fbc 100644 --- a/modules/reference/pages/sql/sql-statements/index.adoc +++ b/modules/reference/pages/sql/sql-statements/index.adoc @@ -1,4 +1,4 @@ -= SQL statements += SQL Statements :description: SQL statements are the commands used to interact with Redpanda SQL. :page-topic-type: reference From 25bd936e5848d41e1cf6024874632e6e4592f1de Mon Sep 17 00:00:00 2001 From: Kat Batuigas Date: Thu, 21 May 2026 16:37:47 -0700 Subject: [PATCH 04/16] Add catalog qualifier --- modules/reference/pages/sql/comment-support.adoc | 4 ++-- .../reference/pages/sql/sql-clauses/offset.adoc | 6 +++--- .../pages/sql/sql-statements/select.adoc | 16 ++++++++-------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/reference/pages/sql/comment-support.adoc b/modules/reference/pages/sql/comment-support.adoc index e27cf1c47..1ed914cd2 100644 --- a/modules/reference/pages/sql/comment-support.adoc +++ b/modules/reference/pages/sql/comment-support.adoc @@ -40,7 +40,7 @@ In Redpanda SQL, single-line comments should always be placed at the end of the [source,sql] ---- SELECT column1, column2 -- This is an example single line comment -FROM table_name; +FROM default_redpanda_catalog=>table_name; ---- === Comment on multiple lines @@ -48,7 +48,7 @@ FROM table_name; [source,sql] ---- SELECT /* comment 1 */ column1, column2 -FROM table_name /* comment 2 */ +FROM default_redpanda_catalog=>table_name /* comment 2 */ WHERE column3 = 42 /* comment 3 */ ; ---- diff --git a/modules/reference/pages/sql/sql-clauses/offset.adoc b/modules/reference/pages/sql/sql-clauses/offset.adoc index b61f5d1df..36908ef57 100644 --- a/modules/reference/pages/sql/sql-clauses/offset.adoc +++ b/modules/reference/pages/sql/sql-clauses/offset.adoc @@ -9,7 +9,7 @@ The `OFFSET` clause skips a specified number of records from the result set. [source,sql] ---- SELECT columns -FROM table_name +FROM default_redpanda_catalog=>table_name OFFSET num; ---- @@ -25,7 +25,7 @@ The following example uses a `salaryemp` table. [source,sql] ---- -SELECT * FROM salaryemp ORDER BY emp_sal; +SELECT * FROM default_redpanda_catalog=>salaryemp ORDER BY emp_sal; ---- The query returns: @@ -52,7 +52,7 @@ The following query skips the first three rows and returns the next five, ordere [source,sql] ---- -SELECT * FROM salaryemp +SELECT * FROM default_redpanda_catalog=>salaryemp ORDER BY emp_sal LIMIT 5 OFFSET 3; ---- diff --git a/modules/reference/pages/sql/sql-statements/select.adoc b/modules/reference/pages/sql/sql-statements/select.adoc index f0e6183fd..ed58ff395 100644 --- a/modules/reference/pages/sql/sql-statements/select.adoc +++ b/modules/reference/pages/sql/sql-statements/select.adoc @@ -14,7 +14,7 @@ To retrieve data from a table, use this syntax: [source,sql] ---- -SELECT * FROM table_name; +SELECT * FROM default_redpanda_catalog=>table_name; ---- To filter by specific columns, use: @@ -22,7 +22,7 @@ To filter by specific columns, use: [source,sql] ---- SELECT column1, column2, ... -FROM table_name; +FROM default_redpanda_catalog=>table_name; ---- Where: @@ -48,14 +48,14 @@ The following examples query a table named `student_data` that contains student + [source,sql] ---- -SELECT * FROM table_name; +SELECT * FROM default_redpanda_catalog=>table_name; ---- . Run the following query: + [source,sql] ---- -SELECT * FROM student_data; +SELECT * FROM default_redpanda_catalog=>student_data; ---- . The query returns: @@ -77,14 +77,14 @@ SELECT * FROM student_data; + [source,sql] ---- -SELECT column_1, column_2 FROM table_name; +SELECT column_1, column_2 FROM default_redpanda_catalog=>table_name; ---- . Run: + [source,sql] ---- -SELECT id, name FROM student_data; +SELECT id, name FROM default_redpanda_catalog=>student_data; ---- . The query returns: @@ -106,14 +106,14 @@ SELECT id, name FROM student_data; + [source,sql] ---- -SELECT column_1 FROM table_name WHERE condition; +SELECT column_1 FROM default_redpanda_catalog=>table_name WHERE condition; ---- . To find the student who lives in Sydney, run: + [source,sql] ---- -SELECT name FROM student_data WHERE domicile='Sydney'; +SELECT name FROM default_redpanda_catalog=>student_data WHERE domicile='Sydney'; ---- . The query returns: From 8dc581c80a9f7ce86153a28e61d99b7945cfa341 Mon Sep 17 00:00:00 2001 From: Kat Batuigas Date: Thu, 21 May 2026 18:33:23 -0700 Subject: [PATCH 05/16] Backticks pass --- .../pages/sql/sql-data-types/array.adoc | 2 +- .../pages/sql/sql-data-types/index.adoc | 30 +++++++++---------- .../pages/sql/sql-data-types/json.adoc | 4 +-- .../sql/sql-data-types/time-type/time.adoc | 2 +- .../aggregate-functions/sum.adoc | 4 +-- .../pages/sql/sql-functions/index.adoc | 6 ++-- .../sql-functions/json-functions/index.adoc | 20 ++++++------- .../json-functions/json-array-extract.adoc | 12 ++++---- .../json-functions/json-array-length.adoc | 6 ++-- .../json-extract-path-text.adoc | 12 ++++---- .../json-functions/json-extract-path.adoc | 10 +++---- .../sql-functions/other-functions/index.adoc | 2 +- .../timestamp-functions/extract.adoc | 2 +- .../timestamp-functions/unix-micros.adoc | 2 +- .../timestamp-functions/unix-millis.adoc | 2 +- .../timestamp-functions/unix-seconds.adoc | 2 +- .../sql-functions/window-functions/sum.adoc | 2 +- .../pages/sql/sql-operators/index.adoc | 4 +-- 18 files changed, 62 insertions(+), 62 deletions(-) diff --git a/modules/reference/pages/sql/sql-data-types/array.adoc b/modules/reference/pages/sql/sql-data-types/array.adoc index a782ca78a..3d0b51f31 100644 --- a/modules/reference/pages/sql/sql-data-types/array.adoc +++ b/modules/reference/pages/sql/sql-data-types/array.adoc @@ -96,7 +96,7 @@ SELECT '{"{\"key1\": 1, \"key2\": \"value\"}", NULL, true}'::json[]; [NOTE] ==== -In this example, the double quotes which are a part of the JSON value are required to be escaped with a backslash, so that they are not mistaken with the double quote, which marks the end of the element. +In this example, the double quotes which are a part of the `json` value are required to be escaped with a backslash, so that they are not mistaken with the double quote, which marks the end of the element. ==== == Access arrays diff --git a/modules/reference/pages/sql/sql-data-types/index.adoc b/modules/reference/pages/sql/sql-data-types/index.adoc index 2402c7c88..e40037643 100644 --- a/modules/reference/pages/sql/sql-data-types/index.adoc +++ b/modules/reference/pages/sql/sql-data-types/index.adoc @@ -9,21 +9,21 @@ The following table summarizes the data types supported by Redpanda SQL: [width="100%",cols="<48%,<29%,<23%",options="header",] |=== |Data Type |Definition |Format -|xref:reference:sql/sql-data-types/numeric-type/numeric.adoc#int-type[INT] |32-bit signed integer |one or more digits "`0`" to "`9`" -|xref:reference:sql/sql-data-types/numeric-type/numeric.adoc#bigint-type[BIGINT] |64-bit signed integer |large numeric/decimal value -|xref:reference:sql/sql-data-types/numeric-type/numeric.adoc#real-type[REAL] |32-bit floating point number |`float(n)` -|xref:reference:sql/sql-data-types/numeric-type/numeric.adoc#double-precision-type[DOUBLE PRECISION] |64-bit floating point number |`decimal(p, s)` -|xref:reference:sql/sql-data-types/timestamp-without-time-zone.adoc[TIMESTAMP WITHOUT TIME ZONE] |Time and date values without a time zone |`YYYY-MM-DD [HH:MM:SS[.SSSSSS]]` -|xref:reference:sql/sql-data-types/timestamp-with-time-zone.adoc[TIMESTAMP WITH TIME ZONE] |Date and time values, including the time zone information |`YYYY-MM-DD HH:MM:SS.SSSSSS{plus}TZ` -|xref:reference:sql/sql-data-types/date.adoc[DATE] |Date value |`YYYY-MM-DD` -|xref:reference:sql/sql-data-types/time-type/time.adoc[TIME] |Time values without any date information |`HH:MM:SS[.SSSSSS]` -|xref:reference:sql/sql-data-types/interval.adoc[INTERVAL] |Encodes a span of time |`year-month (YYYY-MM); day-time (DD HH:MM:SS)` -|xref:reference:sql/sql-data-types/bool.adoc[BOOL] |Boolean value |`True` or `False` -|xref:reference:sql/sql-data-types/text.adoc[TEXT] |UTF8 encoded string with Unicode support |'`text`' -|xref:reference:sql/sql-data-types/bytea.adoc[BYTEA] |Arbitrary binary data (raw bytes) |`'\xDEADBEEF'` or `'\336\255'` -|xref:reference:sql/sql-data-types/json.adoc[JSON] |A value in JSON standard format |`variable_name JSON` -|xref:reference:sql/sql-data-types/array.adoc[ARRAY] |An array of a specific data type |`'{value1, value2, value3}'::data_type[]` -|xref:reference:sql/sql-data-types/row.adoc[ROW] |A composite value containing fields of different types |`ROW(value1, value2, ...)` +|xref:reference:sql/sql-data-types/numeric-type/numeric.adoc#int-type[`int`] |32-bit signed integer |one or more digits "`0`" to "`9`" +|xref:reference:sql/sql-data-types/numeric-type/numeric.adoc#bigint-type[`bigint`] |64-bit signed integer |large numeric/decimal value +|xref:reference:sql/sql-data-types/numeric-type/numeric.adoc#real-type[`real`] |32-bit floating point number |`float(n)` +|xref:reference:sql/sql-data-types/numeric-type/numeric.adoc#double-precision-type[`double precision`] |64-bit floating point number |`decimal(p, s)` +|xref:reference:sql/sql-data-types/timestamp-without-time-zone.adoc[`timestamp without time zone`] |Time and date values without a time zone |`YYYY-MM-DD [HH:MM:SS[.SSSSSS]]` +|xref:reference:sql/sql-data-types/timestamp-with-time-zone.adoc[`timestamp with time zone`] |Date and time values, including the time zone information |`YYYY-MM-DD HH:MM:SS.SSSSSS{plus}TZ` +|xref:reference:sql/sql-data-types/date.adoc[`date`] |Date value |`YYYY-MM-DD` +|xref:reference:sql/sql-data-types/time-type/time.adoc[`time`] |Time values without any date information |`HH:MM:SS[.SSSSSS]` +|xref:reference:sql/sql-data-types/interval.adoc[`interval`] |Encodes a span of time |`year-month (YYYY-MM); day-time (DD HH:MM:SS)` +|xref:reference:sql/sql-data-types/bool.adoc[`bool`] |Boolean value |`True` or `False` +|xref:reference:sql/sql-data-types/text.adoc[`text`] |UTF8 encoded string with Unicode support |'`text`' +|xref:reference:sql/sql-data-types/bytea.adoc[`bytea`] |Arbitrary binary data (raw bytes) |`'\xDEADBEEF'` or `'\336\255'` +|xref:reference:sql/sql-data-types/json.adoc[`json`] |A value in JSON standard format |`variable_name JSON` +|xref:reference:sql/sql-data-types/array.adoc[`array`] |An array of a specific data type |`'{value1, value2, value3}'::data_type[]` +|xref:reference:sql/sql-data-types/row.adoc[`row`] |A composite value containing fields of different types |`ROW(value1, value2, ...)` |xref:reference:sql/sql-data-types/geometry.adoc[GEOMETRY] |A spatial data type for planar (Cartesian) point values |`GEOMETRY 'POINT(x y)'` |xref:reference:sql/sql-data-types/geography.adoc[GEOGRAPHY] |A spatial data type for geodetic (spherical) point values using WGS84 |`GEOGRAPHY 'POINT(lon lat)'` |=== diff --git a/modules/reference/pages/sql/sql-data-types/json.adoc b/modules/reference/pages/sql/sql-data-types/json.adoc index 06a3ff3ec..eec6d5443 100644 --- a/modules/reference/pages/sql/sql-data-types/json.adoc +++ b/modules/reference/pages/sql/sql-data-types/json.adoc @@ -8,7 +8,7 @@ JSON stands for JavaScript Object Notation. It is an open standard format with k == Syntax -The JSON data type in Redpanda SQL has the following syntax: +The `json` data type in Redpanda SQL has the following syntax: [source,sql] ---- @@ -76,5 +76,5 @@ The query returns the following output: [TIP] ==== -It is normal for the JSON type's result to look disordered. +It is normal for the `json` type's result to look disordered. ==== diff --git a/modules/reference/pages/sql/sql-data-types/time-type/time.adoc b/modules/reference/pages/sql/sql-data-types/time-type/time.adoc index fc4ec34b3..1bc250d4e 100644 --- a/modules/reference/pages/sql/sql-data-types/time-type/time.adoc +++ b/modules/reference/pages/sql/sql-data-types/time-type/time.adoc @@ -6,7 +6,7 @@ The `TIME` data type in Redpanda SQL stores time values without any date informa == Format -The format for the TIME data type is as follows: +The format for the `time` data type is as follows: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/sum.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/sum.adoc index 2dbacf8a7..d7ecb3a0d 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/sum.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/sum.adoc @@ -9,11 +9,11 @@ The supported input and return types are listed in the following table. [cols=",",options="header",] |=== |Input type |Return type -|INT |LONG +|`int` |LONG |LONG |LONG |FLOAT |DOUBLE |DOUBLE |DOUBLE -|INTERVAL |INTERVAL +|`interval` |`interval` |=== [NOTE] diff --git a/modules/reference/pages/sql/sql-functions/index.adoc b/modules/reference/pages/sql/sql-functions/index.adoc index 5a75d5cd2..8646084f9 100644 --- a/modules/reference/pages/sql/sql-functions/index.adoc +++ b/modules/reference/pages/sql/sql-functions/index.adoc @@ -7,11 +7,11 @@ Redpanda SQL supports the following function types for querying and transforming [width="100%",cols="<42%,<58%",options="header",] |=== |Function Name |Description -|xref:reference:sql/sql-functions/boolean-functions/if-function.adoc[BOOLEAN FUNCTIONS] |Evaluate logical conditions and return `TRUE`, `FALSE` OR `NULL` +|xref:reference:sql/sql-functions/boolean-functions/if-function.adoc[`boolean` FUNCTIONS] |Evaluate logical conditions and return `TRUE`, `FALSE` OR `NULL` |xref:reference:sql/sql-functions/math-functions/index.adoc[MATH, TRIGONOMETRIC, AND HYPERBOLIC FUNCTIONS] |Perform mathematical operations on numeric data, including rounding, exponentiation, and trigonometric calculations |xref:reference:sql/sql-functions/string-functions/index.adoc[STRING FUNCTIONS] |Manipulate string data for text processing, including concatenation, substring extraction and case conversion -|xref:reference:sql/sql-functions/timestamp-functions/index.adoc[TIMESTAMP FUNCTIONS] |Handle data and time values including extracting components, adding intervals and comparing timestamps -|xref:reference:sql/sql-functions/json-functions/index.adoc[JSON FUNCTIONS] |Manipulate and query JSON data stored in the database, including extracting values and creating JSON objects +|xref:reference:sql/sql-functions/timestamp-functions/index.adoc[`timestamp` FUNCTIONS] |Handle data and time values including extracting components, adding intervals and comparing timestamps +|xref:reference:sql/sql-functions/json-functions/index.adoc[`json` FUNCTIONS] |Manipulate and query `json` data stored in the database, including extracting values and creating `json` objects |xref:reference:sql/sql-functions/aggregate-functions/index.adoc[AGGREGATE FUNCTIONS] |Summarize a set of values and return a single result, such as calculating sums, averages and counts |xref:reference:sql/sql-functions/window-functions/index.adoc[WINDOW FUNCTIONS] |Operate over a subset of rows defined by a windowing clause, enabling ranking, aggregation and row numbering within result sets |xref:reference:sql/sql-functions/other-functions/index.adoc[OTHER FUNCTIONS] |Includes a variety of specialized functions not categorized elsewhere diff --git a/modules/reference/pages/sql/sql-functions/json-functions/index.adoc b/modules/reference/pages/sql/sql-functions/json-functions/index.adoc index 2967a5903..bbf30a80b 100644 --- a/modules/reference/pages/sql/sql-functions/json-functions/index.adoc +++ b/modules/reference/pages/sql/sql-functions/json-functions/index.adoc @@ -1,24 +1,24 @@ = Overview :description: Redpanda SQL provides functions to query and manipulate JSON data. -Redpanda SQL provides functions to query and manipulate JSON data: +Redpanda SQL provides functions to query and manipulate `json` data: [width="100%",cols="53%,47%",options="header",] |=== |*Functions* |*Description* -|xref:reference:sql/sql-functions/json-functions/json-extract-path.adoc[JSON_EXTRACT_PATH()] |Extracts a JSON sub-object at the specified path. -|xref:reference:sql/sql-functions/json-functions/json-extract-path-text.adoc[JSON_EXTRACT_PATH_TEXT()] |Returns text referenced by a series of path elements in a JSON string or JSON body. -|xref:reference:sql/sql-functions/json-functions/json-array-length.adoc[JSON_ARRAY_LENGTH()] |Returns the number of elements in the outer array of a JSON string or JSON body. -|xref:reference:sql/sql-functions/json-functions/json-array-extract.adoc[JSON_ARRAY_EXTRACT()] |Returns the JSON array as a set of JSON values. +|xref:reference:sql/sql-functions/json-functions/json-extract-path.adoc[JSON_EXTRACT_PATH()] |Extracts a `json` sub-object at the specified path. +|xref:reference:sql/sql-functions/json-functions/json-extract-path-text.adoc[JSON_EXTRACT_PATH_TEXT()] |Returns text referenced by a series of path elements in a `json` string or `json` body. +|xref:reference:sql/sql-functions/json-functions/json-array-length.adoc[JSON_ARRAY_LENGTH()] |Returns the number of elements in the outer array of a `json` string or `json` body. +|xref:reference:sql/sql-functions/json-functions/json-array-extract.adoc[JSON_ARRAY_EXTRACT()] |Returns the `json` array as a set of `json` values. |=== -Use operators to specify conditions when using JSON functions. Redpanda SQL also supports the following JSON operators: +Use operators to specify conditions when using `json` functions. Redpanda SQL also supports the following `json` operators: [width="100%",cols="12%,46%,42%",options="header",] |=== |*Operators* |*Description* |*Example* -|-> |Gets and returns the element of the JSON array. |`'[{"a":"cab"},{"b":"bac"},{"c":"abc"}]'::json -> 2` -|-> |Gets and returns the JSON object field. |`'{"a": {"b":"abc"}}'::json -> 'a'` -|->> |Gets and returns the element of the JSON array as text. |`'[11,22,33]'::json ->> 2` -|->> |Gets and returns the JSON object field as text. |`'{"a":13,"b":33}'::json ->> 'b'` +|-> |Gets and returns the element of the `json` array. |`'[{"a":"cab"},{"b":"bac"},{"c":"abc"}]'::json -> 2` +|-> |Gets and returns the `json` object field. |`'{"a": {"b":"abc"}}'::json -> 'a'` +|->> |Gets and returns the element of the `json` array as text. |`'[11,22,33]'::json ->> 2` +|->> |Gets and returns the `json` object field as text. |`'{"a":13,"b":33}'::json ->> 'b'` |=== diff --git a/modules/reference/pages/sql/sql-functions/json-functions/json-array-extract.adoc b/modules/reference/pages/sql/sql-functions/json-functions/json-array-extract.adoc index be8f0ec07..81b5e8e96 100644 --- a/modules/reference/pages/sql/sql-functions/json-functions/json-array-extract.adoc +++ b/modules/reference/pages/sql/sql-functions/json-functions/json-array-extract.adoc @@ -4,7 +4,7 @@ == Overview -The `JSON_ARRAY_EXTRACT()` function returns the JSON array as a set of JSON values. +The `JSON_ARRAY_EXTRACT()` function returns the `json` array as a set of `json` values. == Syntax @@ -18,7 +18,7 @@ JSON_ARRAY_EXTRACT('json_array'::JSON,id); `JSON_ARRAY_EXTRACT()` requires the following parameters: * `json_array`: The array to extract. -* `::JSON`: Argument indicating that the query is of type JSON. +* `::JSON`: Argument indicating that the query is of type `json`. * `id`: ID of the element to extract. It is read in an array format that starts with 0. === Another option @@ -30,15 +30,15 @@ JSON_ARRAY_EXTRACT('json_array'::JSON,id); SELECT 'from_json'::JSON -> path; ---- -* `from_json`: The JSON value from which to extract. -* `::JSON`: A symbol that casts the string literal to a JSON type. +* `from_json`: The `json` value from which to extract. +* `::JSON`: A symbol that casts the string literal to a `json` type. * `path`: Key of the field to extract. == Examples === Basic JSON_ARRAY_EXTRACT() function -. The following example extracts a JSON array as a JSON set. +. The following example extracts a `json` array as a `json` set. + [source,sql] ---- @@ -65,7 +65,7 @@ SELECT ('["Bougenvile", 2, 12, "Lily"]'::JSON -> 3); === Extract element of JSON array as text -. This example extracts the element of the JSON array as text with the `->>` operator. +. This example extracts the element of the `json` array as text with the `->>` operator. + [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/json-functions/json-array-length.adoc b/modules/reference/pages/sql/sql-functions/json-functions/json-array-length.adoc index 23884f930..edd210ddc 100644 --- a/modules/reference/pages/sql/sql-functions/json-functions/json-array-length.adoc +++ b/modules/reference/pages/sql/sql-functions/json-functions/json-array-length.adoc @@ -2,7 +2,7 @@ :description: The JSON_ARRAY_LENGTH() function returns the length of a specified JSON array. :page-topic-type: reference -The `JSON_ARRAY_LENGTH()` function returns the length of a specified JSON array. +The `JSON_ARRAY_LENGTH()` function returns the length of a specified `json` array. == Syntax @@ -13,7 +13,7 @@ This function has the following basic syntax. JSON_ARRAY_LENGTH(arrayval JSON) ---- -The required argument for this function is `arrayval`. It represents the JSON array for which to count the length. +The required argument for this function is `arrayval`. It represents the `json` array for which to count the length. == Examples @@ -59,7 +59,7 @@ The query returns: === JSON array length where the array is NULL or empty -This example shows that an empty JSON array returns 0. +This example shows that an empty `json` array returns 0. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path-text.adoc b/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path-text.adoc index 529fb4192..3ea675c33 100644 --- a/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path-text.adoc +++ b/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path-text.adoc @@ -2,11 +2,11 @@ :description: The JSON_EXTRACT_PATH_TEXT() function extracts JSON nested value from a specified JSON value according to the defined path. :page-topic-type: reference -The `JSON_EXTRACT_PATH_TEXT()` function extracts JSON nested value from a specified JSON value according to the defined path. +The `JSON_EXTRACT_PATH_TEXT()` function extracts `json` nested value from a specified `json` value according to the defined path. [NOTE] ==== -This function may be similar to the `JSON_EXTRACT_PATH()`. This function returns a value of type text instead of type JSON. +This function may be similar to the `JSON_EXTRACT_PATH()`. This function returns a value of type text instead of type `json`. ==== == Syntax @@ -20,7 +20,7 @@ JSON_EXTRACT_PATH_TEXT(from_json JSON, path TEXT[]) The required arguments are: -* `from_json`: The JSON value to extract. +* `from_json`: The `json` value to extract. * `path`: The path to extract. === Another option @@ -32,13 +32,13 @@ Redpanda SQL also provides and supports the use of operators in queries. Here's SELECT 'from_json'::JSON ->> 'path'; ---- -* `from_json`: The JSON value from which to extract. -* `::JSON`: A symbol that casts the text literal to a JSON type. +* `from_json`: The `json` value from which to extract. +* `::JSON`: A symbol that casts the text literal to a `json` type. * `path`: Key of the field to extract. == Examples -. This example shows how to use the `JSON_EXTRACT_PATH_TEXT()` function to extract values ​​from a JSON object at a specified index. +. This example shows how to use the `JSON_EXTRACT_PATH_TEXT()` function to extract values ​​from a `json` object at a specified index. + Run the query: + diff --git a/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path.adoc b/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path.adoc index 6f327df10..894904a0d 100644 --- a/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path.adoc +++ b/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path.adoc @@ -2,7 +2,7 @@ :description: JSON_EXTRACT_PATH() function extracts JSON nested value from a specified path. :page-topic-type: reference -`JSON_EXTRACT_PATH()` function extracts JSON nested value from a specified path. +`JSON_EXTRACT_PATH()` function extracts `json` nested value from a specified path. == Syntax @@ -13,7 +13,7 @@ The syntax of the `JSON_EXTRACT_PATH()` function is: JSON_EXTRACT_PATH(from_json JSON, path TEXT[]) ---- -* `from_json`: The JSON value from which to extract. +* `from_json`: The `json` value from which to extract. * `path`: The path to extract. === Another option @@ -25,13 +25,13 @@ Redpanda SQL also provides and supports the use of operators in queries: SELECT 'from_json'::JSON -> 'path'; ---- -* `from_json`: The JSON value from which to extract. -* `::JSON`: A symbol that casts the text literal to a JSON type. +* `from_json`: The `json` value from which to extract. +* `::JSON`: A symbol that casts the text literal to a `json` type. * `path`: Key of the field to extract. == Examples -These examples display how `JSON_EXTRACT_PATH()` extracts the "`oxla`" JSON sub-object from the specified path. +These examples display how `JSON_EXTRACT_PATH()` extracts the "`oxla`" `json` sub-object from the specified path. . Use the query: + diff --git a/modules/reference/pages/sql/sql-functions/other-functions/index.adoc b/modules/reference/pages/sql/sql-functions/other-functions/index.adoc index 063d9a19e..48ab04c8f 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/index.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/index.adoc @@ -2,7 +2,7 @@ :description: Reference for other Redpanda SQL functions, including coalesce, nullif, and PostgreSQL system information functions. :page-topic-type: reference -Besides xref:reference:sql/sql-functions/math-functions/index.adoc[math], xref:reference:sql/sql-functions/aggregate-functions/index.adoc[aggregate], xref:reference:sql/sql-functions/window-functions/index.adoc[window], xref:reference:sql/sql-functions/string-functions/index.adoc[string], xref:reference:sql/sql-functions/timestamp-functions/index.adoc[timestamp], and xref:reference:sql/sql-functions/json-functions/index.adoc[JSON] functions, Redpanda SQL also supports these functions: +Besides xref:reference:sql/sql-functions/math-functions/index.adoc[math], xref:reference:sql/sql-functions/aggregate-functions/index.adoc[aggregate], xref:reference:sql/sql-functions/window-functions/index.adoc[window], xref:reference:sql/sql-functions/string-functions/index.adoc[string], xref:reference:sql/sql-functions/timestamp-functions/index.adoc[timestamp], and xref:reference:sql/sql-functions/json-functions/index.adoc[`json`] functions, Redpanda SQL also supports these functions: [cols="46%,54%",options="header",] |=== diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/extract.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/extract.adoc index 386430fb9..d1da77e80 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/extract.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/extract.adoc @@ -28,7 +28,7 @@ This table shows the supported input and corresponding return types for the `EXT [NOTE] ==== -The SECOND field returns a fractional value as DOUBLE PRECISION to include fractional seconds, not an integer type +The SECOND field returns a fractional value as `double precision` to include fractional seconds, not an integer type ==== == Examples diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-micros.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-micros.adoc index d55c8f605..8eb7e8c57 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-micros.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-micros.adoc @@ -9,7 +9,7 @@ The `UNIX_MICROS()` function returns a given timestamp into a UNIX timestamp in SELECT UNIX_MICRO(TIMESTAMP) ---- -Its input type is a TIMESTAMP expression, and the return data type is `int64` representing time in microseconds. +Its input type is a `timestamp` expression, and the return data type is `int64` representing time in microseconds. == Examples diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-millis.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-millis.adoc index 027d9327e..6d8330ddb 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-millis.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-millis.adoc @@ -9,7 +9,7 @@ The `UNIX_MILLIS()` function returns a given timestamp to a UNIX timestamp in mi SELECT UNIX_MILLIS(TIMESTAMP) ---- -Its input type is a TIMESTAMP expression, and the return data type is `BIGINT` representing time in milliseconds. +Its input type is a `timestamp` expression, and the return data type is `BIGINT` representing time in milliseconds. == Examples diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-seconds.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-seconds.adoc index 4f732d673..9751beafd 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-seconds.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-seconds.adoc @@ -9,7 +9,7 @@ The `UNIX_SECONDS()` function returns a given timestamp to a UNIX timestamp in s SELECT UNIX_SECONDS(TIMESTAMP) ---- -Its input type is a TIMESTAMP expression, and the return data type is `BIGINT` representing time in seconds. +Its input type is a `timestamp` expression, and the return data type is `BIGINT` representing time in seconds. == Examples diff --git a/modules/reference/pages/sql/sql-functions/window-functions/sum.adoc b/modules/reference/pages/sql/sql-functions/window-functions/sum.adoc index cc5742dd5..21374bbc8 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/sum.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/sum.adoc @@ -157,7 +157,7 @@ The query returns: === Time series: SUM() with RANGE BETWEEN for last 30 days -This example demonstrates a common time series use case: calculating the rolling sum of sales quantity over the last 30 days for each row, using the RANGE BETWEEN INTERVAL '`30 days`' PRECEDING AND CURRENT ROW frame: +This example demonstrates a common time series use case: calculating the rolling sum of sales quantity over the last 30 days for each row, using the RANGE BETWEEN `interval` '`30 days`' PRECEDING AND CURRENT `row` frame: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-operators/index.adoc b/modules/reference/pages/sql/sql-operators/index.adoc index 72bb32bd9..ca6194e93 100644 --- a/modules/reference/pages/sql/sql-operators/index.adoc +++ b/modules/reference/pages/sql/sql-operators/index.adoc @@ -99,8 +99,8 @@ Operators in Redpanda SQL are special symbols used in expressions to compare, co [cols="1,1,3,2",options="header"] |=== |Operator |Name |Description |Example -|`->` |JSON extract |Extracts a JSON object field or array element, returning JSON. |`data -> 'key'` -|`->>` |JSON extract text |Extracts a JSON object field or array element as text. |`data ->> 'key'` +|`->` |`json` extract |Extracts a `json` object field or array element, returning `json`. |`data -> 'key'` +|`->>` |`json` extract text |Extracts a `json` object field or array element as text. |`data ->> 'key'` |=== == Array operators From 495f564ed74463e7bbddfb35f4daed73c18808cf Mon Sep 17 00:00:00 2001 From: Kat Batuigas Date: Thu, 21 May 2026 18:42:48 -0700 Subject: [PATCH 06/16] Edit landing page --- modules/sql/pages/index.adoc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/sql/pages/index.adoc b/modules/sql/pages/index.adoc index 2f23bb411..0ae376d42 100644 --- a/modules/sql/pages/index.adoc +++ b/modules/sql/pages/index.adoc @@ -2,14 +2,16 @@ :description: Redpanda SQL is an analytical query engine built into Redpanda Cloud that enables real-time SQL analytics directly on your streaming data. :page-layout: index -Redpanda SQL is an OLAP query engine in Redpanda Cloud BYOC clusters. Query your streaming topic data, and the Iceberg history of Iceberg-enabled topics, using a PostgreSQL-compatible SQL dialect, the `psql` client, or any PostgreSQL driver. +Redpanda SQL is an OLAP query engine in Redpanda Cloud BYOC clusters. It surfaces your Redpanda topics as SQL tables and runs analytical queries against streaming data and Iceberg history through a PostgreSQL-compatible dialect. -Use Redpanda SQL to: +Common use cases: -* xref:sql:query-data/query-streaming-topics.adoc[Query streaming topics] in real time. -* xref:sql:query-data/query-iceberg-topics.adoc[Query Iceberg-enabled topics] across live and historical data. -* xref:sql:query-data/query-nested-fields.adoc[Map and query nested schema fields] as typed columns. +* Run real-time analytics on a Redpanda topic without moving data out of Redpanda. +* Combine live streaming data with the Iceberg history of an Iceberg-enabled topic in a single query. +* Map nested schema fields (Protobuf, Avro, JSON) to typed SQL columns for direct querying. -Try the xref:sql:get-started/sql-quickstart.adoc[Redpanda SQL quickstart]. +Get started: -TIP: If you're new to OLAP and analytical SQL, see xref:sql:get-started/oltp-vs-olap.adoc[OLTP vs OLAP] and xref:sql:get-started/redpanda-sql-vs-postgresql.adoc[Redpanda SQL vs PostgreSQL] before you start. +* xref:sql:get-started/overview.adoc[Redpanda SQL overview] — how the engine fits into Redpanda Cloud BYOC. +* xref:sql:get-started/sql-quickstart.adoc[Redpanda SQL quickstart] — connect to a BYOC cluster and run your first query. +* xref:reference:sql/index.adoc[Redpanda SQL reference] — supported SQL syntax, data types, functions, and clauses. From 46b15b600bab2c2c0510c9e411c2754db3b357e0 Mon Sep 17 00:00:00 2001 From: Kat Batuigas Date: Thu, 21 May 2026 18:57:17 -0700 Subject: [PATCH 07/16] Remove index auto page layout --- modules/sql/pages/index.adoc | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/sql/pages/index.adoc b/modules/sql/pages/index.adoc index 0ae376d42..ae093fa27 100644 --- a/modules/sql/pages/index.adoc +++ b/modules/sql/pages/index.adoc @@ -1,6 +1,5 @@ = Redpanda SQL :description: Redpanda SQL is an analytical query engine built into Redpanda Cloud that enables real-time SQL analytics directly on your streaming data. -:page-layout: index Redpanda SQL is an OLAP query engine in Redpanda Cloud BYOC clusters. It surfaces your Redpanda topics as SQL tables and runs analytical queries against streaming data and Iceberg history through a PostgreSQL-compatible dialect. From 788cf05252162e8c5420f3213ecfd75d87c9ab1d Mon Sep 17 00:00:00 2001 From: Kat Batuigas <36839689+kbatuigas@users.noreply.github.com> Date: Fri, 22 May 2026 15:33:17 -0700 Subject: [PATCH 08/16] Apply suggestions from code review Co-authored-by: Michele Cyran --- modules/get-started/pages/whats-new-cloud.adoc | 4 ++-- modules/sql/pages/index.adoc | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/get-started/pages/whats-new-cloud.adoc b/modules/get-started/pages/whats-new-cloud.adoc index f8b2bdf63..2e6ef51dd 100644 --- a/modules/get-started/pages/whats-new-cloud.adoc +++ b/modules/get-started/pages/whats-new-cloud.adoc @@ -8,9 +8,9 @@ This page lists new features added to Redpanda Cloud. == May 2026 -=== Redpanda SQL: GA on AWS BYOC +=== Redpanda SQL -Redpanda SQL is generally available on BYOC clusters running on AWS. Run real-time SQL queries on Redpanda topic data, including the Iceberg history of Iceberg-enabled topics, using standard PostgreSQL syntax. Connect with `psql` or any PostgreSQL driver. See the xref:sql:get-started/sql-quickstart.adoc[quickstart guide] and xref:sql:get-started/overview.adoc[Redpanda SQL Overview]. +Redpanda SQL is available on BYOC clusters running on AWS. Run real-time SQL queries on Redpanda topic data, including the Iceberg history of Iceberg-enabled topics, using standard PostgreSQL syntax. Connect with `psql` or any PostgreSQL driver. See the xref:sql:get-started/sql-quickstart.adoc[quickstart guide] and xref:sql:get-started/overview.adoc[Redpanda SQL Overview]. === Centralized egress for BYOC on AWS: beta diff --git a/modules/sql/pages/index.adoc b/modules/sql/pages/index.adoc index ae093fa27..22a17c910 100644 --- a/modules/sql/pages/index.adoc +++ b/modules/sql/pages/index.adoc @@ -11,6 +11,6 @@ Common use cases: Get started: -* xref:sql:get-started/overview.adoc[Redpanda SQL overview] — how the engine fits into Redpanda Cloud BYOC. -* xref:sql:get-started/sql-quickstart.adoc[Redpanda SQL quickstart] — connect to a BYOC cluster and run your first query. -* xref:reference:sql/index.adoc[Redpanda SQL reference] — supported SQL syntax, data types, functions, and clauses. +* xref:sql:get-started/overview.adoc[Redpanda SQL overview] +* xref:sql:get-started/sql-quickstart.adoc[Redpanda SQL quickstart] +* xref:reference:sql/index.adoc[Redpanda SQL reference] From 0131a3ad278b9cd82a0fe1b6cc327c5c5074a50c Mon Sep 17 00:00:00 2001 From: Kat Batuigas Date: Fri, 22 May 2026 16:24:45 -0700 Subject: [PATCH 09/16] Apply suggestions from review; sweep --- modules/ROOT/nav.adoc | 4 +- .../pages/sql/sql-clauses/group-by.adoc | 8 ++-- .../pages/sql/sql-clauses/having.adoc | 4 +- .../pages/sql/sql-clauses/order-by.adoc | 4 +- .../pages/sql/sql-data-types/array.adoc | 4 +- .../pages/sql/sql-data-types/bool.adoc | 6 +-- .../pages/sql/sql-data-types/date.adoc | 8 ++-- .../pages/sql/sql-data-types/geography.adoc | 34 ++++++++-------- .../pages/sql/sql-data-types/geometry.adoc | 40 +++++++++---------- .../pages/sql/sql-data-types/index.adoc | 8 ++-- .../pages/sql/sql-data-types/interval.adoc | 2 +- .../pages/sql/sql-data-types/json.adoc | 2 +- .../numeric-data-type-aliases.adoc | 24 +++++------ .../sql-data-types/numeric-type/numeric.adoc | 22 +++++----- .../pages/sql/sql-data-types/row.adoc | 6 +-- .../sql/sql-data-types/time-type/time.adoc | 6 +-- .../aggregate-functions/avg.adoc | 20 +++++----- .../aggregate-functions/bool-and.adoc | 14 +++---- .../aggregate-functions/bool-or.adoc | 10 ++--- .../aggregate-functions/count.adoc | 18 ++++----- .../aggregate-functions/distinct.adoc | 24 +++++------ .../aggregate-functions/for-max.adoc | 16 ++++---- .../aggregate-functions/for-min.adoc | 16 ++++---- .../aggregate-functions/max.adoc | 10 ++--- .../aggregate-functions/min.adoc | 10 ++--- .../ordered-set-aggregate-functions/mode.adoc | 4 +- .../percentile-cont.adoc | 4 +- .../percentile-disc.adoc | 8 ++-- .../aggregate-functions/statistics/corr.adoc | 6 +-- .../statistics/covar-pop.adoc | 6 +-- .../statistics/covar-samp.adoc | 6 +-- .../statistics/regr-avgx.adoc | 6 +-- .../statistics/regr-avgy.adoc | 6 +-- .../statistics/regr-count.adoc | 6 +-- .../statistics/regr-intercept.adoc | 6 +-- .../statistics/regr-r2.adoc | 6 +-- .../statistics/regr-slope.adoc | 6 +-- .../statistics/regr-sxx.adoc | 6 +-- .../statistics/regr-sxy.adoc | 6 +-- .../statistics/regr-syy.adoc | 6 +-- .../statistics/stddev-pop.adoc | 6 +-- .../statistics/stddev-samp.adoc | 6 +-- .../statistics/stddev.adoc | 6 +-- .../statistics/var-pop.adoc | 6 +-- .../statistics/var-samp.adoc | 6 +-- .../statistics/variance.adoc | 6 +-- .../aggregate-functions/sum.adoc | 28 ++++++------- .../boolean-functions/if-function.adoc | 8 ++-- .../pages/sql/sql-functions/index.adoc | 16 ++++---- .../sql-functions/json-functions/index.adoc | 8 ++-- .../json-functions/json-array-extract.adoc | 12 +++--- .../json-functions/json-array-length.adoc | 4 +- .../json-extract-path-text.adoc | 12 +++--- .../json-functions/json-extract-path.adoc | 8 ++-- .../sql/sql-functions/math-functions/abs.adoc | 20 +++++----- .../sql-functions/math-functions/cbrt.adoc | 12 +++--- .../sql-functions/math-functions/ceil.adoc | 16 ++++---- .../sql-functions/math-functions/cosh.adoc | 6 +-- .../sql/sql-functions/math-functions/exp.adoc | 18 ++++----- .../sql-functions/math-functions/floor.adoc | 12 +++--- .../math-functions/greatest.adoc | 6 +-- .../sql-functions/math-functions/index.adoc | 30 +++++++------- .../sql-functions/math-functions/least.adoc | 8 ++-- .../sql/sql-functions/math-functions/ln.adoc | 14 +++---- .../sql/sql-functions/math-functions/log.adoc | 18 ++++----- .../sql-functions/math-functions/power.adoc | 16 ++++---- .../sql-functions/math-functions/random.adoc | 10 ++--- .../sql-functions/math-functions/round.adoc | 4 +- .../sql-functions/math-functions/sign.adoc | 18 ++++----- .../sql/sql-functions/math-functions/sin.adoc | 20 +++++----- .../sql-functions/math-functions/sinh.adoc | 4 +- .../sql-functions/math-functions/sqrt.adoc | 24 +++++------ .../math-functions/to-char-from-number.adoc | 2 +- .../other-functions/coalesce.adoc | 24 +++++------ .../other-functions/generate-series.adoc | 10 ++--- .../sql-functions/other-functions/nullif.adoc | 10 ++--- .../string-functions/concat.adoc | 16 ++++---- .../string-functions/ends-with.adoc | 14 +++---- .../sql-functions/string-functions/index.adoc | 24 +++++------ .../string-functions/length.adoc | 12 +++--- .../sql-functions/string-functions/lower.adoc | 12 +++--- .../string-functions/position.adoc | 4 +- .../string-functions/regex/regexp-match.adoc | 12 +++--- .../regex/regexp-replace.adoc | 20 +++++----- .../string-functions/replace.adoc | 20 +++++----- .../string-functions/starts-with.adoc | 14 +++---- .../string-functions/strpos.adoc | 12 +++--- .../string-functions/substr.adoc | 14 +++---- .../string-functions/substring.adoc | 8 ++-- .../sql-functions/string-functions/upper.adoc | 16 ++++---- .../current-timestamp.adoc | 4 +- .../timestamp-functions/date-trunc.adoc | 10 ++--- .../timestamp-functions/extract.adoc | 24 +++++------ .../timestamp-functions/format-timestamp.adoc | 16 ++++---- .../timestamp-functions/index.adoc | 26 ++++++------ .../timestamp-functions/timestamp-micros.adoc | 12 +++--- .../timestamp-functions/timestamp-millis.adoc | 12 +++--- .../timestamp-seconds.adoc | 10 ++--- .../timestamp-functions/timestamp-trunc.adoc | 10 ++--- .../timestamp-functions/to-char.adoc | 8 ++-- .../timestamp-functions/to-timestamp.adoc | 18 ++++----- .../timestamp-functions/unix-micros.adoc | 10 ++--- .../timestamp-functions/unix-millis.adoc | 12 +++--- .../timestamp-functions/unix-seconds.adoc | 12 +++--- .../sql-functions/window-functions/avg.adoc | 6 +-- .../window-functions/bool-and.adoc | 6 +-- .../window-functions/bool-or.adoc | 6 +-- .../sql-functions/window-functions/count.adoc | 6 +-- .../window-functions/cume-dist.adoc | 6 +-- .../window-functions/dense-rank.adoc | 16 ++++---- .../window-functions/first-value.adoc | 6 +-- .../sql-functions/window-functions/lag.adoc | 12 +++--- .../window-functions/last-value.adoc | 6 +-- .../sql-functions/window-functions/lead.adoc | 12 +++--- .../sql-functions/window-functions/max.adoc | 6 +-- .../sql-functions/window-functions/min.adoc | 6 +-- .../window-functions/nth-value.adoc | 6 +-- .../sql-functions/window-functions/ntile.adoc | 6 +-- .../window-functions/percent-rank.adoc | 16 ++++---- .../sql-functions/window-functions/rank.adoc | 14 +++---- .../window-functions/row-number.adoc | 14 +++---- .../sql-functions/window-functions/sum.adoc | 20 +++++----- .../pages/sql/sql-statements/set-show.adoc | 2 +- 123 files changed, 698 insertions(+), 698 deletions(-) diff --git a/modules/ROOT/nav.adoc b/modules/ROOT/nav.adoc index 2d6ea940a..586f9c95d 100644 --- a/modules/ROOT/nav.adoc +++ b/modules/ROOT/nav.adoc @@ -598,8 +598,8 @@ **** xref:reference:sql/sql-data-types/geometry.adoc[] **** xref:reference:sql/sql-data-types/interval.adoc[] **** xref:reference:sql/sql-data-types/json.adoc[] -**** xref:reference:sql/sql-data-types/numeric-type/numeric.adoc[] -**** xref:reference:sql/sql-data-types/numeric-type/numeric-data-type-aliases.adoc[] +**** xref:reference:sql/sql-data-types/numeric-type/numeric.adoc[Numeric] +***** xref:reference:sql/sql-data-types/numeric-type/numeric-data-type-aliases.adoc[] **** xref:reference:sql/sql-data-types/row.adoc[] **** xref:reference:sql/sql-data-types/text.adoc[] **** xref:reference:sql/sql-data-types/time-type/time.adoc[] diff --git a/modules/reference/pages/sql/sql-clauses/group-by.adoc b/modules/reference/pages/sql/sql-clauses/group-by.adoc index 5555d22dc..6ae5de4ac 100644 --- a/modules/reference/pages/sql/sql-clauses/group-by.adoc +++ b/modules/reference/pages/sql/sql-clauses/group-by.adoc @@ -6,7 +6,7 @@ The `GROUP BY` clause returns a group of records from one or more tables that ha [NOTE] ==== -You can use xref:reference:sql/sql-functions/aggregate-functions/index.adoc[aggregate functions] such as `COUNT()`, `MAX()`, `MIN()`, and `SUM()` to perform operations on the grouped values in the `SELECT` statement. +You can use xref:reference:sql/sql-functions/aggregate-functions/index.adoc[aggregate functions] such as `count()`, `max()`, `min()`, and `sum()` to perform operations on the grouped values in the `SELECT` statement. ==== == Syntax @@ -199,7 +199,7 @@ The query returns: === GROUP BY with aggregate functions -This example calculates the total amount each customer has paid for orders using the `SUM()` aggregate function: +This example calculates the total amount each customer has paid for orders using the `sum()` aggregate function: [source,sql] ---- @@ -226,7 +226,7 @@ The query returns: === GROUP BY with JOIN condition -This query joins the `orders` table with the `customer` table and groups customers by name. It uses `COUNT()` to count the number of products each customer has purchased: +This query joins the `orders` table with the `customer` table and groups customers by name. It uses `count()` to count the number of products each customer has purchased: [source,sql] ---- @@ -254,7 +254,7 @@ The query returns: === GROUP BY with date data type -The `order_date` column uses the `DATE` data type. This example groups the order quantity and total price by date using the `DATE()` function: +The `order_date` column uses the `date` data type. This example groups the order quantity and total price by date using the `DATE()` function: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-clauses/having.adoc b/modules/reference/pages/sql/sql-clauses/having.adoc index e5ae50e6c..121a66f40 100644 --- a/modules/reference/pages/sql/sql-clauses/having.adoc +++ b/modules/reference/pages/sql/sql-clauses/having.adoc @@ -29,7 +29,7 @@ This syntax includes the following elements: * `SELECT column_1, column_2,...` selects the columns to display. * `FROM table_name` selects the table to retrieve data from. * `GROUP BY column_name(s)` lists the columns to group. -* `HAVING condition_aggregate_function` provides the condition for filtering rows formed by the `GROUP BY` clause. The condition can use an aggregate function such as `SUM()`, `COUNT()`, or `MIN()`. +* `HAVING condition_aggregate_function` provides the condition for filtering rows formed by the `GROUP BY` clause. The condition can use an aggregate function such as `sum()`, `count()`, or `min()`. == Examples @@ -140,7 +140,7 @@ This returns: === HAVING clause with AVG function -The following example uses the `AVG` aggregate function to filter subjects with an average score greater than 80: +The following example uses the `avg` aggregate function to filter subjects with an average score greater than 80: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-clauses/order-by.adoc b/modules/reference/pages/sql/sql-clauses/order-by.adoc index 0305d3f97..7b5b994e4 100644 --- a/modules/reference/pages/sql/sql-clauses/order-by.adoc +++ b/modules/reference/pages/sql/sql-clauses/order-by.adoc @@ -169,7 +169,7 @@ The query returns: === ORDER BY with TEXT data types -In this example, two small tables are created with `TEXT` data: +In this example, two small tables are created with `text` data: [source,sql] ---- @@ -228,7 +228,7 @@ VALUES (INTERVAL '2 months 1 hours'); ---- -`ORDER BY` on an `INTERVAL` column sorts values by their total duration. For example, `1 month 30 days 20 hours` is greater than `2 months 1 hour` because `1 month` equals `30 days`, making the first interval equivalent to `60 days 20 hours` versus `60 days 1 hour`. +`ORDER BY` on an `interval` column sorts values by their total duration. For example, `1 month 30 days 20 hours` is greater than `2 months 1 hour` because `1 month` equals `30 days`, making the first interval equivalent to `60 days 20 hours` versus `60 days 1 hour`. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-data-types/array.adoc b/modules/reference/pages/sql/sql-data-types/array.adoc index 3d0b51f31..bd68b1a10 100644 --- a/modules/reference/pages/sql/sql-data-types/array.adoc +++ b/modules/reference/pages/sql/sql-data-types/array.adoc @@ -21,7 +21,7 @@ CREATE TABLE movie_night ( ); ---- -This syntax specifies the size of the array. However, it does not enforce any limits, and the behavior is the same as for arrays of unspecified length. There is also another way to declare an array, by prepending the `ARRAY` keyword after the data type of the elements: +This syntax specifies the size of the array. However, it does not enforce any limits, and the behavior is the same as for arrays of unspecified length. There is also another way to declare an array, by prepending the `array` keyword after the data type of the elements: [source,sql] ---- @@ -33,7 +33,7 @@ CREATE TABLE movie_night ( == Array values -You can create array literals by using the `ARRAY` keyword and combining it with the array's values enclosed in square brackets and separated by commas: +You can create array literals by using the `array` keyword and combining it with the array's values enclosed in square brackets and separated by commas: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-data-types/bool.adoc b/modules/reference/pages/sql/sql-data-types/bool.adoc index ba99286a5..40bee9cc5 100644 --- a/modules/reference/pages/sql/sql-data-types/bool.adoc +++ b/modules/reference/pages/sql/sql-data-types/bool.adoc @@ -1,14 +1,14 @@ = bool -:description: BOOL is a data type for expressions that return one of two possible values: true or false. +:description: `bool` is a data type for expressions that return one of two possible values: true or false. :page-topic-type: reference == Overview -A `BOOL` is a data type for expressions that return one of two possible values: `true` or `false`. +A `bool` is a data type for expressions that return one of two possible values: `true` or `false`. [WARNING] ==== -`BOOLEAN` is an alias for the `BOOL` data type. You can create a table using `BOOLEAN`, but Redpanda SQL stores and processes the values as `BOOL`. +`BOOLEAN` is an alias for the `bool` data type. You can create a table using `BOOLEAN`, but Redpanda SQL stores and processes the values as `bool`. ==== == Format diff --git a/modules/reference/pages/sql/sql-data-types/date.adoc b/modules/reference/pages/sql/sql-data-types/date.adoc index 7612ed220..57dc9af15 100644 --- a/modules/reference/pages/sql/sql-data-types/date.adoc +++ b/modules/reference/pages/sql/sql-data-types/date.adoc @@ -1,8 +1,8 @@ = date -:description: The DATE data type stores calendar dates without a time zone in Redpanda SQL. +:description: The `date` data type stores calendar dates without a time zone in Redpanda SQL. :page-topic-type: reference -The `DATE` data type stores calendar dates without a time zone. Use it to store and insert date values. +The `date` data type stores calendar dates without a time zone. Use it to store and insert date values. [NOTE] ==== @@ -22,7 +22,7 @@ YYYY-MM-DD == Examples -In this example, the `emp_submission` table consists of the candidate ID, candidate name, the submitted department, and a submission date with a `DATE` data type. +In this example, the `emp_submission` table consists of the candidate ID, candidate name, the submitted department, and a submission date with a `date` data type. [source,sql] ---- @@ -51,7 +51,7 @@ Now that the data has been inserted, execute the following `SELECT` statement: SELECT * FROM emp_submission; ---- -The following is the result of the `SELECT` statement where the values in the `sub_date` column have `DATE` data type: +The following is the result of the `SELECT` statement where the values in the `sub_date` column have `date` data type: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-data-types/geography.adoc b/modules/reference/pages/sql/sql-data-types/geography.adoc index 7c9cf88bc..1d0d3368c 100644 --- a/modules/reference/pages/sql/sql-data-types/geography.adoc +++ b/modules/reference/pages/sql/sql-data-types/geography.adoc @@ -1,8 +1,8 @@ = geography -:description: The GEOGRAPHY data type stores geodetic (spherical) spatial point values using the WGS84 coordinate system (SRID 4326). +:description: The `geography` data type stores geodetic (spherical) spatial point values using the WGS84 coordinate system (SRID 4326). :page-topic-type: reference -The `GEOGRAPHY` data type stores geodetic (spherical) spatial point values using the WGS84 coordinate system (SRID 4326). Unlike xref:reference:sql/sql-data-types/geometry.adoc[GEOMETRY], which uses planar coordinates, `GEOGRAPHY` interprets coordinates as longitude and latitude on the Earth's surface, and distance calculations return results in meters. +The `geography` data type stores geodetic (spherical) spatial point values using the WGS84 coordinate system (SRID 4326). Unlike xref:reference:sql/sql-data-types/geometry.adoc[`geometry`], which uses planar coordinates, `geography` interprets coordinates as longitude and latitude on the Earth's surface, and distance calculations return results in meters. [NOTE] ==== @@ -11,7 +11,7 @@ Redpanda SQL supports only `POINT` geographies. Multi-part geometries such as `P == Format -`GEOGRAPHY` values can be specified in the following formats: +`geography` values can be specified in the following formats: * WKT: `POINT(longitude latitude)` (SRID defaults to 4326) * EWKT: `SRID=4326;POINT(longitude latitude)` @@ -24,35 +24,35 @@ SELECT GEOGRAPHY 'POINT(-73.9857 40.7484)'; == SRID handling -`GEOGRAPHY` always uses SRID 4326 (WGS84). If you specify a different SRID, an error is returned. +`geography` always uses SRID 4326 (WGS84). If you specify a different SRID, an error is returned. == Casting -`GEOGRAPHY` supports the following casts: +`geography` supports the following casts: -* `GEOGRAPHY` -> `TEXT`: Returns EWKB hex string -* `TEXT` -> `GEOGRAPHY`: Parses WKT or EWKB string -* `GEOGRAPHY` -> `GEOMETRY`: Removes SRID -* `GEOMETRY` -> `GEOGRAPHY`: Adds SRID=4326 +* `geography` -> `text`: Returns EWKB hex string +* `text` -> `geography`: Parses WKT or EWKB string +* `geography` -> `geometry`: Removes SRID +* `geometry` -> `geography`: Adds SRID=4326 [NOTE] ==== -Casting between `GEOGRAPHY` and `POINT` is not supported. +Casting between `geography` and `point` is not supported. ==== == Functions -The following functions work with `GEOGRAPHY` values: +The following functions work with `geography` values: [cols="2,3,1",options="header"] |=== |Function |Description |Return type -|`ST_ASTEXT(geography)` |Returns the WKT representation |`text` -|`ST_ASTEXT(geography, max_digits)` |Returns the WKT representation with limited decimal digits |`text` -|`ST_ASEWKT(geography)` |Returns the Extended WKT representation (includes SRID) |`text` -|`ST_ASEWKT(geography, max_digits)` |Returns the Extended WKT representation with limited decimal digits |`text` -|`ST_DISTANCE(geography, geography)` |Returns the geodetic distance in meters using the WGS84 ellipsoid |`double precision` -|`ST_DISTANCE(geography, geography, use_spheroid)` |Returns the geodetic distance in meters. Set `use_spheroid` to `false` for a faster spherical approximation. |`double precision` +|`st_astext(geography)` |Returns the WKT representation |`text` +|`st_astext(geography, max_digits)` |Returns the WKT representation with limited decimal digits |`text` +|`st_asewkt(geography)` |Returns the Extended WKT representation (includes SRID) |`text` +|`st_asewkt(geography, max_digits)` |Returns the Extended WKT representation with limited decimal digits |`text` +|`st_distance(geography, geography)` |Returns the geodetic distance in meters using the WGS84 ellipsoid |`double precision` +|`st_distance(geography, geography, use_spheroid)` |Returns the geodetic distance in meters. Set `use_spheroid` to `false` for a faster spherical approximation. |`double precision` |=== == Examples diff --git a/modules/reference/pages/sql/sql-data-types/geometry.adoc b/modules/reference/pages/sql/sql-data-types/geometry.adoc index 63c85215c..2962c91c1 100644 --- a/modules/reference/pages/sql/sql-data-types/geometry.adoc +++ b/modules/reference/pages/sql/sql-data-types/geometry.adoc @@ -1,8 +1,8 @@ = geometry -:description: The GEOMETRY data type stores planar (Cartesian) spatial point values as two double-precision coordinates. +:description: The `geometry` data type stores planar (Cartesian) spatial point values as two double-precision coordinates. :page-topic-type: reference -The `GEOMETRY` data type stores planar (Cartesian) spatial point values as two double-precision coordinates. It uses https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry[Well-Known Text (WKT)^] and https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary[Well-Known Binary (WKB)^] formats for input and output. +The `geometry` data type stores planar (Cartesian) spatial point values as two double-precision coordinates. It uses https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry[Well-Known Text (WKT)^] and https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary[Well-Known Binary (WKB)^] formats for input and output. [NOTE] ==== @@ -11,10 +11,10 @@ Redpanda SQL supports only `POINT` geometries. Multi-part geometries such as `PO == Format -`GEOMETRY` values can be specified in the following formats: +`geometry` values can be specified in the following formats: * WKT: `POINT(x y)` (space-separated coordinates) -* EWKT: `SRID=4326;POINT(x y)` (SRID is accepted but ignored for `GEOMETRY`) +* EWKT: `SRID=4326;POINT(x y)` (SRID is accepted but ignored for `geometry`) * EWKB: A hex-encoded binary string (42 hex characters) [source,sql] @@ -22,39 +22,39 @@ Redpanda SQL supports only `POINT` geometries. Multi-part geometries such as `PO SELECT GEOMETRY 'POINT(0.1234 5.6789)'; ---- -== Differences between GEOMETRY and GEOGRAPHY +== Differences between `geometry` and `geography` [cols="1,1",options="header"] |=== -|GEOMETRY |GEOGRAPHY +|`geometry` |`geography` |Uses a Cartesian (planar) coordinate system |Uses a geodetic (spherical) coordinate system |SRID is ignored |SRID is always 4326 (WGS84) -|`ST_DISTANCE` returns Euclidean distance |`ST_DISTANCE` returns distance in meters +|`st_distance` returns Euclidean distance |`st_distance` returns distance in meters |=== == Casting -`GEOMETRY` supports the following casts: +`geometry` supports the following casts: -* `GEOMETRY` -> `TEXT`: Returns WKB hex string -* `TEXT` -> `GEOMETRY`: Parses WKT or EWKB string -* `GEOMETRY` -> `GEOGRAPHY`: Adds SRID=4326 -* `GEOGRAPHY` -> `GEOMETRY`: Removes SRID -* `GEOMETRY` -> `POINT`: Converts to `(x,y)` format -* `POINT` -> `GEOMETRY`: Converts to WKB format +* `geometry` -> `text`: Returns WKB hex string +* `text` -> `geometry`: Parses WKT or EWKB string +* `geometry` -> `geography`: Adds SRID=4326 +* `geography` -> `geometry`: Removes SRID +* `geometry` -> `point`: Converts to `(x,y)` format +* `point` -> `geometry`: Converts to WKB format == Functions -The following functions work with `GEOMETRY` values: +The following functions work with `geometry` values: [cols="1,2,1",options="header"] |=== |Function |Description |Return type -|`ST_ASTEXT(geometry)` |Returns the WKT representation of the geometry |`text` -|`ST_ASTEXT(geometry, max_digits)` |Returns the WKT representation with limited decimal digits |`text` -|`ST_ASEWKT(geometry)` |Returns the Extended WKT representation |`text` -|`ST_ASEWKT(geometry, max_digits)` |Returns the Extended WKT representation with limited decimal digits |`text` -|`ST_DISTANCE(geometry, geometry)` |Returns the Euclidean distance between two geometry points |`double precision` +|`st_astext(geometry)` |Returns the WKT representation of the geometry |`text` +|`st_astext(geometry, max_digits)` |Returns the WKT representation with limited decimal digits |`text` +|`st_asewkt(geometry)` |Returns the Extended WKT representation |`text` +|`st_asewkt(geometry, max_digits)` |Returns the Extended WKT representation with limited decimal digits |`text` +|`st_distance(geometry, geometry)` |Returns the Euclidean distance between two `geometry` points |`double precision` |=== == Examples diff --git a/modules/reference/pages/sql/sql-data-types/index.adoc b/modules/reference/pages/sql/sql-data-types/index.adoc index e40037643..00c572f69 100644 --- a/modules/reference/pages/sql/sql-data-types/index.adoc +++ b/modules/reference/pages/sql/sql-data-types/index.adoc @@ -24,16 +24,16 @@ The following table summarizes the data types supported by Redpanda SQL: |xref:reference:sql/sql-data-types/json.adoc[`json`] |A value in JSON standard format |`variable_name JSON` |xref:reference:sql/sql-data-types/array.adoc[`array`] |An array of a specific data type |`'{value1, value2, value3}'::data_type[]` |xref:reference:sql/sql-data-types/row.adoc[`row`] |A composite value containing fields of different types |`ROW(value1, value2, ...)` -|xref:reference:sql/sql-data-types/geometry.adoc[GEOMETRY] |A spatial data type for planar (Cartesian) point values |`GEOMETRY 'POINT(x y)'` -|xref:reference:sql/sql-data-types/geography.adoc[GEOGRAPHY] |A spatial data type for geodetic (spherical) point values using WGS84 |`GEOGRAPHY 'POINT(lon lat)'` +|xref:reference:sql/sql-data-types/geometry.adoc[`geometry`] |A spatial data type for planar (Cartesian) point values |`GEOMETRY 'POINT(x y)'` +|xref:reference:sql/sql-data-types/geography.adoc[`geography`] |A spatial data type for geodetic (spherical) point values using WGS84 |`GEOGRAPHY 'POINT(lon lat)'` |=== [WARNING] ==== -When performing operations on numeric or temporal types, overflows can lead to undefined behavior, resulting in unexpected values or errors. Ensure input values are within the allowed range for each numeric type to prevent overflows. This can occur during arithmetic operations or function execution (for example, `AVG()`), where the result does not fit the result type. Using larger data types such as `BIGINT` can help mitigate overflow risks. +When performing operations on numeric or temporal types, overflows can lead to undefined behavior, resulting in unexpected values or errors. Ensure input values are within the allowed range for each numeric type to prevent overflows. This can occur during arithmetic operations or function execution (for example, `avg()`), where the result does not fit the result type. Using larger data types such as `bigint` can help mitigate overflow risks. ==== [NOTE] ==== -Explicit casting between types can cause data loss due to altered precision or magnitude, such as truncating fractional seconds in `TIME` or silently clipping out-of-range values. Verify input ranges to prevent unintended data loss. +Explicit casting between types can cause data loss due to altered precision or magnitude, such as truncating fractional seconds in `time` or silently clipping out-of-range values. Verify input ranges to prevent unintended data loss. ==== diff --git a/modules/reference/pages/sql/sql-data-types/interval.adoc b/modules/reference/pages/sql/sql-data-types/interval.adoc index 513a60cb7..e9f7053b2 100644 --- a/modules/reference/pages/sql/sql-data-types/interval.adoc +++ b/modules/reference/pages/sql/sql-data-types/interval.adoc @@ -145,7 +145,7 @@ SELECT INTERVAL '2-4 5 DAYS 04:05:06.070809' YEAR TO MONTH as "Interval"; === Extract data from interval -To extract interval numbers from a timestamp, use the `EXTRACT()` function: +To extract interval numbers from a timestamp, use the `extract()` function: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-data-types/json.adoc b/modules/reference/pages/sql/sql-data-types/json.adoc index eec6d5443..c8eb31478 100644 --- a/modules/reference/pages/sql/sql-data-types/json.adoc +++ b/modules/reference/pages/sql/sql-data-types/json.adoc @@ -1,5 +1,5 @@ = json -:description: JSON stands for JavaScript Object Notation. +:description: The `json` data type stores values in JSON, an open standard format for key-value data. :page-topic-type: reference == Overview diff --git a/modules/reference/pages/sql/sql-data-types/numeric-type/numeric-data-type-aliases.adoc b/modules/reference/pages/sql/sql-data-types/numeric-type/numeric-data-type-aliases.adoc index 360e5c795..791d3aa38 100644 --- a/modules/reference/pages/sql/sql-data-types/numeric-type/numeric-data-type-aliases.adoc +++ b/modules/reference/pages/sql/sql-data-types/numeric-type/numeric-data-type-aliases.adoc @@ -6,9 +6,9 @@ Redpanda SQL accepts aliases that you can use interchangeably with the primary d The following sections describe the numeric data type aliases: -== INTEGER alias +== `integer` alias -The `INTEGER` alias is an alternative name for the `INT` data type. For example, the following two queries are functionally the same: +The `integer` alias is an alternative name for the `int` data type. For example, the following two queries are functionally the same: [source,sql] ---- @@ -24,12 +24,12 @@ CREATE TABLE AnotherTable ( [NOTE] ==== -Even though you write `INTEGER`, Redpanda SQL stores and treats the data as `INT`. +Even though you specify the `integer` alias in DDL, Redpanda SQL stores and treats the data as `int`. ==== -== LONG alias +== `long` alias -The `LONG` alias is often used to represent larger integer values. For example: +The `long` alias is often used to represent larger integer values. For example: [source,sql] ---- @@ -45,12 +45,12 @@ CREATE TABLE LargeValuesEquivalent ( [NOTE] ==== -Any usage of `LONG` is stored and treated as `BIGINT`. +Even though you specify the `long` alias in DDL, Redpanda SQL stores and treats the data as `bigint`. ==== -== FLOAT alias +== `float` alias -The `FLOAT` alias corresponds to the `REAL` data type. For example: +The `float` alias corresponds to the `real` data type. For example: [source,sql] ---- @@ -66,12 +66,12 @@ CREATE TABLE FloatEquivalent ( [NOTE] ==== -When you use `FLOAT`, it's stored and treated as `REAL`. +Even though you specify the `float` alias in DDL, Redpanda SQL stores and treats the data as `real`. ==== -== DOUBLE alias +== `double` alias -The `DOUBLE` alias defines `DOUBLE PRECISION` floating-point numbers. For example: +The `double` alias defines `double precision` floating-point numbers. For example: [source,sql] ---- @@ -87,5 +87,5 @@ CREATE TABLE DoubleEquivalent ( [NOTE] ==== -When you use `DOUBLE`, it's stored and treated as `DOUBLE PRECISION`. +Even though you specify the `double` alias in DDL, Redpanda SQL stores and treats the data as `double precision`. ==== diff --git a/modules/reference/pages/sql/sql-data-types/numeric-type/numeric.adoc b/modules/reference/pages/sql/sql-data-types/numeric-type/numeric.adoc index 07ea72a30..3607a7dbb 100644 --- a/modules/reference/pages/sql/sql-data-types/numeric-type/numeric.adoc +++ b/modules/reference/pages/sql/sql-data-types/numeric-type/numeric.adoc @@ -1,10 +1,10 @@ -= numeric -:description: The INT data type represents whole numbers without decimal points. += Numeric Types +:description: Reference for numeric data types in Redpanda SQL. :page-topic-type: reference == Int type -The `INT` data type represents whole numbers without decimal points. It is a 32-bit signed integer with a range from -2147483648 to 2147483647. +The `int` data type represents whole numbers without decimal points. It is a 32-bit signed integer with a range from -2147483648 to 2147483647. === Format @@ -15,7 +15,7 @@ column_name INT === Example -The following is an example of how to create a column using an `INT` type. +The following is an example of how to create a column using an `int` type. [source,sql] ---- @@ -54,7 +54,7 @@ This returns the following result. == Bigint type -The `BIGINT` data type stores large whole numbers that exceed the `INT` range. It is a 64-bit signed integer with a range from -9223372036854775808 to 9223372036854775807. +The `bigint` data type stores large whole numbers that exceed the `int` range. It is a 64-bit signed integer with a range from -9223372036854775808 to 9223372036854775807. === Format @@ -65,7 +65,7 @@ column_name BIGINT === Example -The following is an example of how to create a column using the `BIGINT` type: +The following is an example of how to create a column using the `bigint` type: [source,sql] ---- @@ -103,7 +103,7 @@ The query returns the following output: == Real type -The `REAL` data type is a 32-bit floating-point number compliant with the IEEE 754 binary32 format. +The `real` data type is a 32-bit floating-point number compliant with the IEEE 754 binary32 format. === Format @@ -116,7 +116,7 @@ column_name REAL ==== Create a table -The following example creates a table with a `REAL` column type. +The following example creates a table with a `real` column type. [source,sql] ---- @@ -178,7 +178,7 @@ The following output shows the value after rounding. ==== Create a table with numbers exceeding the range -The `REAL` type only stores 32-bit floating-point numbers. In this example, the input numbers exceed the range. +The `real` type only stores 32-bit floating-point numbers. In this example, the input numbers exceed the range. [source,sql] ---- @@ -209,7 +209,7 @@ The final output will only return numbers that match the range. == Double precision type -The `DOUBLE PRECISION` data type is a 64-bit floating-point number compliant with the IEEE 754 binary64 format. +The `double precision` data type is a 64-bit floating-point number compliant with the IEEE 754 binary64 format. === Format @@ -222,7 +222,7 @@ column_name DOUBLE PRECISION ==== Create a table -The following example creates a table with a `DOUBLE PRECISION` type column. +The following example creates a table with a `double precision` type column. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-data-types/row.adoc b/modules/reference/pages/sql/sql-data-types/row.adoc index ec7dd1415..95e48e305 100644 --- a/modules/reference/pages/sql/sql-data-types/row.adoc +++ b/modules/reference/pages/sql/sql-data-types/row.adoc @@ -1,8 +1,8 @@ = row -:description: The ROW data type represents a composite value containing one or more fields of different types. +:description: The `row` data type represents a composite value containing one or more fields of different types. :page-topic-type: reference -The `ROW` data type represents a composite value (also known as a struct or record) containing one or more fields of different types. `ROW` values support field access, lexicographic comparison, NULL checks, conversion to text, and use in `GROUP BY`, `ORDER BY`, and `JOIN` clauses. +The `row` data type represents a composite value (also known as a struct or record) containing one or more fields of different types. `row` values support field access, lexicographic comparison, `NULL` checks, conversion to text, and use in `GROUP BY`, `ORDER BY`, and `JOIN` clauses. == Syntax @@ -12,7 +12,7 @@ ROW(expression [, ...]) (expression, expression [, ...]) ---- -The explicit `ROW` keyword is required for single-element composites. For two or more elements, the `ROW` keyword is optional and the parenthesized list is treated as an implicit tuple. +The explicit `row` keyword is required for single-element composites. For two or more elements, the `row` keyword is optional and the parenthesized list is treated as an implicit tuple. == Examples diff --git a/modules/reference/pages/sql/sql-data-types/time-type/time.adoc b/modules/reference/pages/sql/sql-data-types/time-type/time.adoc index 1bc250d4e..eeca03e27 100644 --- a/modules/reference/pages/sql/sql-data-types/time-type/time.adoc +++ b/modules/reference/pages/sql/sql-data-types/time-type/time.adoc @@ -1,8 +1,8 @@ = time -:description: The TIME data type in Redpanda SQL stores time values without any date information. +:description: The `time` data type in Redpanda SQL stores time values without any date information. :page-topic-type: reference -The `TIME` data type in Redpanda SQL stores time values without any date information. It represents a specific time of day, independent of any time zone or date. +The `time` data type in Redpanda SQL stores time values without any date information. It represents a specific time of day, independent of any time zone or date. == Format @@ -22,7 +22,7 @@ HH:MM:SS[.SSSSSS] === Create a schedule table -The following example creates a table to manage employee schedules, containing their names and the time they are scheduled to start work. The `start_time` column uses the `TIME` data type. +The following example creates a table to manage employee schedules, containing their names and the time they are scheduled to start work. The `start_time` column uses the `time` data type. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/avg.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/avg.adoc index 7865b3f07..9dad01d67 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/avg.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/avg.adoc @@ -1,16 +1,16 @@ = avg -:description: The AVG() function calculates the average value of records. +:description: The `avg()` function calculates the average value of records. :page-topic-type: reference -The `AVG()` function calculates the average value of records. The supported input and return types are listed in the following table: +The `avg()` function calculates the average value of records. The supported input and return types are listed in the following table: [cols=",",options="header",] |=== |Input type |Return type -|`INTEGER` |`DOUBLE PRECISION` -|`BIGINT` |`DOUBLE PRECISION` -|`REAL` |`DOUBLE PRECISION` -|`DOUBLE PRECISION` |`DOUBLE PRECISION` +|`integer` |`double precision` +|`bigint` |`double precision` +|`real` |`double precision` +|`double precision` |`double precision` |=== [NOTE] @@ -72,7 +72,7 @@ This query shows the following table: +----------+-----------+---------------+-------------+ ---- -=== AVG() with a single expression +=== `avg()` with a single expression The first example calculates the average amount of all orders that customers have paid: @@ -93,12 +93,12 @@ This returns the following output: +---------------------+ ---- -=== AVG() with a GROUP BY clause +=== `avg()` with a GROUP BY clause -The following example uses the `AVG()` function and `GROUP BY` clause to calculate the average amount paid by each customer: +The following example uses the `avg()` function and `GROUP BY` clause to calculate the average amount paid by each customer: * First, the `GROUP BY` clause divides orders into groups based on customers -* Then, the `AVG` function is applied to each group. +* Then, the `avg` function is applied to each group. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/bool-and.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/bool-and.adoc index ebd6445c3..40f640b51 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/bool-and.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/bool-and.adoc @@ -1,13 +1,13 @@ = bool_and -:description: The BOOL_AND() function calculates all the boolean values in the aggregated group, which will have these results: +:description: The `bool_and()` function calculates all the boolean values in the aggregated group, which will have these results: :page-topic-type: reference -The `BOOL_AND()` function calculates all the boolean values in the aggregated group, which will have these results: +The `bool_and()` function calculates all the boolean values in the aggregated group, which will have these results: * `true` if all the values are `true` for every row. * `false` if at least one row in the group is `false`. -The input and the return type must be in `BOOL`. +The input and the return type must be in `bool`. [NOTE] ==== @@ -68,7 +68,7 @@ This query shows the following table: +----------+-----------+---------------+-------------+-------+ ---- -=== `BOOL_AND` with a false result +=== `bool_and` with a false result To find out if all customers have paid for their orders, run the query: @@ -77,7 +77,7 @@ To find out if all customers have paid for their orders, run the query: SELECT BOOL_AND(paid) AS "final_result" FROM payment; ---- -In the `BOOL_AND` function, if there is at least one `FALSE` value, the overall result is `FALSE`. The output shows that there is an order that hasn't been paid. +In the `bool_and` function, if there is at least one `FALSE` value, the overall result is `FALSE`. The output shows that there is an order that hasn't been paid. [source,sql] ---- @@ -88,7 +88,7 @@ In the `BOOL_AND` function, if there is at least one `FALSE` value, the overall +--------------+ ---- -=== `BOOL_AND` with a true result +=== `bool_and` with a true result To find out if Maya has paid for her orders, run the query: @@ -99,7 +99,7 @@ FROM payment WHERE custname ='Maya'; ---- -In the `BOOL_AND` function, if all values are `TRUE`, then the overall result is `TRUE`. The output shows that Maya has paid all her orders. +In the `bool_and` function, if all values are `TRUE`, then the overall result is `TRUE`. The output shows that Maya has paid all her orders. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/bool-or.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/bool-or.adoc index bc5668c55..75e36beb2 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/bool-or.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/bool-or.adoc @@ -1,13 +1,13 @@ = bool_or -:description: The BOOL_OR() function calculates all the boolean values in the aggregated group, which will have these results: +:description: The `bool_or()` function calculates all the boolean values in the aggregated group, which will have these results: :page-topic-type: reference -The `BOOL_OR()` function calculates all the boolean values in the aggregated group, which will have these results: +The `bool_or()` function calculates all the boolean values in the aggregated group, which will have these results: * `false` if all the values are `false` for every row. * `true` if at least one row in the group is true. -The input and the return type must be in `BOOL`. +The input and the return type must be in `bool`. [NOTE] ==== @@ -68,7 +68,7 @@ This query shows the following table: +----------+-----------+---------------+-------------+--------+ ---- -=== `BOOL_OR` with a true result +=== `bool_or` with a true result To find out if all customers have paid for their orders, run the query: @@ -88,7 +88,7 @@ If there is at least one `TRUE` value, the overall result is `TRUE`. The output +--------------+ ---- -=== `BOOL_OR` with a false result +=== `bool_or` with a false result To find out if Aaron has paid for his orders, run the query: diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/count.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/count.adoc index 4e09df5fa..e0a673af4 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/count.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/count.adoc @@ -1,8 +1,8 @@ = count -:description: The COUNT() function retrieves the number of records that match a specific condition. +:description: The `count()` function retrieves the number of records that match a specific condition. :page-topic-type: reference -The `COUNT()` function retrieves the number of records that match a specific condition. It works with any data type supported by Redpanda SQL and returns a `BIGINT`. +The `count()` function retrieves the number of records that match a specific condition. It works with any data type supported by Redpanda SQL and returns a `bigint`. [NOTE] ==== @@ -62,7 +62,7 @@ This query shows the following table: +----------+-----------+---------------+-------------+ ---- -=== `COUNT()` with a single expression +=== `count()` with a single expression This example returns the number of all orders in the orders table: @@ -82,12 +82,12 @@ The query returns: +-------+ ---- -=== `COUNT()` with a `GROUP BY` clause +=== `count()` with a `GROUP BY` clause -This example will combine the `COUNT()` function and the `GROUP BY` clause. +This example will combine the `count()` function and the `GROUP BY` clause. * The `GROUP BY` clause groups the orders based on the customer's name. -* The `COUNT()` function counts the orders for each customer. +* The `count()` function counts the orders for each customer. [source,sql] ---- @@ -110,9 +110,9 @@ The query returns: +-----------+--------+ ---- -=== `COUNT()` with a `HAVING` clause +=== `count()` with a `HAVING` clause -This example combines the `COUNT()` function and the `HAVING` clause to apply a specific condition to find customers who have made more than two orders: +This example combines the `count()` function and the `HAVING` clause to apply a specific condition to find customers who have made more than two orders: [source,sql] ---- @@ -124,7 +124,7 @@ HAVING COUNT (orderid) > 2; * The `GROUP BY` clause groups the orders based on the customer's name. * The `HAVING` clause will filter only customers with more than two order IDs. -* The `COUNT()` function counts the orders for each customer. +* The `count()` function counts the orders for each customer. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/distinct.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/distinct.adoc index a600cf9a5..5c6707d84 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/distinct.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/distinct.adoc @@ -1,4 +1,4 @@ -= distinct += DISTINCT :description: When using aggregation functions, they can contain the DISTINCT keyword. :page-topic-type: reference @@ -11,11 +11,11 @@ aggregation function (DISTINCT expression [clause] ...) ... `DISTINCT` keyword can be combined with the following aggregate functions: -* `AVG()` -* `COUNT()` -* `MAX()` -* `MIN()` -* `SUM()` +* `avg()` +* `count()` +* `max()` +* `min()` +* `sum()` All functions listed in this section operate on the same input and return types, that are supported by their counterparts without any qualifiers. They can be grouped without any limitations, provided that they utilise a single `DISTINCT` keyword. @@ -98,9 +98,9 @@ SELECT * FROM rental; +------------+---------------------+---------------------+-----------+---------------+-------------+ ---- -=== `DISTINCT` combined with `COUNT` function +=== `DISTINCT` combined with `count` function -The following example uses `DISTINCT` qualifier combined with `COUNT()` function to calculate the number of unique car brands in rentals: +The following example uses `DISTINCT` qualifier combined with `count()` function to calculate the number of unique car brands in rentals: [source,sql] ---- @@ -119,7 +119,7 @@ This returns the following output: +----------------------+ ---- -This example uses the `DISTINCT` qualifier combined with `COUNT()` function to calculate the number of rentals by each customer: +This example uses the `DISTINCT` qualifier combined with `count()` function to calculate the number of rentals by each customer: [source,sql] ---- @@ -145,9 +145,9 @@ This calculates the `rental_count` by each `customer_name`: +----------------+--------------+ ---- -=== `DISTINCT` combined with `MAX()` function +=== `DISTINCT` combined with `max()` function -The following example uses `DISTINCT` qualifier combined with `MAX()` function to find maximum single spending per each customer, dropping any repeated transactions: +The following example uses `DISTINCT` qualifier combined with `max()` function to find maximum single spending per each customer, dropping any repeated transactions: [source,sql] ---- @@ -174,7 +174,7 @@ The query returns: +---------------+--------------+ ---- -=== `DISTINCT` combined with `SUM()` function +=== `DISTINCT` combined with `sum()` function The following example compares the sum of unique revenues versus the sum of all revenues in rental data: diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/for-max.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/for-max.adoc index 40a41aedf..6d120727e 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/for-max.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/for-max.adoc @@ -1,8 +1,8 @@ = for_max -:description: The FOR_MAX() function searches for a maximum in a specific column and returns a value related to that maximum from another column. +:description: The `for_max()` function searches for a maximum in a specific column and returns a value related to that maximum from another column. :page-topic-type: reference -The `FOR_MAX()` function searches for a maximum in a specific column and returns a value related to that maximum from another column. +The `for_max()` function searches for a maximum in a specific column and returns a value related to that maximum from another column. == Syntax @@ -13,10 +13,10 @@ FOR_MAX(metric, value) == Arguments -* `metric`: Must be one of the following data types: `INT`, `LONG`, `FLOAT`, `DOUBLE`, `DATE` or `TIMESTAMP`. -* `value`: Can be any data type except `TEXT`. +* `metric`: Must be one of the following data types: `int`, `long`, `float`, `double`, `date` or `timestamp`. +* `value`: Can be any data type except `text`. -The `FOR_MAX()` function returns `NULL` in the following situations: +The `for_max()` function returns `NULL` in the following situations: * There are no input rows * The `metric` column contains only `NULL` values @@ -69,7 +69,7 @@ SELECT * FROM payments; +-----------+---------------+--------+----------+ ---- -=== `FOR_MAX()` basic usage +=== `for_max()` basic usage To determine the price associated with the highest discount, run the code: @@ -90,9 +90,9 @@ The query returns the following output: +---------------------+ ---- -=== `FOR_MAX()` with `GROUP BY` clause +=== `for_max()` with `GROUP BY` clause -This example uses a `GROUP BY` clause to group customers and then uses the `FOR_MAX()` function to get a discount for the highest price paid by each customer: +This example uses a `GROUP BY` clause to group customers and then uses the `for_max()` function to get a discount for the highest price paid by each customer: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/for-min.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/for-min.adoc index 349e96e26..98a7a5e1c 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/for-min.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/for-min.adoc @@ -1,8 +1,8 @@ = for_min -:description: The FOR_MIN() function searches for a minimum in a specific column and returns a value related to that minimum from another column. +:description: The `for_min()` function searches for a minimum in a specific column and returns a value related to that minimum from another column. :page-topic-type: reference -The `FOR_MIN()` function searches for a minimum in a specific column and returns a value related to that minimum from another column. +The `for_min()` function searches for a minimum in a specific column and returns a value related to that minimum from another column. == Syntax @@ -13,10 +13,10 @@ FOR_MIN(metric, value) == Arguments -* `metric`: Must be one of the following data types: `INT`, `LONG`, `FLOAT`, `DOUBLE`, `DATE` or `TIMESTAMP`. -* `value`: Can be any data type except `TEXT`. +* `metric`: Must be one of the following data types: `int`, `long`, `float`, `double`, `date` or `timestamp`. +* `value`: Can be any data type except `text`. -The `FOR_MIN()` function returns `NULL` in the following situations: +The `for_min()` function returns `NULL` in the following situations: * There are no input rows * The `metric` column contains only `NULL` values @@ -69,7 +69,7 @@ SELECT * FROM payments; (7 rows) ---- -=== `FOR_MIN()` basic usage +=== `for_min()` basic usage To determine the price associated with the lowest discount applied across all payments, run the query: @@ -88,9 +88,9 @@ The query returns the following output: (1 row) ---- -=== `FOR_MIN()` with `GROUP BY` clause +=== `for_min()` with `GROUP BY` clause -To determine the discount associated with the lowest price paid by each customer, use the `GROUP BY` clause with the `FOR_MIN()` function: +To determine the discount associated with the lowest price paid by each customer, use the `GROUP BY` clause with the `for_min()` function: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/max.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/max.adoc index c97d72124..64d5b41ce 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/max.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/max.adoc @@ -1,8 +1,8 @@ = max -:description: MAX() is a function that returns the maximum value from a set of records. +:description: `max()` is a function that returns the maximum value from a set of records. :page-topic-type: reference -`MAX()` is a function that returns the maximum value from a set of records. +`max()` is a function that returns the maximum value from a set of records. == Syntax @@ -68,7 +68,7 @@ The query returns: +---------+--------------------------+-----------------+-------------+ ---- -=== `MAX()` with a single expression +=== `max()` with a single expression For example, you might want to know what is the highest rating among all stored movies: @@ -87,9 +87,9 @@ FROM movies; +-----------------+ ---- -=== `MAX()` with GROUP BY clause +=== `max()` with GROUP BY clause -This example uses a `MAX()` function to get the highest rating in each movie category and the results are ordered by the rating in ascending order. +This example uses a `max()` function to get the highest rating in each movie category and the results are ordered by the rating in ascending order. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/min.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/min.adoc index 52f7b2965..5f26aa354 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/min.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/min.adoc @@ -1,8 +1,8 @@ = min -:description: MIN() is a function that returns the minimum value from a set of records. +:description: `min()` is a function that returns the minimum value from a set of records. :page-topic-type: reference -`MIN()` is a function that returns the minimum value from a set of records. +`min()` is a function that returns the minimum value from a set of records. == Syntax @@ -68,7 +68,7 @@ The query returns: +---------+--------------------------+-----------------+-------------+ ---- -=== `MIN()` with a single expression +=== `min()` with a single expression For example, you might want to know what is the lowest rating of all stored movies: @@ -87,9 +87,9 @@ FROM movies; +----------------+ ---- -=== `MIN()` with `GROUP BY` clause +=== `min()` with `GROUP BY` clause -This example uses a `GROUP BY` clause to group the movie categories, then uses the `MIN()` function to get the lowest rating in each movie category and arrange the results in ascending order. +This example uses a `GROUP BY` clause to group the movie categories, then uses the `min()` function to get the lowest rating in each movie category and arrange the results in ascending order. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/mode.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/mode.adoc index 3a8e5697d..5d863cff8 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/mode.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/mode.adoc @@ -1,8 +1,8 @@ = mode -:description: MODE() is an ordered-set aggregate function that returns the most frequently occurring value (the mode) from a set of values. +:description: `mode()` is an ordered-set aggregate function that returns the most frequently occurring value (the mode) from a set of values. :page-topic-type: reference -`MODE()` is an ordered-set aggregate function that returns the most frequently occurring value (the mode) from a set of values. +`mode()` is an ordered-set aggregate function that returns the most frequently occurring value (the mode) from a set of values. == Syntax diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/percentile-cont.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/percentile-cont.adoc index 0f6307bdc..d2dee7c51 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/percentile-cont.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/percentile-cont.adoc @@ -1,8 +1,8 @@ = percentile_cont -:description: PERCENTILE_CONT() is an ordered-set aggregate function used to compute continuous percentiles from a set of values. +:description: `percentile_cont()` is an ordered-set aggregate function used to compute continuous percentiles from a set of values. :page-topic-type: reference -`PERCENTILE_CONT()` is an ordered-set aggregate function used to compute continuous percentiles from a set of values. The continuous percentile returns an interpolated value based on the distribution of the input data, while multiple continuous percentiles return an array of results matching the shape of the `fractions` parameter with each non-null element replaced by the value corresponding to that percentile. +`percentile_cont()` is an ordered-set aggregate function used to compute continuous percentiles from a set of values. The continuous percentile returns an interpolated value based on the distribution of the input data, while multiple continuous percentiles return an array of results matching the shape of the `fractions` parameter with each non-null element replaced by the value corresponding to that percentile. == Syntax diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/percentile-disc.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/percentile-disc.adoc index bc82554e1..86667682d 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/percentile-disc.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/ordered-set-aggregate-functions/percentile-disc.adoc @@ -1,8 +1,8 @@ = percentile_disc -:description: PERCENTILE_DISC() is an ordered-set aggregate function used to compute discrete percentiles from a set of values. +:description: `percentile_disc()` is an ordered-set aggregate function used to compute discrete percentiles from a set of values. :page-topic-type: reference -`PERCENTILE_DISC()` is an ordered-set aggregate function used to compute discrete percentiles from a set of values. The discrete percentile returns the first input value, which position in the ordering equals or exceeds the specified fraction, while multiple discrete percentiles return an array of results matching the shape of the fractions parameter, with each non-null element being replaced by the input value corresponding to that percentile. +`percentile_disc()` is an ordered-set aggregate function used to compute discrete percentiles from a set of values. The discrete percentile returns the first input value, which position in the ordering equals or exceeds the specified fraction, while multiple discrete percentiles return an array of results matching the shape of the fractions parameter, with each non-null element being replaced by the input value corresponding to that percentile. == Syntax @@ -19,7 +19,7 @@ PERCENTILE_DISC(fraction) WITHIN GROUP (ORDER BY order_list) + [NOTE] ==== -If multiple values share the same rank at the specified percentile, `PERCENTILE_DISC()` returns the first one encountered in the ordering. +If multiple values share the same rank at the specified percentile, `percentile_disc()` returns the first one encountered in the ordering. ==== + Parameters @@ -35,7 +35,7 @@ PERCENTILE_DISC(fractions) WITHIN GROUP (ORDER BY order_list) + [NOTE] ==== -If multiple values share the same rank at the specified percentile, `PERCENTILE_DISC` returns the first one encountered in the ordering. +If multiple values share the same rank at the specified percentile, `percentile_disc` returns the first one encountered in the ordering. ==== + Parameters diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/corr.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/corr.adoc index 9374c05be..328ed0758 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/corr.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/corr.adoc @@ -1,8 +1,8 @@ = corr -:description: The CORR() aggregate function calculates the Pearson correlation coefficient between two sets of number pairs. +:description: The `corr()` aggregate function calculates the Pearson correlation coefficient between two sets of number pairs. :page-topic-type: reference -The `CORR()` aggregate function calculates the Pearson correlation coefficient between two sets of number pairs. This function measures the linear relationship between two variables, providing a value between -1 and 1. +The `corr()` aggregate function calculates the Pearson correlation coefficient between two sets of number pairs. This function measures the linear relationship between two variables, providing a value between -1 and 1. == Syntax @@ -50,7 +50,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 5); ---- -The following query uses the `CORR()` function to calculate the correlation between film length and rating: +The following query uses the `corr()` function to calculate the correlation between film length and rating: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/covar-pop.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/covar-pop.adoc index 932073d9b..9c7b1b7b2 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/covar-pop.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/covar-pop.adoc @@ -1,8 +1,8 @@ = covar_pop -:description: The COVAR_POP() aggregate function calculates the population covariance between two sets of number pairs. +:description: The `covar_pop()` aggregate function calculates the population covariance between two sets of number pairs. :page-topic-type: reference -The `COVAR_POP()` aggregate function calculates the population covariance between two sets of number pairs. This function measures how much two variables change together, providing insight into their linear relationship. +The `covar_pop()` aggregate function calculates the population covariance between two sets of number pairs. This function measures how much two variables change together, providing insight into their linear relationship. == Syntax @@ -50,7 +50,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 5); ---- -The following query uses the `COVAR_POP()` function to calculate the covariance between film length and rating: +The following query uses the `covar_pop()` function to calculate the covariance between film length and rating: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/covar-samp.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/covar-samp.adoc index 489b0f69d..9222acf0a 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/covar-samp.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/covar-samp.adoc @@ -1,8 +1,8 @@ = covar_samp -:description: The COVAR_SAMP() aggregate function calculates the sample covariance between two sets of number pairs. +:description: The `covar_samp()` aggregate function calculates the sample covariance between two sets of number pairs. :page-topic-type: reference -The `COVAR_SAMP()` aggregate function calculates the sample covariance between two sets of number pairs. This function measures how changes in one variable relate linearly to changes in another variable within a sample dataset. +The `covar_samp()` aggregate function calculates the sample covariance between two sets of number pairs. This function measures how changes in one variable relate linearly to changes in another variable within a sample dataset. == Syntax @@ -50,7 +50,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 5); ---- -The following query uses the `COVAR_SAMP()` function to calculate the sample covariance between film `length` and `rating` where `rating` is greater than or equal to 4: +The following query uses the `covar_samp()` function to calculate the sample covariance between film `length` and `rating` where `rating` is greater than or equal to 4: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-avgx.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-avgx.adoc index f51d64928..c4bbb40d3 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-avgx.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-avgx.adoc @@ -1,8 +1,8 @@ = regr_avgx -:description: The REGR_AVGX() aggregate function calculates the average of the independent variable (x) for non-null pairs of dependent (y) and independent (x) vari +:description: The `regr_avgx()` aggregate function calculates the average of the independent variable (x) for non-null pairs of dependent (y) and independent (x) vari :page-topic-type: reference -The `REGR_AVGX()` aggregate function calculates the average of the independent variable (x) for non-null pairs of dependent (y) and independent (x) variables. This function is commonly used in linear regression analysis to compute the mean of the independent variable where both variables are not NULL. +The `regr_avgx()` aggregate function calculates the average of the independent variable (x) for non-null pairs of dependent (y) and independent (x) variables. This function is commonly used in linear regression analysis to compute the mean of the independent variable where both variables are not NULL. == Syntax @@ -50,7 +50,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 5); ---- -The following query uses the `REGR_AVGX()` function to calculate the average rating for films where both `length` and `rating` are not NULL: +The following query uses the `regr_avgx()` function to calculate the average rating for films where both `length` and `rating` are not NULL: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-avgy.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-avgy.adoc index e3a424125..b7dffc49d 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-avgy.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-avgy.adoc @@ -1,8 +1,8 @@ = regr_avgy -:description: The REGR_AVGY() aggregate function calculates the mean of the dependent variable (y) for non-null pairs of dependent (y) and independent (x) variables +:description: The `regr_avgy()` aggregate function calculates the mean of the dependent variable (y) for non-null pairs of dependent (y) and independent (x) variables :page-topic-type: reference -The `REGR_AVGY()` aggregate function calculates the mean of the dependent variable (y) for non-null pairs of dependent (y) and independent (x) variables. This function is used in linear regression analysis to compute the average value of the dependent variable where both variables are not NULL. +The `regr_avgy()` aggregate function calculates the mean of the dependent variable (y) for non-null pairs of dependent (y) and independent (x) variables. This function is used in linear regression analysis to compute the average value of the dependent variable where both variables are not NULL. == Syntax @@ -50,7 +50,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 5); ---- -The following query uses the `REGR_AVGY()` function to calculate the mean of the dependent variable (`rating`) for rows where both `rating` and `length` are not NULL: +The following query uses the `regr_avgy()` function to calculate the mean of the dependent variable (`rating`) for rows where both `rating` and `length` are not NULL: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-count.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-count.adoc index 3db3431e3..64bc67ad4 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-count.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-count.adoc @@ -1,8 +1,8 @@ = regr_count -:description: The REGR_COUNT() aggregate function calculates the number of non-null value pairs for a dependent variable (y) and an independent variable (x). +:description: The `regr_count()` aggregate function calculates the number of non-null value pairs for a dependent variable (y) and an independent variable (x). :page-topic-type: reference -The `REGR_COUNT()` aggregate function calculates the number of non-null value pairs for a dependent variable (y) and an independent variable (x). This function is used in linear regression analysis to determine the number of valid data points available for computation. +The `regr_count()` aggregate function calculates the number of non-null value pairs for a dependent variable (y) and an independent variable (x). This function is used in linear regression analysis to determine the number of valid data points available for computation. == Syntax @@ -50,7 +50,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 5); ---- -The following query uses the `REGR_COUNT()` function to count the number of rows where both `rating` and `length` are not NULL: +The following query uses the `regr_count()` function to count the number of rows where both `rating` and `length` are not NULL: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-intercept.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-intercept.adoc index 52c5f479b..14c4db742 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-intercept.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-intercept.adoc @@ -1,8 +1,8 @@ = regr_intercept -:description: The REGR_INTERCEPT() aggregate function calculates the y-intercept of the univariate linear regression line for a group of data points, where the depe +:description: The `regr_intercept()` aggregate function calculates the y-intercept of the univariate linear regression line for a group of data points, where the depe :page-topic-type: reference -The `REGR_INTERCEPT()` aggregate function calculates the y-intercept of the univariate linear regression line for a group of data points, where the dependent variable is (y) and the independent variable is (x). The intercept is the point where the regression line crosses the y-axis when x=0. +The `regr_intercept()` aggregate function calculates the y-intercept of the univariate linear regression line for a group of data points, where the dependent variable is (y) and the independent variable is (x). The intercept is the point where the regression line crosses the y-axis when x=0. == Syntax @@ -50,7 +50,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 5); ---- -The following query uses the `REGR_INTERCEPT()` function to calculate the y-intercept of the regression line for valid pairs of `rating` and `length`: +The following query uses the `regr_intercept()` function to calculate the y-intercept of the regression line for valid pairs of `rating` and `length`: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-r2.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-r2.adoc index 80e6a6f04..2f6cf8dfe 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-r2.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-r2.adoc @@ -1,8 +1,8 @@ = regr_r2 -:description: The REGR_R2() aggregate function calculates the coefficient of determination (R2) for a linear regression model. +:description: The `regr_r2()` aggregate function calculates the coefficient of determination (R2) for a linear regression model. :page-topic-type: reference -The `REGR_R2()` aggregate function calculates the coefficient of determination (R2) for a linear regression model. The R2 value indicates how well the independent variable (x) explains the variability of the dependent variable (y). +The `regr_r2()` aggregate function calculates the coefficient of determination (R2) for a linear regression model. The R2 value indicates how well the independent variable (x) explains the variability of the dependent variable (y). == Syntax @@ -50,7 +50,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 5); ---- -The following query uses the `REGR_R2()` function to calculate the coefficient of determination (R2) for valid pairs of `rating` and `length`: +The following query uses the `regr_r2()` function to calculate the coefficient of determination (R2) for valid pairs of `rating` and `length`: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-slope.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-slope.adoc index 10f3ab052..7a9bf4b77 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-slope.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-slope.adoc @@ -1,8 +1,8 @@ = regr_slope -:description: The REGR_SLOPE() aggregate function calculates the slope of the regression line for a linear relationship between a dependent variable (y) and an inde +:description: The `regr_slope()` aggregate function calculates the slope of the regression line for a linear relationship between a dependent variable (y) and an inde :page-topic-type: reference -The `REGR_SLOPE()` aggregate function calculates the slope of the regression line for a linear relationship between a dependent variable (y) and an independent variable (x). The slope represents the rate of change in `y` for every unit increase in `x`. This function is used in regression analysis to quantify the strength and direction of a linear relationship. +The `regr_slope()` aggregate function calculates the slope of the regression line for a linear relationship between a dependent variable (y) and an independent variable (x). The slope represents the rate of change in `y` for every unit increase in `x`. This function is used in regression analysis to quantify the strength and direction of a linear relationship. == Syntax @@ -50,7 +50,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 5); ---- -The following query uses the `REGR_SLOPE()` function to calculate the slope of the regression line for valid pairs of `rating` and `length`: +The following query uses the `regr_slope()` function to calculate the slope of the regression line for valid pairs of `rating` and `length`: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-sxx.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-sxx.adoc index 76233bd12..5decdb245 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-sxx.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-sxx.adoc @@ -1,8 +1,8 @@ = regr_sxx -:description: The REGR_SXX() aggregate function calculates the sum of squares of deviations for the independent variable (x) in a linear regression analysis. +:description: The `regr_sxx()` aggregate function calculates the sum of squares of deviations for the independent variable (x) in a linear regression analysis. :page-topic-type: reference -The `REGR_SXX()` aggregate function calculates the sum of squares of deviations for the independent variable (x) in a linear regression analysis. This value represents the variability of the independent variable and is a key component in calculating the slope and other regression statistics. +The `regr_sxx()` aggregate function calculates the sum of squares of deviations for the independent variable (x) in a linear regression analysis. This value represents the variability of the independent variable and is a key component in calculating the slope and other regression statistics. == Syntax @@ -50,7 +50,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 5); ---- -The following query uses the `REGR_SXX()` function to calculate the sum of squares of deviations for the independent variable `length`: +The following query uses the `regr_sxx()` function to calculate the sum of squares of deviations for the independent variable `length`: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-sxy.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-sxy.adoc index 5b093e127..e7a3a214f 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-sxy.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-sxy.adoc @@ -1,8 +1,8 @@ = regr_sxy -:description: The REGR_SXY() aggregate function calculates the sum of products od deviations for the dependent variable (y) and the independent variable (x) in a li +:description: The `regr_sxy()` aggregate function calculates the sum of products od deviations for the dependent variable (y) and the independent variable (x) in a li :page-topic-type: reference -The `REGR_SXY()` aggregate function calculates the sum of products od deviations for the dependent variable (y) and the independent variable (x) in a linear regression analysis. This value represents the covariance-like term used to compute the slope of the regression line. +The `regr_sxy()` aggregate function calculates the sum of products od deviations for the dependent variable (y) and the independent variable (x) in a linear regression analysis. This value represents the covariance-like term used to compute the slope of the regression line. == Syntax @@ -50,7 +50,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 5); ---- -This query uses the `REGR_SXY()` function to calculate the sum of products of deviations for non-null pair of `rating` and `length`: +This query uses the `regr_sxy()` function to calculate the sum of products of deviations for non-null pair of `rating` and `length`: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-syy.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-syy.adoc index 9cb53fa4b..1b1631358 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-syy.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/regr-syy.adoc @@ -1,8 +1,8 @@ = regr_syy -:description: The REGR_SYY() aggregate function calculates the sum of squares of deviations for the dependent variable (y) in a linear regression analysis. +:description: The `regr_syy()` aggregate function calculates the sum of squares of deviations for the dependent variable (y) in a linear regression analysis. :page-topic-type: reference -The `REGR_SYY()` aggregate function calculates the sum of squares of deviations for the dependent variable (y) in a linear regression analysis. +The `regr_syy()` aggregate function calculates the sum of squares of deviations for the dependent variable (y) in a linear regression analysis. == Syntax @@ -50,7 +50,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 5); ---- -The following query uses the `REGR_SYY()` function to calculate the sum of squares of deviation for the dependent variable `rating`: +The following query uses the `regr_syy()` function to calculate the sum of squares of deviation for the dependent variable `rating`: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev-pop.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev-pop.adoc index 316a09938..47dc229ec 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev-pop.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev-pop.adoc @@ -1,8 +1,8 @@ = stddev_pop -:description: The STDDEV_POP() aggregate function calculates the population stardard deviation of a set of numeric values. +:description: The `stddev_pop()` aggregate function calculates the population stardard deviation of a set of numeric values. :page-topic-type: reference -The `STDDEV_POP()` aggregate function calculates the population stardard deviation of a set of numeric values. +The `stddev_pop()` aggregate function calculates the population stardard deviation of a set of numeric values. == Syntax @@ -49,7 +49,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 5); ---- -The following query uses the `STDDEV_POP()` function to calculate the population standard deviation for the `length` column: +The following query uses the `stddev_pop()` function to calculate the population standard deviation for the `length` column: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev-samp.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev-samp.adoc index c80c0d0ad..6352a9bce 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev-samp.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev-samp.adoc @@ -1,8 +1,8 @@ = stddev_samp -:description: The STDDEV_SAMP() aggregate function calculates the sample standard deviation of a set of numeric values. +:description: The `stddev_samp()` aggregate function calculates the sample standard deviation of a set of numeric values. :page-topic-type: reference -The `STDDEV_SAMP()` aggregate function calculates the sample standard deviation of a set of numeric values. This function measures how much the values deviate from their mean, assuming the data is a sample of a larger population. +The `stddev_samp()` aggregate function calculates the sample standard deviation of a set of numeric values. This function measures how much the values deviate from their mean, assuming the data is a sample of a larger population. == Syntax @@ -49,7 +49,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 5); ---- -The following query uses the `STDDEV_SAMP()` function to calculate the sample standard deviation for the `length` column where `rating` is greater than or equal to 4: +The following query uses the `stddev_samp()` function to calculate the sample standard deviation for the `length` column where `rating` is greater than or equal to 4: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev.adoc index 26fadc9cf..48b5eebc0 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/stddev.adoc @@ -1,8 +1,8 @@ = stddev -:description: The STDDEV() aggregate function calculates the sample standard deviation of a set of numeric values. +:description: The `stddev()` aggregate function calculates the sample standard deviation of a set of numeric values. :page-topic-type: reference -The `STDDEV()` aggregate function calculates the sample standard deviation of a set of numeric values. Standard deviation measures the dispersion or spread of data points around the mean. +The `stddev()` aggregate function calculates the sample standard deviation of a set of numeric values. Standard deviation measures the dispersion or spread of data points around the mean. == Syntax @@ -49,7 +49,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 5); ---- -The following query uses the `STDDEV()` function to calculate the sample standard deviation for the `length` column: +The following query uses the `stddev()` function to calculate the sample standard deviation for the `length` column: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/var-pop.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/var-pop.adoc index 03dd7a9d0..775068166 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/var-pop.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/var-pop.adoc @@ -1,8 +1,8 @@ = var_pop -:description: The VAR_POP() aggregate function calculates the population variance of a set of numeric values. +:description: The `var_pop()` aggregate function calculates the population variance of a set of numeric values. :page-topic-type: reference -The `VAR_POP()` aggregate function calculates the population variance of a set of numeric values. +The `var_pop()` aggregate function calculates the population variance of a set of numeric values. == Syntax @@ -49,7 +49,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 5); ---- -The following query uses the `VAR_POP()` function to calculate the population variance for the `length` column: +The following query uses the `var_pop()` function to calculate the population variance for the `length` column: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/var-samp.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/var-samp.adoc index 08e79ffb8..f11be7c9e 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/var-samp.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/var-samp.adoc @@ -1,8 +1,8 @@ = var_samp -:description: The VAR_SAMP() aggregate function calculates the sample variance of a set of numeric values. +:description: The `var_samp()` aggregate function calculates the sample variance of a set of numeric values. :page-topic-type: reference -The `VAR_SAMP()` aggregate function calculates the sample variance of a set of numeric values. This function measures the spread of data points around the mean, assuming the data is a sample of a larger population. +The `var_samp()` aggregate function calculates the sample variance of a set of numeric values. This function measures the spread of data points around the mean, assuming the data is a sample of a larger population. == Syntax @@ -49,7 +49,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 5); ---- -The following query uses the `VAR_SAMP()` function to calculate the sample variance for the `length` column where `rating` is greater than or equal to 4: +The following query uses the `var_samp()` function to calculate the sample variance for the `length` column where `rating` is greater than or equal to 4: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/variance.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/variance.adoc index cbb6ea0ea..467066934 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/variance.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/variance.adoc @@ -1,8 +1,8 @@ = variance -:description: The VARIANCE() aggregate function calculate the sample variance of a set of numeric values. +:description: The `variance()` aggregate function calculate the sample variance of a set of numeric values. :page-topic-type: reference -The `VARIANCE()` aggregate function calculate the sample variance of a set of numeric values. Variance measures the spread of data points around the mean, providing insight into how much the values deviate from the average. +The `variance()` aggregate function calculate the sample variance of a set of numeric values. Variance measures the spread of data points around the mean, providing insight into how much the values deviate from the average. == Syntax @@ -49,7 +49,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 5); ---- -The following query uses the `VARIANCE()` function to calculate the variance for the `length` column: +The following query uses the `variance()` function to calculate the variance for the `length` column: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/sum.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/sum.adoc index d7ecb3a0d..d02a0699b 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/sum.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/sum.adoc @@ -1,8 +1,8 @@ = sum -:description: SUM() calculates the sum of values from stored records. +:description: `sum()` calculates the sum of values from stored records. :page-topic-type: reference -`SUM()` calculates the sum of values from stored records. `SUM()` doesn't consider `NULL` in the calculation, and it returns `NULL` instead of zero if the executed statement returns no rows. +`sum()` calculates the sum of values from stored records. `sum()` doesn't consider `NULL` in the calculation, and it returns `NULL` instead of zero if the executed statement returns no rows. The supported input and return types are listed in the following table. @@ -118,9 +118,9 @@ The rental table stores the details for car rental: +------------+---------------------+---------------------+-----------+---------------+-------------+ ---- -=== `SUM()` in `SELECT` statement +=== `sum()` in `SELECT` statement -The following example uses the `SUM()` function to calculate the total rent price of all `rental_id`: +The following example uses the `sum()` function to calculate the total rent price of all `rental_id`: [source,sql] ---- @@ -139,9 +139,9 @@ This returns a sum value of the `total_price`: +--------+ ---- -=== `SUM()` with a `NULL` result +=== `sum()` with a `NULL` result -The following example uses the `SUM()` function to calculate the total rent price of the `customer_id = 11118.` +The following example uses the `sum()` function to calculate the total rent price of the `customer_id = 11118.` [source,sql] ---- @@ -150,7 +150,7 @@ FROM rental WHERE customer_id = 11118; ---- -Since no records in the `rental` table have the `customer_id = 11118`, the `SUM()` function returns a `NULL`. +Since no records in the `rental` table have the `customer_id = 11118`, the `sum()` function returns a `NULL`. [source,sql] ---- @@ -161,11 +161,11 @@ Since no records in the `rental` table have the `customer_id = 11118`, the `SUM( +--------+ ---- -=== `SUM()` with `GROUP BY` clause +=== `sum()` with `GROUP BY` clause -You can use the `GROUP BY` clause to group the records in the table and apply the `SUM()` function to each group afterward. +You can use the `GROUP BY` clause to group the records in the table and apply the `sum()` function to each group afterward. -The following example uses the `SUM()` function and the `GROUP BY` clause to calculate the total price paid by each customer: +The following example uses the `sum()` function and the `GROUP BY` clause to calculate the total price paid by each customer: [source,sql] ---- @@ -191,9 +191,9 @@ This calculates the `total_price` from a group of `customer_id`: +--------------+--------------+ ---- -=== `SUM()` with `HAVING` clause +=== `sum()` with `HAVING` clause -You can use the `SUM()` function with the `HAVING` clause to filter out the sum of groups based on a specific condition: +You can use the `sum()` function with the `HAVING` clause to filter out the sum of groups based on a specific condition: [source,sql] ---- @@ -219,11 +219,11 @@ This returns the customers who spent greater than or equal to 3000: +--------------+--------------+ ---- -=== `SUM()` with multiple expression +=== `sum()` with multiple expression The example uses the following: -* `SUM()` function to calculate total rental days. +* `sum()` function to calculate total rental days. * `JOIN` clause to combine the rental table with the customer table. * `GROUP BY` group a result-set based on the customers' names. diff --git a/modules/reference/pages/sql/sql-functions/boolean-functions/if-function.adoc b/modules/reference/pages/sql/sql-functions/boolean-functions/if-function.adoc index 2e23f889e..dd078e20c 100644 --- a/modules/reference/pages/sql/sql-functions/boolean-functions/if-function.adoc +++ b/modules/reference/pages/sql/sql-functions/boolean-functions/if-function.adoc @@ -1,8 +1,8 @@ = if -:description: The IF() function returns one value if the condition is TRUE and another value if the condition is FALSE. +:description: The `if()` function returns one value if the condition is TRUE and another value if the condition is FALSE. :page-topic-type: reference -The `IF()` function returns one value if the condition is `TRUE` and another value if the condition is `FALSE`. +The `if()` function returns one value if the condition is `TRUE` and another value if the condition is `FALSE`. == Syntax @@ -15,7 +15,7 @@ The `expression` must evaluate to a Boolean (`TRUE` or `FALSE`). == Examples -=== IF() with a table +=== `if()` with a table The following example uses a `test_result` table to determine which participants passed and failed: @@ -79,7 +79,7 @@ SELECT name, IF(score>=500, 'PASSED', 'NOT PASSED') FROM test_result; +--------------------+-------------+ ---- -=== IF() with expressions as return value +=== `if()` with expressions as return value The following example uses a `deptcost` table to determine which departments exceeded the budget: diff --git a/modules/reference/pages/sql/sql-functions/index.adoc b/modules/reference/pages/sql/sql-functions/index.adoc index 8646084f9..0fa299af7 100644 --- a/modules/reference/pages/sql/sql-functions/index.adoc +++ b/modules/reference/pages/sql/sql-functions/index.adoc @@ -7,12 +7,12 @@ Redpanda SQL supports the following function types for querying and transforming [width="100%",cols="<42%,<58%",options="header",] |=== |Function Name |Description -|xref:reference:sql/sql-functions/boolean-functions/if-function.adoc[`boolean` FUNCTIONS] |Evaluate logical conditions and return `TRUE`, `FALSE` OR `NULL` -|xref:reference:sql/sql-functions/math-functions/index.adoc[MATH, TRIGONOMETRIC, AND HYPERBOLIC FUNCTIONS] |Perform mathematical operations on numeric data, including rounding, exponentiation, and trigonometric calculations -|xref:reference:sql/sql-functions/string-functions/index.adoc[STRING FUNCTIONS] |Manipulate string data for text processing, including concatenation, substring extraction and case conversion -|xref:reference:sql/sql-functions/timestamp-functions/index.adoc[`timestamp` FUNCTIONS] |Handle data and time values including extracting components, adding intervals and comparing timestamps -|xref:reference:sql/sql-functions/json-functions/index.adoc[`json` FUNCTIONS] |Manipulate and query `json` data stored in the database, including extracting values and creating `json` objects -|xref:reference:sql/sql-functions/aggregate-functions/index.adoc[AGGREGATE FUNCTIONS] |Summarize a set of values and return a single result, such as calculating sums, averages and counts -|xref:reference:sql/sql-functions/window-functions/index.adoc[WINDOW FUNCTIONS] |Operate over a subset of rows defined by a windowing clause, enabling ranking, aggregation and row numbering within result sets -|xref:reference:sql/sql-functions/other-functions/index.adoc[OTHER FUNCTIONS] |Includes a variety of specialized functions not categorized elsewhere +|xref:reference:sql/sql-functions/boolean-functions/if-function.adoc[Boolean functions] |Evaluate logical conditions and return `TRUE`, `FALSE`, or `NULL`. +|xref:reference:sql/sql-functions/math-functions/index.adoc[Math, trigonometric, and hyperbolic functions] |Perform mathematical operations on numeric data, including rounding, exponentiation, and trigonometric calculations. +|xref:reference:sql/sql-functions/string-functions/index.adoc[String functions] |Manipulate string data for text processing, including concatenation, substring extraction, and case conversion. +|xref:reference:sql/sql-functions/timestamp-functions/index.adoc[Timestamp functions] |Handle date and time values, including extracting components, adding intervals, and comparing timestamps. +|xref:reference:sql/sql-functions/json-functions/index.adoc[JSON functions] |Manipulate and query JSON data stored in the database, including extracting values and creating JSON objects. +|xref:reference:sql/sql-functions/aggregate-functions/index.adoc[Aggregate functions] |Summarize a set of values and return a single result, such as calculating sums, averages, and counts. +|xref:reference:sql/sql-functions/window-functions/index.adoc[Window functions] |Operate over a subset of rows defined by a windowing clause, enabling ranking, aggregation, and row numbering within result sets. +|xref:reference:sql/sql-functions/other-functions/index.adoc[Other functions] |Includes a variety of specialized functions not categorized elsewhere. |=== diff --git a/modules/reference/pages/sql/sql-functions/json-functions/index.adoc b/modules/reference/pages/sql/sql-functions/json-functions/index.adoc index bbf30a80b..ee4845a96 100644 --- a/modules/reference/pages/sql/sql-functions/json-functions/index.adoc +++ b/modules/reference/pages/sql/sql-functions/json-functions/index.adoc @@ -6,10 +6,10 @@ Redpanda SQL provides functions to query and manipulate `json` data: [width="100%",cols="53%,47%",options="header",] |=== |*Functions* |*Description* -|xref:reference:sql/sql-functions/json-functions/json-extract-path.adoc[JSON_EXTRACT_PATH()] |Extracts a `json` sub-object at the specified path. -|xref:reference:sql/sql-functions/json-functions/json-extract-path-text.adoc[JSON_EXTRACT_PATH_TEXT()] |Returns text referenced by a series of path elements in a `json` string or `json` body. -|xref:reference:sql/sql-functions/json-functions/json-array-length.adoc[JSON_ARRAY_LENGTH()] |Returns the number of elements in the outer array of a `json` string or `json` body. -|xref:reference:sql/sql-functions/json-functions/json-array-extract.adoc[JSON_ARRAY_EXTRACT()] |Returns the `json` array as a set of `json` values. +|xref:reference:sql/sql-functions/json-functions/json-extract-path.adoc[`json_extract_path()`] |Extracts a `json` sub-object at the specified path. +|xref:reference:sql/sql-functions/json-functions/json-extract-path-text.adoc[`json_extract_path_text()`] |Returns text referenced by a series of path elements in a `json` string or `json` body. +|xref:reference:sql/sql-functions/json-functions/json-array-length.adoc[`json_array_length()`] |Returns the number of elements in the outer array of a `json` string or `json` body. +|xref:reference:sql/sql-functions/json-functions/json-array-extract.adoc[`json_array_extract()`] |Returns the `json` array as a set of `json` values. |=== Use operators to specify conditions when using `json` functions. Redpanda SQL also supports the following `json` operators: diff --git a/modules/reference/pages/sql/sql-functions/json-functions/json-array-extract.adoc b/modules/reference/pages/sql/sql-functions/json-functions/json-array-extract.adoc index 81b5e8e96..1967761d2 100644 --- a/modules/reference/pages/sql/sql-functions/json-functions/json-array-extract.adoc +++ b/modules/reference/pages/sql/sql-functions/json-functions/json-array-extract.adoc @@ -1,21 +1,21 @@ = json_array_extract -:description: The JSON_ARRAY_EXTRACT() function returns the JSON array as a set of JSON values. +:description: The `json_array_extract()` function returns the JSON array as a set of JSON values. :page-topic-type: reference == Overview -The `JSON_ARRAY_EXTRACT()` function returns the `json` array as a set of `json` values. +The `json_array_extract()` function returns the `json` array as a set of `json` values. == Syntax -The `JSON_ARRAY_EXTRACT()` has the following basic syntax. +The `json_array_extract()` has the following basic syntax. [source,sql] ---- JSON_ARRAY_EXTRACT('json_array'::JSON,id); ---- -`JSON_ARRAY_EXTRACT()` requires the following parameters: +`json_array_extract()` requires the following parameters: * `json_array`: The array to extract. * `::JSON`: Argument indicating that the query is of type `json`. @@ -23,7 +23,7 @@ JSON_ARRAY_EXTRACT('json_array'::JSON,id); === Another option -`JSON_ARRAY_EXTRACT` can also be achieved with the `->` operator, as shown in the following syntax: +`json_array_extract` can also be achieved with the `->` operator, as shown in the following syntax: [source,sql] ---- @@ -36,7 +36,7 @@ SELECT 'from_json'::JSON -> path; == Examples -=== Basic JSON_ARRAY_EXTRACT() function +=== Basic `json_array_extract()` function . The following example extracts a `json` array as a `json` set. + diff --git a/modules/reference/pages/sql/sql-functions/json-functions/json-array-length.adoc b/modules/reference/pages/sql/sql-functions/json-functions/json-array-length.adoc index edd210ddc..2005d8574 100644 --- a/modules/reference/pages/sql/sql-functions/json-functions/json-array-length.adoc +++ b/modules/reference/pages/sql/sql-functions/json-functions/json-array-length.adoc @@ -1,8 +1,8 @@ = json_array_length -:description: The JSON_ARRAY_LENGTH() function returns the length of a specified JSON array. +:description: The `json_array_length()` function returns the length of a specified JSON array. :page-topic-type: reference -The `JSON_ARRAY_LENGTH()` function returns the length of a specified `json` array. +The `json_array_length()` function returns the length of a specified `json` array. == Syntax diff --git a/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path-text.adoc b/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path-text.adoc index 3ea675c33..3cbc29a4e 100644 --- a/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path-text.adoc +++ b/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path-text.adoc @@ -1,17 +1,17 @@ = json_extract_path_text -:description: The JSON_EXTRACT_PATH_TEXT() function extracts JSON nested value from a specified JSON value according to the defined path. +:description: The `json_extract_path_text()` function extracts JSON nested value from a specified JSON value according to the defined path. :page-topic-type: reference -The `JSON_EXTRACT_PATH_TEXT()` function extracts `json` nested value from a specified `json` value according to the defined path. +The `json_extract_path_text()` function extracts `json` nested value from a specified `json` value according to the defined path. [NOTE] ==== -This function may be similar to the `JSON_EXTRACT_PATH()`. This function returns a value of type text instead of type `json`. +This function may be similar to the `json_extract_path()`. This function returns a value of type text instead of type `json`. ==== == Syntax -The `JSON_EXTRACT_PATH_TEXT()` syntax is as follows: +The `json_extract_path_text()` syntax is as follows: [source,sql] ---- @@ -38,7 +38,7 @@ SELECT 'from_json'::JSON ->> 'path'; == Examples -. This example shows how to use the `JSON_EXTRACT_PATH_TEXT()` function to extract values ​​from a `json` object at a specified index. +. This example shows how to use the `json_extract_path_text()` function to extract values ​​from a `json` object at a specified index. + Run the query: + @@ -54,7 +54,7 @@ SELECT JSON_EXTRACT_PATH_TEXT('{"a": "Oxla", "b": {"x": 1.234, "y": 4.321}}', 'a SELECT '{"a": "Oxla", "b": {"x": 1.234, "y": 4.321}}'::JSON ->> 'a' AS "result a"; ---- -. The `JSON_EXTRACT_PATH_TEXT()` function extracts the values and returns the output: +. The `json_extract_path_text()` function extracts the values and returns the output: + [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path.adoc b/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path.adoc index 894904a0d..70c6f1191 100644 --- a/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path.adoc +++ b/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path.adoc @@ -1,12 +1,12 @@ = json_extract_path -:description: JSON_EXTRACT_PATH() function extracts JSON nested value from a specified path. +:description: `json_extract_path()` function extracts JSON nested value from a specified path. :page-topic-type: reference -`JSON_EXTRACT_PATH()` function extracts `json` nested value from a specified path. +`json_extract_path()` function extracts `json` nested value from a specified path. == Syntax -The syntax of the `JSON_EXTRACT_PATH()` function is: +The syntax of the `json_extract_path()` function is: [source,sql] ---- @@ -31,7 +31,7 @@ SELECT 'from_json'::JSON -> 'path'; == Examples -These examples display how `JSON_EXTRACT_PATH()` extracts the "`oxla`" `json` sub-object from the specified path. +These examples display how `json_extract_path()` extracts the "`oxla`" `json` sub-object from the specified path. . Use the query: + diff --git a/modules/reference/pages/sql/sql-functions/math-functions/abs.adoc b/modules/reference/pages/sql/sql-functions/math-functions/abs.adoc index c2943efe5..d0ef9d5fd 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/abs.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/abs.adoc @@ -1,32 +1,32 @@ = abs -:description: The ABS() function returns an absolute number (for example, the positive value of a number). +:description: The `abs()` function returns an absolute number (for example, the positive value of a number). :page-topic-type: reference -The `ABS()` function returns an absolute number (for example, the positive value of a number). The data type of the returned value will depend on the data type of the value passed to the `ABS()` function. +The `abs()` function returns an absolute number (for example, the positive value of a number). The data type of the returned value will depend on the data type of the value passed to the `abs()` function. == Syntax -Here's the syntax for the `ABS()`function: +Here's the syntax for the `abs()`function: [source,sql] ---- ABS(x) ---- -The `ABS()` function requires one argument: +The `abs()` function requires one argument: * `x`: An expression that evaluates to a number. [NOTE] ==== -The *ABS()* function will return the negation of the negative numbers. +The *`abs()`* function will return the negation of the negative numbers. ==== == Examples === Absolute value of a negative number -This example demonstrates how to use the `ABS()` function to obtain the absolute value of a negative number: +This example demonstrates how to use the `abs()` function to obtain the absolute value of a negative number: [source,sql] ---- @@ -44,9 +44,9 @@ This returns an absolute value of the passed argument: +--------+ ---- -=== ABS() function with an expression +=== `abs()` function with an expression -This example demonstrates how to use the `ABS()` function with an expression to obtain the absolute value of the result: +This example demonstrates how to use the `abs()` function with an expression to obtain the absolute value of the result: [source,sql] ---- @@ -64,9 +64,9 @@ The result of this statement is *-150*. However, the output is *150*, as 150 is +------+ ---- -=== Use the ABS() function with a table +=== Use the `abs()` function with a table -This example demonstrates how to use the `ABS()` function with a table to obtain the absolute values of all numbers in a specific column: +This example demonstrates how to use the `abs()` function with a table to obtain the absolute values of all numbers in a specific column: . First, create a table named absTable containing an *_initialValue_* column with some positive and negative values: + diff --git a/modules/reference/pages/sql/sql-functions/math-functions/cbrt.adoc b/modules/reference/pages/sql/sql-functions/math-functions/cbrt.adoc index 402b64345..6d8299b6a 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/cbrt.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/cbrt.adoc @@ -1,12 +1,12 @@ = cbrt -:description: The CBRT() function calculates and returns the cube root of a given number. +:description: The `cbrt()` function calculates and returns the cube root of a given number. :page-topic-type: reference -The `CBRT()` function calculates and returns the cube root of a given number. In mathematical terms, for a number _x_, its cube root _y_ is determined by the equation _y³ = x_. +The `cbrt()` function calculates and returns the cube root of a given number. In mathematical terms, for a number _x_, its cube root _y_ is determined by the equation _y³ = x_. == Syntax -The syntax for the `CBRT()` function is: +The syntax for the `cbrt()` function is: [source,sql] ---- @@ -28,7 +28,7 @@ For example, expressions like `SELECT CBRT(some_column) from test_table`, assumi == Examples -These examples show how to use the `CBRT()` function: +These examples show how to use the `cbrt()` function: === Basic cube root calculation @@ -50,7 +50,7 @@ The result of this query will be: === Cube root of a negative value -To calculate the cube root of a negative number, use the `CBRT()` function as shown: +To calculate the cube root of a negative number, use the `cbrt()` function as shown: [source,sql] ---- @@ -104,7 +104,7 @@ The result will be the cube root of the provided decimal value. === Handle incorrect argument -When a non-numeric argument is provided, the `CBRT()` function works as shown here: +When a non-numeric argument is provided, the `cbrt()` function works as shown here: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/math-functions/ceil.adoc b/modules/reference/pages/sql/sql-functions/math-functions/ceil.adoc index d323dd126..8ed0210ec 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/ceil.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/ceil.adoc @@ -1,19 +1,19 @@ = ceil -:description: The CEIL() function returns the nearest positive or negative integer value greater than or equal to the provided decimal input number. +:description: The `ceil()` function returns the nearest positive or negative integer value greater than or equal to the provided decimal input number. :page-topic-type: reference -The `CEIL()` function returns the nearest positive or negative integer value greater than or equal to the provided decimal input number. +The `ceil()` function returns the nearest positive or negative integer value greater than or equal to the provided decimal input number. == Syntax -The syntax of the `CEIL()` function is: +The syntax of the `ceil()` function is: [source,sql] ---- CEIL(x) ---- -The `CEIL()` function requires one argument: +The `ceil()` function requires one argument: * `x`: A positive or a negative decimal number (or an expression that evaluates to a decimal number). @@ -21,7 +21,7 @@ The `CEIL()` function requires one argument: === Round up a positive decimal value -This example demonstrates how the `CEIL()` function rounds up a positive decimal value: +This example demonstrates how the `ceil()` function rounds up a positive decimal value: [source,sql] ---- @@ -41,7 +41,7 @@ This returns 301, as it is the nearest integer value greater than 300.55. === Round up a negative decimal value -This example demonstrates how the `CEIL()` function rounds up a negative decimal value: +This example demonstrates how the `ceil()` function rounds up a negative decimal value: [source,sql] ---- @@ -59,9 +59,9 @@ The output of this statement is -89, as -89 is the nearest integer value greater +-------+ ---- -=== Use the `CEIL()` function with a table +=== Use the `ceil()` function with a table -This example demonstrates how to use the `CEIL()` function with a table to round up values in a specific column: +This example demonstrates how to use the `ceil()` function with a table to round up values in a specific column: . First, create a table called *_CeilRecords_*: + diff --git a/modules/reference/pages/sql/sql-functions/math-functions/cosh.adoc b/modules/reference/pages/sql/sql-functions/math-functions/cosh.adoc index b885b04f1..7bda935a3 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/cosh.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/cosh.adoc @@ -1,8 +1,8 @@ = cosh -:description: The COSH() function returns the hyperbolic cosine of a specified numeric argument. +:description: The `cosh()` function returns the hyperbolic cosine of a specified numeric argument. :page-topic-type: reference -The `COSH()` function returns the hyperbolic cosine of a specified numeric argument. +The `cosh()` function returns the hyperbolic cosine of a specified numeric argument. == Syntax @@ -53,7 +53,7 @@ SELECT COSH(0); === Negative value -`COSH` is symmetric, so `COSH(-x)` returns the same result as `COSH(x)`: +`cosh` is symmetric, so `COSH(-x)` returns the same result as `COSH(x)`: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/math-functions/exp.adoc b/modules/reference/pages/sql/sql-functions/math-functions/exp.adoc index 92b582e84..1f461e15c 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/exp.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/exp.adoc @@ -1,12 +1,12 @@ = exp -:description: The EXP() function returns the exponential value of a number specified in the argument. +:description: The `exp()` function returns the exponential value of a number specified in the argument. :page-topic-type: reference -The `EXP()` function returns the exponential value of a number specified in the argument. +The `exp()` function returns the exponential value of a number specified in the argument. == Syntax -The syntax for the `EXP()` is: +The syntax for the `exp()` is: [source,sql] ---- @@ -19,11 +19,11 @@ Where: == Examples -The examples here show how the `EXP()` function works. +The examples here show how the `exp()` function works. === Basic usage -This example uses the `EXP()` function with positive and negative values. +This example uses the `exp()` function with positive and negative values. [source,sql] ---- @@ -43,9 +43,9 @@ EXP of 0 | EXP of 1 | EXP of 2 | EXP of -1 | EXP 1 | 2.718281828459045 | 7.38905609893065 | 0.36787944117144233 | 0.1353352832366127 ---- -=== Use `EXP()` with fractions +=== Use `exp()` with fractions -This case uses the `EXP()` function with a fractional argument. +This case uses the `exp()` function with a fractional argument. [source,sql] ---- @@ -61,9 +61,9 @@ Here is the result: 24.532531366911574 ---- -=== Use `EXP()` with expressions +=== Use `exp()` with expressions -This example uses the `EXP()` function with expressions. +This example uses the `exp()` function with expressions. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/math-functions/floor.adoc b/modules/reference/pages/sql/sql-functions/math-functions/floor.adoc index 085dcdc0e..79f94650f 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/floor.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/floor.adoc @@ -1,19 +1,19 @@ = floor -:description: The FLOOR() returns a number rounded down that is less than or equal to the specified argument. +:description: The `floor()` returns a number rounded down that is less than or equal to the specified argument. :page-topic-type: reference -The `FLOOR()` returns a number rounded down that is less than or equal to the specified argument. +The `floor()` returns a number rounded down that is less than or equal to the specified argument. == Syntax -The syntax for the `FLOOR()` function in Redpanda SQL is: +The syntax for the `floor()` function in Redpanda SQL is: [source,sql] ---- FLOOR(x) ---- -The `FLOOR()` function requires one argument: +The `floor()` function requires one argument: `x`: A positive or a negative decimal number (or an expression that evaluates to a decimal number). @@ -59,9 +59,9 @@ The result is the nearest integer smaller than or equal to the specified argumen +-------+ ---- -=== Use the FLOOR() function with a table +=== Use the `floor()` function with a table -This example demonstrates how to use the `FLOOR()` function with a table to round down values in a specific column: +This example demonstrates how to use the `floor()` function with a table to round down values in a specific column: . Create a new table called *FloorRecords* with double-precision values: + diff --git a/modules/reference/pages/sql/sql-functions/math-functions/greatest.adoc b/modules/reference/pages/sql/sql-functions/math-functions/greatest.adoc index 9c5224b2c..ca9c50f06 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/greatest.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/greatest.adoc @@ -1,8 +1,8 @@ = greatest -:description: The GREATEST() function extracts the greatest or largest value from a set of values. +:description: The `greatest()` function extracts the greatest or largest value from a set of values. :page-topic-type: reference -The `GREATEST()` function returns the greatest value from a set of values. The arguments must be of compatible types. For example, comparing a text value with a number returns an error. +The `greatest()` function returns the greatest value from a set of values. The arguments must be of compatible types. For example, comparing a text value with a number returns an error. == Syntax @@ -98,7 +98,7 @@ greatest === Use table data -You can also use `GREATEST()` to find the greatest value across columns. For example, create a table named `Student` that stores student names and scores. +You can also use `greatest()` to find the greatest value across columns. For example, create a table named `Student` that stores student names and scores. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/math-functions/index.adoc b/modules/reference/pages/sql/sql-functions/math-functions/index.adoc index ef1a60eec..39f8259fb 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/index.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/index.adoc @@ -9,21 +9,21 @@ Mathematical, trigonometric, and hyperbolic functions in Redpanda SQL are design [width="100%",cols="47%,53%",options="header",] |=== |Function |Description -|xref:reference:sql/sql-functions/math-functions/abs.adoc[ABS()] |This function returns the absolute value of an argument, regardless of whether it is positive or negative -|xref:reference:sql/sql-functions/math-functions/cbrt.adoc[CBRT()] |This function returns the cube root of a given number -|xref:reference:sql/sql-functions/math-functions/ceil.adoc[CEIL()] |This function rounds up to the nearest positive or negative integer value greater than or equal to the argument -|xref:reference:sql/sql-functions/math-functions/exp.adoc[EXP()] |This function returns the exponential value of a number specified in the argument -|xref:reference:sql/sql-functions/math-functions/floor.adoc[FLOOR()] |This function returns a number rounded down that is less than or equal to the specified argument -|xref:reference:sql/sql-functions/math-functions/greatest.adoc[GREATEST()] |This function extracts the greatest or largest value from a set of values. -|xref:reference:sql/sql-functions/math-functions/least.adoc[LEAST()] |This function returns the least or smallest value in a list of values -|xref:reference:sql/sql-functions/math-functions/ln.adoc[LN()] |This function returns the exponential value of its argument -|xref:reference:sql/sql-functions/math-functions/log.adoc[LOG()] |This function returns the base-10 logarithm or logarithm of the specified base of a given number -|xref:reference:sql/sql-functions/math-functions/power.adoc[POWER()] |This function returns the value of a number raised to the power of another number specified in the arguments -|xref:reference:sql/sql-functions/math-functions/random.adoc[RANDOM()] |This function returns a random number between 0 (inclusive) and 1 (exclusive) -|xref:reference:sql/sql-functions/math-functions/round.adoc[ROUND()] |This function rounds numbers to the nearest integer or to a specified number of decimal places -|xref:reference:sql/sql-functions/math-functions/sign.adoc[SIGN()] |This function returns -1 for negative arguments, 1 for positive arguments or 0 if the argument is 0 -|xref:reference:sql/sql-functions/math-functions/sqrt.adoc[SQRT()] |This function returns the square root of its argument -|xref:reference:sql/sql-functions/math-functions/to-char-from-number.adoc[TO_CHAR() from Number] |Formats a number into a string using a given format +|xref:reference:sql/sql-functions/math-functions/abs.adoc[`abs()`] |This function returns the absolute value of an argument, regardless of whether it is positive or negative +|xref:reference:sql/sql-functions/math-functions/cbrt.adoc[`cbrt()`] |This function returns the cube root of a given number +|xref:reference:sql/sql-functions/math-functions/ceil.adoc[`ceil()`] |This function rounds up to the nearest positive or negative integer value greater than or equal to the argument +|xref:reference:sql/sql-functions/math-functions/exp.adoc[`exp()`] |This function returns the exponential value of a number specified in the argument +|xref:reference:sql/sql-functions/math-functions/floor.adoc[`floor()`] |This function returns a number rounded down that is less than or equal to the specified argument +|xref:reference:sql/sql-functions/math-functions/greatest.adoc[`greatest()`] |This function extracts the greatest or largest value from a set of values. +|xref:reference:sql/sql-functions/math-functions/least.adoc[`least()`] |This function returns the least or smallest value in a list of values +|xref:reference:sql/sql-functions/math-functions/ln.adoc[`ln()`] |This function returns the exponential value of its argument +|xref:reference:sql/sql-functions/math-functions/log.adoc[`log()`] |This function returns the base-10 logarithm or logarithm of the specified base of a given number +|xref:reference:sql/sql-functions/math-functions/power.adoc[`power()`] |This function returns the value of a number raised to the power of another number specified in the arguments +|xref:reference:sql/sql-functions/math-functions/random.adoc[`random()`] |This function returns a random number between 0 (inclusive) and 1 (exclusive) +|xref:reference:sql/sql-functions/math-functions/round.adoc[`round()`] |This function rounds numbers to the nearest integer or to a specified number of decimal places +|xref:reference:sql/sql-functions/math-functions/sign.adoc[`sign()`] |This function returns -1 for negative arguments, 1 for positive arguments or 0 if the argument is 0 +|xref:reference:sql/sql-functions/math-functions/sqrt.adoc[`sqrt()`] |This function returns the square root of its argument +|xref:reference:sql/sql-functions/math-functions/to-char-from-number.adoc[`to_char()` from Number] |Formats a number into a string using a given format |=== == Trigonometric functions diff --git a/modules/reference/pages/sql/sql-functions/math-functions/least.adoc b/modules/reference/pages/sql/sql-functions/math-functions/least.adoc index 89e22ee2c..06ce640a2 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/least.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/least.adoc @@ -1,14 +1,14 @@ = least -:description: The LEAST() function returns the least or smallest value in a list of values. +:description: The `least()` function returns the least or smallest value in a list of values. :page-topic-type: reference -The `LEAST()` function returns the least or smallest value in a list of values. It needs at least one argument to work with. If different types are mixed, like a text and a number, it returns an error. +The `least()` function returns the least or smallest value in a list of values. It needs at least one argument to work with. If different types are mixed, like a text and a number, it returns an error. For example, comparing the greatest value among 4, "`two`", and 9 would result in an error. == Syntax -The syntax for the `LEAST()` function is: +The syntax for the `least()` function is: [source,sql] ---- @@ -29,7 +29,7 @@ Where: == Examples -These examples show how to use the `LEAST()` function: +These examples show how to use the `least()` function: === Basic usage diff --git a/modules/reference/pages/sql/sql-functions/math-functions/ln.adoc b/modules/reference/pages/sql/sql-functions/math-functions/ln.adoc index 75db58e78..ecb2f2e69 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/ln.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/ln.adoc @@ -1,17 +1,17 @@ = ln -:description: The LN() function returns the natural logarithm of its argument. +:description: The `ln()` function returns the natural logarithm of its argument. :page-topic-type: reference -The `LN()` function returns the natural logarithm of its argument. +The `ln()` function returns the natural logarithm of its argument. [NOTE] ==== -`LN()` does not accept negative numbers or zero. +`ln()` does not accept negative numbers or zero. ==== == Syntax -The syntax of the `LN()` function is: +The syntax of the `ln()` function is: [source,sql] ---- @@ -22,7 +22,7 @@ LN (x) == Examples -=== Basic LN() function +=== Basic `ln()` function The following example returns the natural logarithm of `7.87653`: @@ -42,9 +42,9 @@ The query returns: +-------------+ ---- -=== Use LN() function with a table +=== Use `ln()` function with a table -This example combines the `LN()` function with a `CREATE TABLE` statement to obtain natural logarithmic values of a specific column: +This example combines the `ln()` function with a `CREATE TABLE` statement to obtain natural logarithmic values of a specific column: . Create a new table named `LNtable` with an integer `initValue` column. + diff --git a/modules/reference/pages/sql/sql-functions/math-functions/log.adoc b/modules/reference/pages/sql/sql-functions/math-functions/log.adoc index 5a05d1835..ba4b116a1 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/log.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/log.adoc @@ -1,12 +1,12 @@ = log -:description: The LOG() function returns the base-10 logarithm or logarithm of the specified base of a given number. +:description: The `log()` function returns the base-10 logarithm or logarithm of the specified base of a given number. :page-topic-type: reference -The `LOG()` function returns the base-10 logarithm or logarithm of the specified base of a given number. +The `log()` function returns the base-10 logarithm or logarithm of the specified base of a given number. == Syntax -This example illustrates the syntax of the `LOG()` function: +This example illustrates the syntax of the `log()` function: [source,sql] ---- @@ -27,7 +27,7 @@ Where: ==== Basic usage -In this case, the `LOG()` function calculates the base-10 logarithm of a specified number. +In this case, the `log()` function calculates the base-10 logarithm of a specified number. [source,sql] ---- @@ -45,7 +45,7 @@ The query returns: ==== Negative value -In this example, the `LOG()` function is applied to negative numbers. +In this example, the `log()` function is applied to negative numbers. [source,sql] ---- @@ -63,7 +63,7 @@ Any input of negative values returns a `NaN` result. ==== NULL value -The `LOG()` function will return `NULL` if the argument is `NULL`. +The `log()` function will return `NULL` if the argument is `NULL`. [source,sql] ---- @@ -80,7 +80,7 @@ A null result is returned when an argument passed is null. ==== Zero value -In this example, the `LOG()` takes zero as an argument. +In this example, the `log()` takes zero as an argument. [source,sql] ---- @@ -100,7 +100,7 @@ The query returns: ==== Basic usage -In this case, the `LOG()` function calculates the logarithm of a specified number. +In this case, the `log()` function calculates the logarithm of a specified number. [source,sql] ---- @@ -152,7 +152,7 @@ SELECT * FROM data; Data 5 | 50 | 10 ---- -Use the `LOG()` function to calculate the logarithm of column *_x_* (as a base) and column _y_ (as a number): +Use the `log()` function to calculate the logarithm of column *_x_* (as a base) and column _y_ (as a number): [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/math-functions/power.adoc b/modules/reference/pages/sql/sql-functions/math-functions/power.adoc index e512528ad..1bf146a38 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/power.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/power.adoc @@ -1,12 +1,12 @@ = power -:description: The POWER() function calculates the value of a number raised to the power of another number specified in the arguments. +:description: The `power()` function calculates the value of a number raised to the power of another number specified in the arguments. :page-topic-type: reference -The `POWER()` function calculates the value of a number raised to the power of another number specified in the arguments. +The `power()` function calculates the value of a number raised to the power of another number specified in the arguments. == Syntax -This example shows the syntax of the `POWER()` function: +This example shows the syntax of the `power()` function: [source,sql] ---- @@ -21,7 +21,7 @@ Where: == Examples === Basic usage -In this case, the `POWER()` function calculates the result of raising one number to the power of another. +In this case, the `power()` function calculates the result of raising one number to the power of another. [source,sql] ---- @@ -38,9 +38,9 @@ The query returns: 81 | 343 ---- -=== Use `POWER()` with negative values +=== Use `power()` with negative values -In this case, the `POWER()` function is applied to negative numbers. +In this case, the `power()` function is applied to negative numbers. [source,sql] ---- @@ -56,9 +56,9 @@ The query returns: -1024 | 1 | 0 ---- -=== Use `POWER()` with floating-point numbers +=== Use `power()` with floating-point numbers -In this example, use the `POWER()` function to calculate 2.5 raised to the power of 3.0. +In this example, use the `power()` function to calculate 2.5 raised to the power of 3.0. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/math-functions/random.adoc b/modules/reference/pages/sql/sql-functions/math-functions/random.adoc index 09adda53e..ad0f50d8b 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/random.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/random.adoc @@ -1,12 +1,12 @@ = random -:description: The RANDOM() function in Redpanda SQL generates a random number within a defined range. +:description: The `random()` function in Redpanda SQL generates a random number within a defined range. :page-topic-type: reference -The `RANDOM()` function in Redpanda SQL generates a random number within a defined range. By default, the range is between 0 (inclusive) and 1 (exclusive), resulting in a value greater than or equal to 0 and less than 1. +The `random()` function in Redpanda SQL generates a random number within a defined range. By default, the range is between 0 (inclusive) and 1 (exclusive), resulting in a value greater than or equal to 0 and less than 1. == Syntax -The syntax for generating a random integer or floating-point number using the `RANDOM()` function is: +The syntax for generating a random integer or floating-point number using the `random()` function is: [source,sql] ---- @@ -15,14 +15,14 @@ RANDOM() [NOTE] ==== -There are no parameters or arguments for the `RANDOM()` function. +There are no parameters or arguments for the `random()` function. ==== == Examples === Generate a random number -The RANDOM() function generates a random number greater than or equal to zero but less than one by default. Use this syntax to retrieve a random number: +The `random()` function generates a random number greater than or equal to zero but less than one by default. Use this syntax to retrieve a random number: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/math-functions/round.adoc b/modules/reference/pages/sql/sql-functions/math-functions/round.adoc index 0d201cf50..e9d42ddc0 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/round.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/round.adoc @@ -1,8 +1,8 @@ = round -:description: The ROUND() function rounds numbers using round half to even method (bankers rounding). +:description: The `round()` function rounds numbers using round half to even method (bankers rounding). :page-topic-type: reference -The `ROUND()` function rounds numbers using round half to even method (bankers rounding). +The `round()` function rounds numbers using round half to even method (bankers rounding). == Syntax diff --git a/modules/reference/pages/sql/sql-functions/math-functions/sign.adoc b/modules/reference/pages/sql/sql-functions/math-functions/sign.adoc index 6d57bf6c4..c087a9232 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/sign.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/sign.adoc @@ -1,19 +1,19 @@ = sign -:description: The SIGN() function returns a sign of an argument. +:description: The `sign()` function returns a sign of an argument. :page-topic-type: reference -The `SIGN()` function returns a sign of an argument. The returned values are -1 if the argument is less than zero, 1 if the argument is greater than zero, 0 if the argument is equal to zero. +The `sign()` function returns a sign of an argument. The returned values are -1 if the argument is less than zero, 1 if the argument is greater than zero, 0 if the argument is equal to zero. == Syntax -The syntax for the `SIGN()` function is: +The syntax for the `sign()` function is: [source,sql] ---- SIGN(x) ---- -The `SIGN()` function requires one argument: +The `sign()` function requires one argument: * `x`: An expression that evaluates to a number. @@ -21,7 +21,7 @@ The `SIGN()` function requires one argument: === Sign of a number -This example demonstrates how the `SIGN()` function can be used to obtain the sign of a number: +This example demonstrates how the `sign()` function can be used to obtain the sign of a number: [source,sql] ---- @@ -43,9 +43,9 @@ The query will return the signs of the passed arguments: Note: `-0` is accepted as an argument and is equal to zero -=== SIGN() function with an expression +=== `sign()` function with an expression -This example demonstrates how to use the `SIGN()` function with an expression: +This example demonstrates how to use the `sign()` function with an expression: [source,sql] ---- @@ -62,9 +62,9 @@ will return the sign of the expression evaluation: ------ ---- -=== Use the SIGN() function with a table +=== Use the `sign()` function with a table -This example demonstrates how to use the `SIGN()` function with a table to obtain the absolute values of all numbers in a specific column: +This example demonstrates how to use the `sign()` function with a table to obtain the absolute values of all numbers in a specific column: . Create a table signTable containing an *_value_* column with some positive, negative and equal to zero values: + diff --git a/modules/reference/pages/sql/sql-functions/math-functions/sin.adoc b/modules/reference/pages/sql/sql-functions/math-functions/sin.adoc index 5936f8ab7..f1f272c6a 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/sin.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/sin.adoc @@ -1,19 +1,19 @@ = sin -:description: SIN() is a numeric function that returns the trigonometric sine value of a specified angle in radians. +:description: `sin()` is a numeric function that returns the trigonometric sine value of a specified angle in radians. :page-topic-type: reference -`SIN()` is a numeric function that returns the trigonometric sine value of a specified angle in radians. +`sin()` is a numeric function that returns the trigonometric sine value of a specified angle in radians. == Syntax -The syntax of the `SIN()` function is: +The syntax of the `sin()` function is: [source,sql] ---- SIN (x) ---- -The `SIN()` function requires one argument: +The `sin()` function requires one argument: `x`: A positive or a negative angle (or an expression that evaluates to an angle). @@ -21,7 +21,7 @@ The `SIN()` function requires one argument: === Sine a positive value -This example uses the `SIN()` function with a positive angle as the argument. +This example uses the `sin()` function with a positive angle as the argument. [source,sql] ---- @@ -41,7 +41,7 @@ This returns the sine value of 5. === Sine a negative value -This example shows the `SIN()` function with a negative angle as the argument: +This example shows the `sin()` function with a negative angle as the argument: [source,sql] ---- @@ -61,7 +61,7 @@ The query returns: === Sine a fraction value -This example shows the `SIN()` function with a fractional value as the argument: +This example shows the `sin()` function with a fractional value as the argument: [source,sql] ---- @@ -81,7 +81,7 @@ The query returns: === Sine with an expression -The `SIN()` function can also include an expression: +The `sin()` function can also include an expression: [source,sql] ---- @@ -99,9 +99,9 @@ The query returns: +-----------------------+ ---- -=== Use the `SIN()` function with a table +=== Use the `sin()` function with a table -This example combines the `SIN()` function with a `CREATE TABLE` statement to obtain the sine values of a specific column: +This example combines the `sin()` function with a `CREATE TABLE` statement to obtain the sine values of a specific column: . Create a new table named *sineTable* containing the *initialValue* column. Input some values with the negative and positive angles into the column. + diff --git a/modules/reference/pages/sql/sql-functions/math-functions/sinh.adoc b/modules/reference/pages/sql/sql-functions/math-functions/sinh.adoc index 3f50731a8..7daeec145 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/sinh.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/sinh.adoc @@ -1,8 +1,8 @@ = sinh -:description: The SINH() function returns the hyperbolic sine of a specified numeric argument. +:description: The `sinh()` function returns the hyperbolic sine of a specified numeric argument. :page-topic-type: reference -The `SINH()` function returns the hyperbolic sine of a specified numeric argument. +The `sinh()` function returns the hyperbolic sine of a specified numeric argument. == Syntax diff --git a/modules/reference/pages/sql/sql-functions/math-functions/sqrt.adoc b/modules/reference/pages/sql/sql-functions/math-functions/sqrt.adoc index 5b09b5880..e1329c719 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/sqrt.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/sqrt.adoc @@ -1,27 +1,27 @@ = sqrt -:description: The SQRT() function returns the square root of a given positive number. +:description: The `sqrt()` function returns the square root of a given positive number. :page-topic-type: reference -The `SQRT()` function returns the square root of a given positive number. +The `sqrt()` function returns the square root of a given positive number. == Syntax -The syntax for the `SQRT()` function in Redpanda SQL is: +The syntax for the `sqrt()` function in Redpanda SQL is: [source,sql] ---- SQRT(x) ---- -The `SQRT()` function requires one argument: +The `sqrt()` function requires one argument: * `x`: A positive number or an expression that evaluates to a positive number. == Examples -=== SQRT() a positive value +=== `sqrt()` a positive value -This example demonstrates how to find the square root of a positive integer with `SQRT()`: +This example demonstrates how to find the square root of a positive integer with `sqrt()`: [source,sql] ---- @@ -39,9 +39,9 @@ The returned result: +-----+ ---- -=== SQRT() with an expression +=== `sqrt()` with an expression -This example shows how to use the `SQRT()` function to find the square root of the result of an expression: +This example shows how to use the `sqrt()` function to find the square root of the result of an expression: [source,sql] ---- @@ -59,7 +59,7 @@ The result of this statement is the square root of 64: +-----+ ---- -=== SQRT() with double precision result +=== `sqrt()` with double precision result In addition to integers, Redpanda SQL also supports calculating square roots with floating-point numbers as the outcome, as shown in this example: @@ -79,16 +79,16 @@ The output of this statement is 8.3666, which is the square root of 70 with doub +----------+ ---- -=== SQRT() a negative number +=== `sqrt()` a negative number -This example demonstrates how attempting to use the `SQRT()` function with a negative value returns an error: +This example demonstrates how attempting to use the `sqrt()` function with a negative value returns an error: [source,sql] ---- SELECT SQRT(-25); ---- -As the `SQRT()` function only accepts positive numbers, it returns a *_NaN (Not a Number)_* result for the square root of -25: +As the `sqrt()` function only accepts positive numbers, it returns a *_NaN (Not a Number)_* result for the square root of -25: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/math-functions/to-char-from-number.adoc b/modules/reference/pages/sql/sql-functions/math-functions/to-char-from-number.adoc index cf11f4cf3..4904e4024 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/to-char-from-number.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/to-char-from-number.adoc @@ -2,7 +2,7 @@ :description: The TO_CHAR function formats a number into a string using a given format. :page-topic-type: reference -The `TO_CHAR` function formats a number into a string using a given format. +The `to_char` function formats a number into a string using a given format. == Syntax diff --git a/modules/reference/pages/sql/sql-functions/other-functions/coalesce.adoc b/modules/reference/pages/sql/sql-functions/other-functions/coalesce.adoc index c6bb4f2e4..0e597f8a5 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/coalesce.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/coalesce.adoc @@ -1,12 +1,12 @@ = coalesce -:description: The COALESCE() function returns the first non-NULL argument from a list of arguments. +:description: The `coalesce()` function returns the first non-NULL argument from a list of arguments. :page-topic-type: reference -The `COALESCE()` function returns the first non-NULL argument from a list of arguments. After finding the first non-NULL argument, the function stops evaluating the remaining arguments. +The `coalesce()` function returns the first non-NULL argument from a list of arguments. After finding the first non-NULL argument, the function stops evaluating the remaining arguments. [NOTE] ==== -If all arguments are NULL, `COALESCE()` returns NULL. +If all arguments are NULL, `coalesce()` returns NULL. ==== == Syntax @@ -20,17 +20,17 @@ COALESCE (argument_1, argument_2, …); Key points from the syntax: -* `COALESCE()` requires a minimum of two inputs. +* `coalesce()` requires a minimum of two inputs. * It can take an unlimited number of arguments. * Evaluation occurs sequentially from left to right, stopping at the first non-null value. == Examples -Here are some examples to illustrate the application of `COALESCE()`: +Here are some examples to illustrate the application of `coalesce()`: === Return the first non-null value -In this example, a set of values is provided. The `COALESCE()` function returns the first non-null value from this set. +In this example, a set of values is provided. The `coalesce()` function returns the first non-null value from this set. [source,sql] ---- @@ -91,7 +91,7 @@ In this query, NULL appears in the first, second, fourth, and last positions: Select COALESCE(NULL, NULL ,3, NULL, 7,9,4,5, NULL); ---- -The `COALESCE()` function ignores the first two NULLs and returns the first non-null value, `3`. It does not process the subsequent NULL values. +The `coalesce()` function ignores the first two NULLs and returns the first non-null value, `3`. It does not process the subsequent NULL values. [source,sql] ---- @@ -109,7 +109,7 @@ Assume that the given values are entirely composed of nulls. Select COALESCE(NULL, NULL ,NULL, NULL); ---- -In this case, the `COALESCE()` function returns an empty value (NULL). +In this case, the `coalesce()` function returns an empty value (NULL). [source,sql] ---- @@ -117,7 +117,7 @@ In this case, the `COALESCE()` function returns an empty value (NULL). ---------- ---- -=== `COALESCE()` with table data +=== `coalesce()` with table data Consider the `employee_absent` table, which comprises a mix of NULL and non-null values: @@ -156,7 +156,7 @@ SELECT * FROM employee_absent; Emily | HR | ---- -The following query uses the `COALESCE()` function on the `absent` column. It retrieves names and absences (with `out of office` for NULL values) for each employee. +The following query uses the `coalesce()` function on the `absent` column. It retrieves names and absences (with `out of office` for NULL values) for each employee. [source,sql] ---- @@ -174,7 +174,7 @@ SELECT emp_name, COALESCE(absent, 'out of office') AS DisplayAbsent FROM employe Emily | out of office ---- -=== Error output in `COALESCE()` +=== Error output in `coalesce()` When specifying arguments with different datatypes, they should be convertible. @@ -183,7 +183,7 @@ When specifying arguments with different datatypes, they should be convertible. Select Coalesce ('x',NULL,1); ---- -If the datatypes cannot be converted, the `COALESCE()` function generates an error. +If the datatypes cannot be converted, the `coalesce()` function generates an error. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/other-functions/generate-series.adoc b/modules/reference/pages/sql/sql-functions/other-functions/generate-series.adoc index 0f2cfa0c0..54dd07045 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/generate-series.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/generate-series.adoc @@ -1,8 +1,8 @@ = generate_series -:description: The GENERATE_SERIES function generates a set of values from start to stop with an optional step increment. +:description: The `generate_series` function generates a set of values from start to stop with an optional step increment. :page-topic-type: reference -The `GENERATE_SERIES` function generates a set of values from a start value to a stop value with an optional step increment. Use it as a table function in the `FROM` clause. +The `generate_series` function generates a set of values from a start value to a stop value with an optional step increment. Use it as a table function in the `FROM` clause. == Syntax @@ -14,9 +14,9 @@ GENERATE_SERIES(start, stop, step) == Arguments -* `start`: The first value in the series. Type: `BIGINT`. -* `stop`: The last value in the series (inclusive). Type: `BIGINT`. -* `step`: Optional. The increment between values. Defaults to `1`. Use a negative value to generate a descending series. Type: `BIGINT`. +* `start`: The first value in the series. Type: `bigint`. +* `stop`: The last value in the series (inclusive). Type: `bigint`. +* `step`: Optional. The increment between values. Defaults to `1`. Use a negative value to generate a descending series. Type: `bigint`. If `step` is positive and `start` is greater than `stop`, an empty set is returned. If `step` is negative and `start` is less than `stop`, an empty set is returned. diff --git a/modules/reference/pages/sql/sql-functions/other-functions/nullif.adoc b/modules/reference/pages/sql/sql-functions/other-functions/nullif.adoc index 91015f5be..12b6b6c38 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/nullif.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/nullif.adoc @@ -1,8 +1,8 @@ = nullif -:description: The NULLIF() function replaces a given value with NULL if it matches a specific criterion. +:description: The `nullif()` function replaces a given value with NULL if it matches a specific criterion. :page-topic-type: reference -The `NULLIF()` function replaces a given value with NULL if it matches a specific criterion. +The `nullif()` function replaces a given value with NULL if it matches a specific criterion. == Syntax @@ -11,21 +11,21 @@ The `NULLIF()` function replaces a given value with NULL if it matches a specifi NULLIF(argument_1,argument_2); ---- -The `NULLIF` function takes two arguments: +The `nullif` function takes two arguments: * The first argument is the value to evaluate. * The second argument is the value to treat as NULL if the first argument matches it. [TIP] ==== -If the first argument matches the second argument, the `NULLIF()` function returns `NULL`. Otherwise, it returns the first argument as-is. +If the first argument matches the second argument, the `nullif()` function returns `NULL`. Otherwise, it returns the first argument as-is. ==== == Examples === Handle equal values -In this case, the `NULLIF` function compares the values 4 and 4. +In this case, the `nullif` function compares the values 4 and 4. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/string-functions/concat.adoc b/modules/reference/pages/sql/sql-functions/string-functions/concat.adoc index 1f690fe9a..92232d4c2 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/concat.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/concat.adoc @@ -1,16 +1,16 @@ = concat -:description: Use the CONCAT() function to concatenate one or more input values into a single result. +:description: Use the `concat()` function to concatenate one or more input values into a single result. :page-topic-type: reference -Use the `CONCAT()` function to concatenate one or more input values into a single result. It supports all data types in Redpanda SQL, except `TIMESTAMPTZ`. The output is returned as a concatenation of the input values. +Use the `concat()` function to concatenate one or more input values into a single result. It supports all data types in Redpanda SQL, except `TIMESTAMPTZ`. The output is returned as a concatenation of the input values. *Special cases:* Returns `NULL` if there are no input rows or `NULL` values. == Examples -=== Basic `CONCAT()` function +=== Basic `concat()` function -This example uses the `CONCAT()` function to concatenate three values = into a single result: +This example uses the `concat()` function to concatenate three values = into a single result: [source,sql] ---- @@ -28,7 +28,7 @@ The query returns: +------------+ ---- -=== `CONCAT()` function using column +=== `concat()` function using column This example uses a *payment* table that stores customer payment data: @@ -97,16 +97,16 @@ This displays an output where spaces separate the first and last names. +-----------------+ ---- -=== CONCAT() function with NULL +=== `concat()` function with NULL -This example shows how to use the `CONCAT()` function to concatenate a string with a `NULL` value: +This example shows how to use the `concat()` function to concatenate a string with a `NULL` value: [source,sql] ---- SELECT CONCAT('Talent Source ',NULL) AS "concat"; ---- -The result shows that the `CONCAT` function will skip the `NULL` value: +The result shows that the `concat` function will skip the `NULL` value: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/string-functions/ends-with.adoc b/modules/reference/pages/sql/sql-functions/string-functions/ends-with.adoc index 341504e16..983d75406 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/ends-with.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/ends-with.adoc @@ -1,8 +1,8 @@ = ends_with -:description: The ENDS_WITH() function determines whether the first argument ends with a specified string in the second argument or not. +:description: The `ends_with()` function determines whether the first argument ends with a specified string in the second argument or not. :page-topic-type: reference -The `ENDS_WITH()` function determines whether the first argument ends with a specified string in the second argument or not. +The `ends_with()` function determines whether the first argument ends with a specified string in the second argument or not. [source,sql] ---- @@ -12,7 +12,7 @@ ENDS_WITH(first_argument, 'second_argument') * `first_argument`: The search reference. Can be a string or a column name. * `second_argument`: The specified argument, which will have the search keywords. -The input type will be `STRING`, and the return type is `BOOL`, shown as `true` or `false`. +The input type will be `STRING`, and the return type is `bool`, shown as `true` or `false`. *Special case:* @@ -21,7 +21,7 @@ The input type will be `STRING`, and the return type is `BOOL`, shown as `true` == Examples -=== `ENDS_WITH()` function using column +=== `ends_with()` function using column Consider a table named *courses*: @@ -90,7 +90,7 @@ This returns true to all the courses with the name ending with **ology.** Otherw +----------------------------------+-------------+ ---- -=== `ENDS_WITH()` function with no specified argument +=== `ends_with()` function with no specified argument The **patients_data** table has a `NULL` value in the *allergies* column: @@ -131,14 +131,14 @@ SELECT * FROM patients_data; +----------------+---------------------+---------------+--------------+-------------+ ---- -For example, run the `ENDS_WITH` function but with no specified `second_argument`: +For example, run the `ends_with` function but with no specified `second_argument`: [source,sql] ---- SELECT allergies, ENDS_WITH(allergies, '') FROM patients_data; ---- -The result shows that `ENDS_WITH` returns true for all records (even the `NULL` one): +The result shows that `ends_with` returns true for all records (even the `NULL` one): [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/string-functions/index.adoc b/modules/reference/pages/sql/sql-functions/string-functions/index.adoc index 83772e07c..4bc064a93 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/index.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/index.adoc @@ -8,18 +8,18 @@ Use string functions to analyze and manipulate string values. Redpanda SQL suppo [width="100%",cols="20%,80%",options="header",] |=== |*Function* |*Description* -|xref:reference:sql/sql-functions/string-functions/length.adoc[LENGTH()] |Returns the number of characters in a string -|xref:reference:sql/sql-functions/string-functions/lower.adoc[LOWER()] |Makes string lowercase -|xref:reference:sql/sql-functions/string-functions/upper.adoc[UPPER()] |Makes string upper case -|xref:reference:sql/sql-functions/string-functions/starts-with.adoc[STARTS_WITH()] |Checks if a string starts with a specified substring -|xref:reference:sql/sql-functions/string-functions/ends-with.adoc[ENDS_WITH()] |Checks if a string ends with a specified substring -|xref:reference:sql/sql-functions/string-functions/concat.adoc[CONCAT()] |Adds two or more strings together -|xref:reference:sql/sql-functions/string-functions/substr.adoc[SUBSTR()] |Extracts a substring from a string -|xref:reference:sql/sql-functions/string-functions/strpos.adoc[STRPOS()] |Finds the position at which the substring starts within the string -|xref:reference:sql/sql-functions/string-functions/regex/regexp-match.adoc[REGEXP_MATCH()] |Matches a POSIX regular expression pattern to a string -|xref:reference:sql/sql-functions/string-functions/regex/regexp-replace.adoc[REGEXP_REPLACE()] |Substitutes new text for substrings that match POSIX regular expression patterns -|xref:reference:sql/sql-functions/string-functions/replace.adoc[REPLACE()] |Finds and replace occurences of a substring in a string -|xref:reference:sql/sql-functions/string-functions/position.adoc[POSITION()] |Returns the position of the first occurrence of a substring in a string +|xref:reference:sql/sql-functions/string-functions/length.adoc[`length()`] |Returns the number of characters in a string +|xref:reference:sql/sql-functions/string-functions/lower.adoc[`lower()`] |Makes string lowercase +|xref:reference:sql/sql-functions/string-functions/upper.adoc[`upper()`] |Makes string upper case +|xref:reference:sql/sql-functions/string-functions/starts-with.adoc[`starts_with()`] |Checks if a string starts with a specified substring +|xref:reference:sql/sql-functions/string-functions/ends-with.adoc[`ends_with()`] |Checks if a string ends with a specified substring +|xref:reference:sql/sql-functions/string-functions/concat.adoc[`concat()`] |Adds two or more strings together +|xref:reference:sql/sql-functions/string-functions/substr.adoc[`substr()`] |Extracts a substring from a string +|xref:reference:sql/sql-functions/string-functions/strpos.adoc[`strpos()`] |Finds the position at which the substring starts within the string +|xref:reference:sql/sql-functions/string-functions/regex/regexp-match.adoc[`regexp_match()`] |Matches a POSIX regular expression pattern to a string +|xref:reference:sql/sql-functions/string-functions/regex/regexp-replace.adoc[`regexp_replace()`] |Substitutes new text for substrings that match POSIX regular expression patterns +|xref:reference:sql/sql-functions/string-functions/replace.adoc[`replace()`] |Finds and replace occurences of a substring in a string +|xref:reference:sql/sql-functions/string-functions/position.adoc[`position()`] |Returns the position of the first occurrence of a substring in a string |=== == String operators diff --git a/modules/reference/pages/sql/sql-functions/string-functions/length.adoc b/modules/reference/pages/sql/sql-functions/string-functions/length.adoc index d746d1e92..d2ffa0935 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/length.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/length.adoc @@ -1,8 +1,8 @@ = length -:description: Use the LENGTH() function to find the length of a string (for example, the number of characters in a given string). +:description: Use the `length()` function to find the length of a string (for example, the number of characters in a given string). :page-topic-type: reference -Use the `LENGTH()` function to find the length of a string(for example, the number of characters in a given string). It accepts a string as a parameter. The syntax of the length function is: +Use the `length()` function to find the length of a string(for example, the number of characters in a given string). It accepts a string as a parameter. The syntax of the length function is: [source,sql] ---- @@ -19,9 +19,9 @@ The input type is a string, and the return type is int, as it returns the number == Examples -=== Basic `LENGTH()` function +=== Basic `length()` function -This example uses the `LENGTH()` function to find out the length of a string text: +This example uses the `length()` function to find out the length of a string text: [source,sql] ---- @@ -39,9 +39,9 @@ The query returns: +------------+ ---- -=== `LENGTH()` function using columns +=== `length()` function using columns -The following example uses the `LENGTH()` function on a `personal_details` table containing `id`, `first_name`, `last_name`, and `gender` columns for retail store employees. +The following example uses the `length()` function on a `personal_details` table containing `id`, `first_name`, `last_name`, and `gender` columns for retail store employees. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/string-functions/lower.adoc b/modules/reference/pages/sql/sql-functions/string-functions/lower.adoc index fa5c4eeb8..068d867ab 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/lower.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/lower.adoc @@ -1,8 +1,8 @@ = lower -:description: The LOWER() function returns a given string, an expression, or values in a column in all lowercase letters. +:description: The `lower()` function returns a given string, an expression, or values in a column in all lowercase letters. :page-topic-type: reference -The LOWER() function returns a given string, an expression, or values in a column in all lowercase letters. The syntax of the function is: +The `lower()` function returns a given string, an expression, or values in a column in all lowercase letters. The syntax of the function is: [source,sql] ---- @@ -11,7 +11,7 @@ LOWER(string) It accepts input as a string and returns the text in the lowercase alphabet. -*Special Cases:* If there are characters in the input which are not of type string, they remain unaffected by the LOWER()function. +*Special Cases:* If there are characters in the input which are not of type string, they remain unaffected by the `lower()`function. [NOTE] ==== @@ -20,7 +20,7 @@ Unicode is supported so that the ß is equivalent to the string ss. == Examples -=== Basic `LOWER()` function +=== Basic `lower()` function This basic query shows how to convert the given string in all lowercase alphabets: @@ -40,9 +40,9 @@ The query returns: +------------+ ---- -=== `LOWER()` function using columns +=== `lower()` function using columns -This example shows how the `LOWER()` function works with columns. The *personal_details* table contains columns *id*, *first_name*, *last_name*, and *gender* of retail store employees. +This example shows how the `lower()` function works with columns. The *personal_details* table contains columns *id*, *first_name*, *last_name*, and *gender* of retail store employees. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/string-functions/position.adoc b/modules/reference/pages/sql/sql-functions/string-functions/position.adoc index 3c641c85b..4526b2d2d 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/position.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/position.adoc @@ -1,8 +1,8 @@ = position -:description: The POSITION() function returns the position of the first occurrence of a substring in a string. +:description: The `position()` function returns the position of the first occurrence of a substring in a string. :page-topic-type: reference -The `POSITION()` function returns the position of the first occurrence of a substring in a string. It works the same as xref:reference:sql/sql-functions/string-functions/strpos.adoc[STRPOS], but it has slightly different syntax. +The `position()` function returns the position of the first occurrence of a substring in a string. It works the same as xref:reference:sql/sql-functions/string-functions/strpos.adoc[STRPOS], but it has slightly different syntax. == Syntax diff --git a/modules/reference/pages/sql/sql-functions/string-functions/regex/regexp-match.adoc b/modules/reference/pages/sql/sql-functions/string-functions/regex/regexp-match.adoc index 780a16638..a06a20103 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/regex/regexp-match.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/regex/regexp-match.adoc @@ -1,12 +1,12 @@ = regexp_match -:description: The REGEXP_MATCH() function matches a POSIX regular expression pattern to a string. +:description: The `regexp_match()` function matches a POSIX regular expression pattern to a string. :page-topic-type: reference -The `REGEXP_MATCH()` function matches a POSIX regular expression pattern to a string. It returns an array of `TEXT[]` type with substring(s) of matched groups within the first match. +The `regexp_match()` function matches a POSIX regular expression pattern to a string. It returns an array of `TEXT[]` type with substring(s) of matched groups within the first match. == Syntax -The syntax for `REGEXP_MATCH()` function is: +The syntax for `regexp_match()` function is: [source,sql] ---- @@ -17,12 +17,12 @@ REGEXP_MATCH(source_string, pattern, [flags]) * `source_string`: String on which to perform the match. * `pattern`: POSIX regular expression pattern to match. -* `flags`: Optional. Flags that change the matching behavior of `REGEXP_MATCH()`. +* `flags`: Optional. Flags that change the matching behavior of `regexp_match()`. The `flags` parameter is an optional string that controls how the function operates. Here is a list of flags that are supported by Redpanda SQL: * `i`: Use this flag for case-insensitive matching. -* `c`: `REGEXP_MATCH()` function is case-sensitive by default, using the `c` flag has the same effect as having no flags at all. +* `c`: `regexp_match()` function is case-sensitive by default, using the `c` flag has the same effect as having no flags at all. [NOTE] ==== @@ -50,7 +50,7 @@ SELECT REGEXP_MATCH('Contact us at hello@example.com', '[a-zA-Z0-9._%+-]+@[a-zA- === Match multiple groups -The `REGEXP_MATCH()` function can capture multiple groups within a match, which extracts key parts from a string in a structured way. This example shows how to extract the protocol, domain and path from a given URL: +The `regexp_match()` function can capture multiple groups within a match, which extracts key parts from a string in a structured way. This example shows how to extract the protocol, domain and path from a given URL: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/string-functions/regex/regexp-replace.adoc b/modules/reference/pages/sql/sql-functions/string-functions/regex/regexp-replace.adoc index 027523961..2d8e5e0e5 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/regex/regexp-replace.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/regex/regexp-replace.adoc @@ -1,12 +1,12 @@ = regexp_replace -:description: The REGEXP_REPLACE() function replaces all occurrences of a regular expression pattern in a string with a specified replacement string. +:description: The `regexp_replace()` function replaces all occurrences of a regular expression pattern in a string with a specified replacement string. :page-topic-type: reference -The `REGEXP_REPLACE()` function replaces all occurrences of a regular expression pattern in a string with a specified replacement string. +The `regexp_replace()` function replaces all occurrences of a regular expression pattern in a string with a specified replacement string. == Syntax -The syntax for `REGEXP_REPLACE()` function is: +The syntax for `regexp_replace()` function is: [source,sql] ---- @@ -18,19 +18,19 @@ REGEXP_REPLACE(source_string, pattern, replacement, [flags]) * `source_string`: String on which to perform the replacement. * `pattern`: POSIX regular expression pattern to match. * `replacement`: Replacement string. -* `flags`: Optional. Flags that change the matching behavior of `REGEXP_REPLACE()`. +* `flags`: Optional. Flags that change the matching behavior of `regexp_replace()`. The `flags` parameter is an optional string that controls how the function operates. Here is a list of flags supported in Redpanda SQL: * `g`: Global replacement. This flag ensures that all occurrences of the pattern are replaced. * `i`: Use this flag for case-insensitive matching. -* `c`: `REGEXP_REPLACE()` function is case-sensitive by default, using the `c` flag has the same effect as using no flags. +* `c`: `regexp_replace()` function is case-sensitive by default, using the `c` flag has the same effect as using no flags. == Examples === Basic function usage -This example uses the `REGEXP_REPLACE()` function with a basic POSIX regular expression pattern: +This example uses the `regexp_replace()` function with a basic POSIX regular expression pattern: [source,sql] ---- @@ -70,7 +70,7 @@ In this query, the second parameter is a regular expression *"[^A-Za-z0-9 ]"* th ==== Replace certain substrings with a single flag defined -This example uses the `REGEXP_REPLACE()` function with a defined flag to replace certain substrings in a string. First, create a sample `quotes` table: +This example uses the `regexp_replace()` function with a defined flag to replace certain substrings in a string. First, create a sample `quotes` table: [source,sql] ---- @@ -95,7 +95,7 @@ The query returns: (3 rows) ---- -Now, use the `REGEXP_REPLACE()` function with the `i` flag specified to replace all occurrences of the word `lazy` with `active` regardless of case sensitivity: +Now, use the `regexp_replace()` function with the `i` flag specified to replace all occurrences of the word `lazy` with `active` regardless of case sensitivity: [source,sql] ---- @@ -116,7 +116,7 @@ In this case, all occurrences of the word `lazy` have been replaced with `active === Specify one or more flags -Without specifying the `g` flag, `REGEXP_REPLACE()` function replaces only the first occurrence of a substring: +Without specifying the `g` flag, `regexp_replace()` function replaces only the first occurrence of a substring: [source,sql] ---- @@ -152,5 +152,5 @@ If using multiple flags, the last one takes precedence. If using the `ci` flags, == Restrictions * The function returns `NULL` if there are no input rows or `NULL` values. -* If the regular expression pattern isn't found in the string, the `REGEXP_REPLACE()` function returns the original string +* If the regular expression pattern isn't found in the string, the `regexp_replace()` function returns the original string * `i` and `c` flags shouldn't be used with each other diff --git a/modules/reference/pages/sql/sql-functions/string-functions/replace.adoc b/modules/reference/pages/sql/sql-functions/string-functions/replace.adoc index 43c98905a..f37065987 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/replace.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/replace.adoc @@ -1,17 +1,17 @@ = replace -:description: The REPLACE() function looks for and replaces a substring with a new one in a string. +:description: The `replace()` function looks for and replaces a substring with a new one in a string. :page-topic-type: reference -The `REPLACE()` function looks for and replaces a substring with a new one in a string. This function is often used to update the outdated or spelling mistakes in data that require an amendment. +The `replace()` function looks for and replaces a substring with a new one in a string. This function is often used to update the outdated or spelling mistakes in data that require an amendment. [NOTE] ==== -Redpanda SQL also supports the xref:reference:sql/sql-functions/string-functions/regex/regexp-replace.adoc[`REGEXP_REPLACE()`] function. It searches and replaces a substring that matches with a POSIX regular expression +Redpanda SQL also supports the xref:reference:sql/sql-functions/string-functions/regex/regexp-replace.adoc[`regexp_replace()`] function. It searches and replaces a substring that matches with a POSIX regular expression ==== == Syntax -The syntax for `REPLACE()` function is: +The syntax for `replace()` function is: [source,sql] ---- @@ -20,7 +20,7 @@ REPLACE(string, old_substring, new_substring) [WARNING] ==== -The `REPLACE()` function performs a case-sensitive replacement +The `replace()` function performs a case-sensitive replacement ==== === Parameters @@ -35,14 +35,14 @@ The syntax requires these parameters: === Basic usage -This example demonstrates a basic usage of the `REPLACE()` function. +This example demonstrates a basic usage of the `replace()` function. [source,sql] ---- SELECT REPLACE ('NewDatabase', 'New', 'Redpanda'); ---- -The `REPLACE()` function finds all occurrences of the '`New`' substring in the '`NewDatabase`' string and replaces it with the '`Redpanda`' substring, producing: +The `replace()` function finds all occurrences of the '`New`' substring in the '`NewDatabase`' string and replaces it with the '`Redpanda`' substring, producing: [source,sql] ---- @@ -112,7 +112,7 @@ SELECT REPLACE(category, 'group', 'sports') from hobby; === Remove a substring from a string -This example shows how to remove a substring from a string using the `REPLACE()` function. In this case, the goal is to find all occurrences of the '`Friends`' substring in the '`Hello Friends`' string and remove it: +This example shows how to remove a substring from a string using the `replace()` function. In this case, the goal is to find all occurrences of the '`Friends`' substring in the '`Hello Friends`' string and remove it: [source,sql] ---- @@ -130,14 +130,14 @@ SELECT REPLACE('Hello Friends', 'Friends', ''); === Replace multiple patterns -This example uses the `REPLACE()` function to replace multiple patterns of the given string: +This example uses the `replace()` function to replace multiple patterns of the given string: [source,sql] ---- SELECT REPLACE(REPLACE(REPLACE(REPLACE('2*[9-5]/{4+8}', '[', '('), ']', ')'), '{', '('), '}', ')'); ---- -The `REPLACE()` function is called multiple times to replace the corresponding string as specified: +The `replace()` function is called multiple times to replace the corresponding string as specified: * *`[]`* into *`()`* * *`{}`* into *`()`* diff --git a/modules/reference/pages/sql/sql-functions/string-functions/starts-with.adoc b/modules/reference/pages/sql/sql-functions/string-functions/starts-with.adoc index 2261176b4..6f6e7377a 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/starts-with.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/starts-with.adoc @@ -1,8 +1,8 @@ = starts_with -:description: The STARTS_WITH() function determines whether the first argument starts with a specified string in the second argument or not. +:description: The `starts_with()` function determines whether the first argument starts with a specified string in the second argument or not. :page-topic-type: reference -The `STARTS_WITH()` function determines whether the first argument starts with a specified string in the second argument or not. +The `starts_with()` function determines whether the first argument starts with a specified string in the second argument or not. [source,sql] ---- @@ -12,7 +12,7 @@ STARTS_WITH(first_argument, 'second_argument') * `first_argument`: The search reference. Can be a string or a column name. * `second_argument`: The specified argument, which will have the search keywords. -The input type will be `STRING`, and the return type is `BOOL`, shown as `true` or `false`. +The input type will be `STRING`, and the return type is `bool`, shown as `true` or `false`. Special case: @@ -21,7 +21,7 @@ Special case: == Examples -=== `STARTS_WITH()` function using column +=== `starts_with()` function using column Consider a table with the title *petsData*. @@ -87,7 +87,7 @@ This returns `true` to the pet with a pet starting with the letter J. Otherwise, +---------------+--------------+ ---- -=== `STARTS_WITH()` function with no specified argument +=== `starts_with()` function with no specified argument The *petsData* table has a `NULL` value in the breed column. @@ -131,14 +131,14 @@ SELECT * FROM petsData; +----------+--------------+------------+---------------------+------+------+ ---- -For example, run the `STARTS_WITH` function but with no specified `second_argument:` +For example, run the `starts_with` function but with no specified `second_argument:` [source,sql] ---- SELECT breed, STARTS_WITH(breed, '') FROM petsData; ---- -This result shows that `STARTS_WITH` returns true for all records (even the `NULL` one): +This result shows that `starts_with` returns true for all records (even the `NULL` one): [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/string-functions/strpos.adoc b/modules/reference/pages/sql/sql-functions/string-functions/strpos.adoc index df71f48cb..6152a577f 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/strpos.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/strpos.adoc @@ -1,8 +1,8 @@ = strpos -:description: Use the STRPOS() to return the position from where the substring (the second argument) is matched with the string (the first argument). +:description: Use the `strpos()` to return the position from where the substring (the second argument) is matched with the string (the first argument). :page-topic-type: reference -Use the `STRPOS()` function to return the position from where the substring (the second argument) is matched with the string (the first argument). +Use the `strpos()` function to return the position from where the substring (the second argument) is matched with the string (the first argument). [source,sql] ---- @@ -14,11 +14,11 @@ The input and return must be of type `string`. *Special cases:* * Returns `NULL` if there are no input rows or `NULL` values. -* If the `substring` is not found in the string, then the `STRPOS()` function will return 0. +* If the `substring` is not found in the string, then the `strpos()` function will return 0. == Examples -=== Basic `STRPOS()` function +=== Basic `strpos()` function This example shows how to find the *ut* (substring) position in the *computer* (string): @@ -38,7 +38,7 @@ The result shows that *ut* is located at the fifth character of *computer*: +-----------------+ ---- -=== STRPOS() function using column +=== `strpos()` function using column The *listofwords* table stores word data: @@ -85,7 +85,7 @@ The preceding query shows the table: +----------------+ ---- -The query returns the words and a position of a specific substring = '*al*' using the `STRPOS()` function: +The query returns the words and a position of a specific substring = '*al*' using the `strpos()` function: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/string-functions/substr.adoc b/modules/reference/pages/sql/sql-functions/string-functions/substr.adoc index 37e759a5a..582229c91 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/substr.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/substr.adoc @@ -1,8 +1,8 @@ = substr -:description: The SUBSTR() function extracts a specific number of characters from a string. +:description: The `substr()` function extracts a specific number of characters from a string. :page-topic-type: reference -The `SUBSTR()` function extracts a specific number of characters from a string. +The `substr()` function extracts a specific number of characters from a string. == Syntax @@ -57,7 +57,7 @@ Use the `length` function to determine the number of characters to be extracted_ == Examples -=== `SUBSTR()` function with specified `start_position` & `length` +=== `substr()` function with specified `start_position` & `length` In this example, the `start_position` is set to the first six characters and five characters are extracted: @@ -75,7 +75,7 @@ Fruit melon ---- -=== `SUBSTR()` function with `length` = 0 +=== `substr()` function with `length` = 0 This query extracts a string with `length` = 0: @@ -92,7 +92,7 @@ Fruit ------- ---- -=== `SUBSTR()` function with `length` = negative value +=== `substr()` function with `length` = negative value This example checks if the `length` is specified with a negative value: @@ -108,7 +108,7 @@ Instead of extracting the string from the last characters, it returns an error: ERROR: Length of substring cannot be negative ---- -=== `SUBSTR()` function with `start_position` > `string` +=== `substr()` function with `start_position` > `string` The string *Watermelon* has only ten characters. This example shows what happens when the specified `start_position` is larger than the string's characters: @@ -125,7 +125,7 @@ Fruit ------- ---- -=== `SUBSTR()` function with 2 arguments +=== `substr()` function with 2 arguments In this example, the `start_position` is set to the first six characters and five characters are extracted. diff --git a/modules/reference/pages/sql/sql-functions/string-functions/substring.adoc b/modules/reference/pages/sql/sql-functions/string-functions/substring.adoc index d5ab75dd1..eb3ac6b1e 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/substring.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/substring.adoc @@ -1,16 +1,16 @@ = substring -:description: SUBSTR is an alias for SUBSTRING. +:description: SUBSTR is an alias for `substring`. :page-topic-type: reference [WARNING] ==== SUBSTR is an alias for SUBSTRING. Learn more at xref:reference:sql/sql-functions/string-functions/substr.adoc[SUBSTR] documentation. ==== -The SUBSTRING() function lets you extract a part of a string and return that substring. +The `substring()` function lets you extract a part of a string and return that substring. == Syntax -Here are the 2 basic syntaxes of the `SUBSTRING()` function in Redpanda SQL: +Here are the 2 basic syntaxes of the `substring()` function in Redpanda SQL: *2 Arguments* @@ -33,7 +33,7 @@ Both syntaxes will have input and return of type `string`. == Examples -This example shows how to use the `SUBSTRING()` function to extract the first 7 characters from the string: +This example shows how to use the `substring()` function to extract the first 7 characters from the string: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/string-functions/upper.adoc b/modules/reference/pages/sql/sql-functions/string-functions/upper.adoc index c78d0ea21..f7609e8e9 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/upper.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/upper.adoc @@ -1,8 +1,8 @@ = upper -:description: The UPPER() function returns a given string, an expression, or values in a column in all uppercase letters. +:description: The `upper()` function returns a given string, an expression, or values in a column in all uppercase letters. :page-topic-type: reference -The `UPPER()` function returns a given string, an expression, or values in a column in all uppercase letters: +The `upper()` function returns a given string, an expression, or values in a column in all uppercase letters: [source,sql] ---- @@ -13,12 +13,12 @@ It accepts input as a string and returns text in uppercase letters. *Special Case:* -* If characters in the input are not of type string, they remain unaffected by the `UPPER()` function. -* Unicode is supported for the `UPPER()` function. +* If characters in the input are not of type string, they remain unaffected by the `upper()` function. +* Unicode is supported for the `upper()` function. == Examples -=== Basic `UPPER()` function +=== Basic `upper()` function This basic query converts the given string to all uppercase letters: @@ -38,9 +38,9 @@ The query returns: +-------------+ ---- -=== UPPER() function using columns and CONCAT() function +=== `upper()` function using columns and `concat()` function -This example shows how the `UPPER()` function works with columns. A table named *personal_details* contains employee's *id*, *first_name*, *last_name*, and *gender* of a retail store: +This example shows how the `upper()` function works with columns. A table named *personal_details* contains employee's *id*, *first_name*, *last_name*, and *gender* of a retail store: [source,sql] ---- @@ -83,7 +83,7 @@ The query returns: Assume that: . The goal is to convert employees' first and last names with *id* numbers 1, 3, and 5 to all uppercase letters. -. Then, combine them using the `CONCAT()` function into one *full_name* column in uppercase. +. Then, combine them using the `concat()` function into one *full_name* column in uppercase. + Use this query: + diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/current-timestamp.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/current-timestamp.adoc index dbb078fbd..a4470d360 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/current-timestamp.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/current-timestamp.adoc @@ -1,8 +1,8 @@ = current_timestamp -:description: The CURRENT_TIMESTAMP() returns the current timestamp value representing the date and time the query was executed. +:description: The `current_timestamp()` returns the current timestamp value representing the date and time the query was executed. :page-topic-type: reference -The `CURRENT_TIMESTAMP()` returns the current timestamp value representing the date and time the query was executed. +The `current_timestamp()` returns the current timestamp value representing the date and time the query was executed. [NOTE] ==== diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/date-trunc.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/date-trunc.adoc index b544a1f56..e4977e268 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/date-trunc.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/date-trunc.adoc @@ -1,12 +1,12 @@ = date_trunc -:description: The DATE_TRUNC() function truncates a timestamp, timestamp with time zone or interval value to the specified precision, effectively rounding down the +:description: The `date_trunc()` function truncates a timestamp, timestamp with time zone or interval value to the specified precision, effectively rounding down the :page-topic-type: reference -The `DATE_TRUNC()` function truncates a timestamp, timestamp with time zone or interval value to the specified precision, effectively rounding down the value to the start of the given time unit. The return type matches the input type. +The `date_trunc()` function truncates a timestamp, timestamp with time zone or interval value to the specified precision, effectively rounding down the value to the start of the given time unit. The return type matches the input type. == Syntax -The syntax for using the `DATE_TRUNC()` function is: +The syntax for using the `date_trunc()` function is: .Without time_zone [source,sql] @@ -23,12 +23,12 @@ DATE_TRUNC(field, source, time_zone) == Parameters * `field`: The unit of time used to truncate the `source` value. Type: `text`. Case-insensitive. -* `source`: The value to truncate. Must be of type `INTERVAL`, `TIMESTAMP`, or `TIMESTAMP WITH TIME ZONE`. +* `source`: The value to truncate. Must be of type `interval`, `timestamp`, or `timestamp with time zone`. * `time_zone`: Optional. Time zone for the operation. Type: `text`. Used only with the second syntax form. == Fields -Here is a list of supported values available to specify the fields param in `DATE_TRUNC()` syntax. +Here is a list of supported values available to specify the fields param in `date_trunc()` syntax. * `microseconds` * `milliseconds` diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/extract.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/extract.adoc index d1da77e80..a7e08c307 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/extract.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/extract.adoc @@ -1,8 +1,8 @@ = extract -:description: The EXTRACT() function retrieves a specified part (field) from a given date/time or interval value. +:description: The `extract()` function retrieves a specified part (field) from a given date/time or interval value. :page-topic-type: reference -The `EXTRACT()` function retrieves a specified part (field) from a given date/time or interval value. It is commonly used to obtain components such as year, month, day, and hour from timestamps or dates. +The `extract()` function retrieves a specified part (field) from a given date/time or interval value. It is commonly used to obtain components such as year, month, day, and hour from timestamps or dates. == Syntax @@ -16,14 +16,14 @@ EXTRACT (field FROM source) * `field`: String or identifier specifying the part of the date / time to extract. * `source`: Date / time value from which to extract the specifed field. -This table shows the supported input and corresponding return types for the `EXTRACT()` function: +This table shows the supported input and corresponding return types for the `extract()` function: [width="100%",cols="24%,55%,21%",options="header",] |=== |Input Type: `source` |Supported `field` values |Return Type -|`TIMESTAMP` |`YEAR`, `MONTH`, `DAY`, `HOUR`, `MINUTE`, `SECOND` |`DOUBLE PRECISION` -|`TIMESTAMPTZ` |`YEAR`, `MONTH`, `DAY`, `HOUR`, `MINUTE`, `SECOND` |`DOUBLE PRECISION` -|`DATE` |`YEAR`, `MONTH`, `DAY` |`INTEGER` +|`timestamp` |`YEAR`, `MONTH`, `DAY`, `HOUR`, `MINUTE`, `SECOND` |`double precision` +|`timestamptz` |`YEAR`, `MONTH`, `DAY`, `HOUR`, `MINUTE`, `SECOND` |`double precision` +|`date` |`YEAR`, `MONTH`, `DAY` |`integer` |=== [NOTE] @@ -33,9 +33,9 @@ The SECOND field returns a fractional value as `double precision` to include fra == Examples -=== EXTRACT() with timestamp - year +=== `extract()` with timestamp - year -This example shows how to use the `EXTRACT()` function to extract a given timestamp's year: +This example shows how to use the `extract()` function to extract a given timestamp's year: [source,sql] ---- @@ -53,9 +53,9 @@ The query returns: +----------+ ---- -=== EXTRACT() with timestamp - month +=== `extract()` with timestamp - month -This example uses the `EXTRACT()` function to extract a given timestamp's month: +This example uses the `extract()` function to extract a given timestamp's month: [source,sql] ---- @@ -73,9 +73,9 @@ The query returns the month's part of the given timestamp: +----------+ ---- -=== EXTRACT() with timestamp - seconds (including fractional seconds) +=== `extract()` with timestamp - seconds (including fractional seconds) -This example uses the `EXTRACT()` function to extract a given timestamp's seconds, including fractional seconds: +This example uses the `extract()` function to extract a given timestamp's seconds, including fractional seconds: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/format-timestamp.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/format-timestamp.adoc index 871a75d33..3332f0e70 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/format-timestamp.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/format-timestamp.adoc @@ -1,8 +1,8 @@ = format_timestamp -:description: The FORMAT_TIMESTAMP() function returns a given timestamp value in a specified format. +:description: The `format_timestamp()` function returns a given timestamp value in a specified format. :page-topic-type: reference -The `FORMAT_TIMESTAMP()` function returns a given timestamp value in a specified format. Its syntax is: +The `format_timestamp()` function returns a given timestamp value in a specified format. Its syntax is: [source,sql] ---- @@ -16,9 +16,9 @@ This function requires two arguments: Its return type is a timestamp value with a timezone. -== Basic `FORMAT_TIMESTAMP()` function +== Basic `format_timestamp()` function -This example shows how to use the `FORMAT_TIMESTAMP()` function to convert a given timestamp into a timestamp format as specified in the function arguments. +This example shows how to use the `format_timestamp()` function to convert a given timestamp into a timestamp format as specified in the function arguments. [source,sql] ---- @@ -49,9 +49,9 @@ The query returns: +-----------------------------+ ---- -== `FORMAT_TIMESTAMP()` function using multiple spaces +== `format_timestamp()` function using multiple spaces -This example shows how the `FORMAT_TIMESTAMP()` function handles multiple spaces in the input string. When given multiple spaces, it omits the spaces and only returns the correct timestamp value: +This example shows how the `format_timestamp()` function handles multiple spaces in the input string. When given multiple spaces, it omits the spaces and only returns the correct timestamp value: [source,sql] ---- @@ -69,9 +69,9 @@ This returns the output: +-----------------------------+ ---- -== `FORMAT_TIMESTAMP()` function if the input value of the year is less than 4 digits +== `format_timestamp()` function if the input value of the year is less than 4 digits -`FORMAT_TIMESTAMP()` will adjust the year to the nearest year value if the input argument has less than the required number of digits (for example, less than 4). This example shows how it works: +`format_timestamp()` will adjust the year to the nearest year value if the input argument has less than the required number of digits (for example, less than 4). This example shows how it works: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/index.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/index.adoc index 87723a73b..7da291e10 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/index.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/index.adoc @@ -6,17 +6,17 @@ Timestamp functions return a date-time value based on a specified timestamp/inte [width="100%",cols="<38%,<62%",options="header",] |=== |*Functions* |*Description* -|xref:reference:sql/sql-functions/timestamp-functions/current-timestamp.adoc[CURRENT_TIMESTAMP()] |Returns the current date and time as a timestamp data type. -|xref:reference:sql/sql-functions/timestamp-functions/format-timestamp.adoc[FORMAT_TIMESTAMP()] |Modifies the current timestamp into a different format. -|xref:reference:sql/sql-functions/timestamp-functions/unix-seconds.adoc[UNIX_SECONDS()] |Converts a given timestamp to a UNIX timestamp in seconds. -|xref:reference:sql/sql-functions/timestamp-functions/unix-millis.adoc[UNIX_MILLIS()] |Converts a given timestamp to a UNIX timestamp in milliseconds. -|xref:reference:sql/sql-functions/timestamp-functions/unix-micros.adoc[UNIX_MICROS()] |Converts a given timestamp to a UNIX timestamp in microseconds. -|xref:reference:sql/sql-functions/timestamp-functions/timestamp-seconds.adoc[TIMESTAMP_SECONDS()] |Converts a UNIX timestamp in seconds to a timestamp. -|xref:reference:sql/sql-functions/timestamp-functions/timestamp-millis.adoc[TIMESTAMP_MILLIS()] |Converts a UNIX timestamp in milliseconds to a timestamp. -|xref:reference:sql/sql-functions/timestamp-functions/timestamp-micros.adoc[TIMESTAMP_MICROS()] |Converts a UNIX timestamp in microseconds to a timestamp. -|xref:reference:sql/sql-functions/timestamp-functions/timestamp-trunc.adoc[TIMESTAMP_TRUNC()] |Truncates a given timestamp to the nearest time part. Supported time parts are YEAR, MONTH, DAY, HOUR, MINUTE, and SECOND -|xref:reference:sql/sql-functions/timestamp-functions/extract.adoc[EXTRACT()] |Extracts some part of a specified timestamp or interval. -|xref:reference:sql/sql-functions/timestamp-functions/to-timestamp.adoc[TO_TIMESTAMP()] |Converts a string into a timestamp based on the provided format. -|xref:reference:sql/sql-functions/timestamp-functions/date-trunc.adoc[DATE_TRUNC()] |Truncates intervals or timestamps/time zones to a specified field. -|xref:reference:sql/sql-functions/timestamp-functions/to-char.adoc[TO_CHAR() from Timestamp] |Formats a timestamp into a string using a given format. +|xref:reference:sql/sql-functions/timestamp-functions/current-timestamp.adoc[`current_timestamp()`] |Returns the current date and time as a timestamp data type. +|xref:reference:sql/sql-functions/timestamp-functions/format-timestamp.adoc[`format_timestamp()`] |Modifies the current timestamp into a different format. +|xref:reference:sql/sql-functions/timestamp-functions/unix-seconds.adoc[`unix_seconds()`] |Converts a given timestamp to a UNIX timestamp in seconds. +|xref:reference:sql/sql-functions/timestamp-functions/unix-millis.adoc[`unix_millis()`] |Converts a given timestamp to a UNIX timestamp in milliseconds. +|xref:reference:sql/sql-functions/timestamp-functions/unix-micros.adoc[`unix_micros()`] |Converts a given timestamp to a UNIX timestamp in microseconds. +|xref:reference:sql/sql-functions/timestamp-functions/timestamp-seconds.adoc[`timestamp_seconds()`] |Converts a UNIX timestamp in seconds to a timestamp. +|xref:reference:sql/sql-functions/timestamp-functions/timestamp-millis.adoc[`timestamp_millis()`] |Converts a UNIX timestamp in milliseconds to a timestamp. +|xref:reference:sql/sql-functions/timestamp-functions/timestamp-micros.adoc[`timestamp_micros()`] |Converts a UNIX timestamp in microseconds to a timestamp. +|xref:reference:sql/sql-functions/timestamp-functions/timestamp-trunc.adoc[`timestamp_trunc()`] |Truncates a given timestamp to the nearest time part. Supported time parts are YEAR, MONTH, DAY, HOUR, MINUTE, and SECOND +|xref:reference:sql/sql-functions/timestamp-functions/extract.adoc[`extract()`] |Extracts some part of a specified timestamp or interval. +|xref:reference:sql/sql-functions/timestamp-functions/to-timestamp.adoc[`to_timestamp()`] |Converts a string into a timestamp based on the provided format. +|xref:reference:sql/sql-functions/timestamp-functions/date-trunc.adoc[`date_trunc()`] |Truncates intervals or timestamps/time zones to a specified field. +|xref:reference:sql/sql-functions/timestamp-functions/to-char.adoc[`to_char()` from Timestamp] |Formats a timestamp into a string using a given format. |=== diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-micros.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-micros.adoc index b1bced330..f16703407 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-micros.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-micros.adoc @@ -1,21 +1,21 @@ = timestamp_micros -:description: The TIMESTAMP_MICROS() function converts a given UNIX timestamp value in microseconds since 1970-01-01 00:00:00 UTC into a timestamp. +:description: The `timestamp_micros()` function converts a given UNIX timestamp value in microseconds since 1970-01-01 00:00:00 UTC into a timestamp. :page-topic-type: reference -The `TIMESTAMP_MICROS()` function converts a given UNIX timestamp value in microseconds since 1970-01-01 00:00:00 UTC into a timestamp. Its syntax is: +The `timestamp_micros()` function converts a given UNIX timestamp value in microseconds since 1970-01-01 00:00:00 UTC into a timestamp. Its syntax is: [source,sql] ---- SELECT TIMESTAMP_MICROS(BIGINT) ---- -Its input type is a `BIGINT` expression representing a UNIX timestamp in microseconds and the return data type is a timestamp. +Its input type is a `bigint` expression representing a UNIX timestamp in microseconds and the return data type is a timestamp. == Examples -=== Basic `TIMESTAMP_MICROS()` function +=== Basic `timestamp_micros()` function -This example shows how to use the `TIMESTAMP_MICROS()` function to convert a given UNIX timestamp in microseconds into a timestamp without a timezone: +This example shows how to use the `timestamp_micros()` function to convert a given UNIX timestamp in microseconds into a timestamp without a timezone: [source,sql] ---- @@ -33,7 +33,7 @@ The query returns: +-----------------------------+ ---- -=== `TIMESTAMP_MICROS()` function using columns +=== `timestamp_micros()` function using columns Suppose a table named **timemicro_example** has these UNIX time values in microseconds in the *unix_timestamp* column: diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-millis.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-millis.adoc index 0f8ae28c6..30621aa15 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-millis.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-millis.adoc @@ -1,21 +1,21 @@ = timestamp_millis -:description: The TIMESTAMP_MILLIS() function converts a given UNIX timestamp value in milliseconds since 1970-01-01 00:00:00 UTC into a timestamp. +:description: The `timestamp_millis()` function converts a given UNIX timestamp value in milliseconds since 1970-01-01 00:00:00 UTC into a timestamp. :page-topic-type: reference -The `TIMESTAMP_MILLIS()` function converts a given UNIX timestamp value in milliseconds since 1970-01-01 00:00:00 UTC into a timestamp. Its syntax is: +The `timestamp_millis()` function converts a given UNIX timestamp value in milliseconds since 1970-01-01 00:00:00 UTC into a timestamp. Its syntax is: [source,sql] ---- SELECT TIMESTAMP_MILLIS(BIGINT) ---- -Its input type is a `BIGINT` expression which represents a UNIX timestamp in milliseconds and the return data type is a timestamp. +Its input type is a `bigint` expression which represents a UNIX timestamp in milliseconds and the return data type is a timestamp. == Examples -=== Basic `TIMESTAMP_MILLIS()` function +=== Basic `timestamp_millis()` function -This example shows how to use the `TIMESTAMP_MILLIS()` function to convert a given UNIX timestamp in milliseconds into a timestamp without a timezone. +This example shows how to use the `timestamp_millis()` function to convert a given UNIX timestamp in milliseconds into a timestamp without a timezone. [source,sql] ---- @@ -33,7 +33,7 @@ The query returns: +-----------------------------+ ---- -=== `TIMESTAMP_MILLIS()` function using columns +=== `timestamp_millis()` function using columns Suppose a table named **unix_example** has these UNIX time values in milliseconds in the *unix_timestamp* column: diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-seconds.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-seconds.adoc index 33f755781..ba31b1145 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-seconds.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-seconds.adoc @@ -1,8 +1,8 @@ = timestamp_seconds -:description: The TIMESTAMP_SECONDS() function converts a given UNIX timestamp value in seconds from 1970-01-01 00:00:00 UTC into a timestamp. +:description: The `timestamp_seconds()` function converts a given UNIX timestamp value in seconds from 1970-01-01 00:00:00 UTC into a timestamp. :page-topic-type: reference -The `TIMESTAMP_SECONDS()` function converts a given UNIX timestamp value in seconds from 1970-01-01 00:00:00 UTC into a timestamp. Its syntax is: +The `timestamp_seconds()` function converts a given UNIX timestamp value in seconds from 1970-01-01 00:00:00 UTC into a timestamp. Its syntax is: [source,sql] ---- @@ -13,9 +13,9 @@ Its input type is an `int64` expression representing a UNIX timestamp in seconds == Examples -=== Basic `TIMESTAMP_SECONDS()` function +=== Basic `timestamp_seconds()` function -This example shows how to use the `TIMESTAMP_SECONDS()` function to convert a given UNIX timestamp in seconds into a timestamp: +This example shows how to use the `timestamp_seconds()` function to convert a given UNIX timestamp in seconds into a timestamp: [source,sql] ---- @@ -33,7 +33,7 @@ The query returns: +-----------------------------+ ---- -=== `TIMESTAMP_SECONDS()` function using columns +=== `timestamp_seconds()` function using columns Suppose a table named **unix_time** contains these UNIX time values in seconds: diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-trunc.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-trunc.adoc index 654ac5222..1de8b9f57 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-trunc.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-trunc.adoc @@ -1,8 +1,8 @@ = timestamp_trunc -:description: The TIMESTAMP_TRUNC() function rounds a timestamp to a specific day_time granularity, resulting in a truncated timestamp. +:description: The `timestamp_trunc()` function rounds a timestamp to a specific day_time granularity, resulting in a truncated timestamp. :page-topic-type: reference -The `TIMESTAMP_TRUNC()` function rounds a timestamp to a specific `day_time` granularity, resulting in a truncated timestamp. +The `timestamp_trunc()` function rounds a timestamp to a specific `day_time` granularity, resulting in a truncated timestamp. == Syntax @@ -22,7 +22,7 @@ SELECT TIMESTAMP_TRUNC(TIMESTAMP 'YYYY-MM-DD hour:min:sec', day_time); == Examples -=== `TIMESTAMP_TRUNC()` - hour +=== `timestamp_trunc()` - hour This example shows how to round the hour to the closest value: @@ -42,7 +42,7 @@ The final result will display the current date and time in the timezone in which +-----------------------------+ ---- -=== `TIMESTAMP_TRUNC()` - minute +=== `timestamp_trunc()` - minute This example truncates the specified timestamp into the nearest value: @@ -62,7 +62,7 @@ The result is the truncated timestamp: +-----------------------------+ ---- -=== Basic `TIMESTAMP_TRUNC()` function - year +=== Basic `timestamp_trunc()` function - year Run this query to round the date to the closest value: diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/to-char.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/to-char.adoc index 11f24fb0b..3aea4cd07 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/to-char.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/to-char.adoc @@ -1,8 +1,8 @@ = to_char -:description: The TO_CHAR function formats various data types, including date/time, integer, float point and numeric into a formatted string. +:description: The `to_char` function formats various data types, including date/time, integer, float point and numeric into a formatted string. :page-topic-type: reference -The `TO_CHAR` function formats various data types, including `date/time`, `integer`, `float point` and `numeric` into a formatted string. +The `to_char` function formats various data types, including `date/time`, `integer`, `float point` and `numeric` into a formatted string. == Syntax @@ -25,7 +25,7 @@ TO_CHAR(interval, format_string) * `timestamp`: `TIMESTAMP` or `TIMESTAMP WITH TIMEZONE` value to format. * `format`: Format of the output string. -NOTE: If the format string is `NULL`, `TO_CHAR` returns an empty string (`''`) instead of `NULL`. This behavior is compatible with PostgreSQL. +NOTE: If the format string is `NULL`, `to_char` returns an empty string (`''`) instead of `NULL`. This behavior is compatible with PostgreSQL. == Supported formats @@ -56,7 +56,7 @@ The string format supports these template patterns (case-insensitive): === Interval overflow restrictions -Interval overflow occurs when an operation involving interval values exceeds the maximum limits of the interval data type, resulting in an error or unexpected behavior. This can happen when adding, subtracting or multiplying interval values that lead to a representation that goes beyond the allowable range for any of its components (for example, years, months, days, hours, minutes and seconds). When executing the `TO_CHAR` function for intervals, it is important to be aware of these overflow restrictions: +Interval overflow occurs when an operation involving interval values exceeds the maximum limits of the interval data type, resulting in an error or unexpected behavior. This can happen when adding, subtracting or multiplying interval values that lead to a representation that goes beyond the allowable range for any of its components (for example, years, months, days, hours, minutes and seconds). When executing the `to_char` function for intervals, it is important to be aware of these overflow restrictions: [cols="<,^,^",options="header",] |=== diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/to-timestamp.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/to-timestamp.adoc index 64e9b1cf0..5e6c0a5ac 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/to-timestamp.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/to-timestamp.adoc @@ -1,12 +1,12 @@ = to_timestamp -:description: The TO_TIMESTAMP() function converts a string into a timestamp based on the provided format. +:description: The `to_timestamp()` function converts a string into a timestamp based on the provided format. :page-topic-type: reference -The `TO_TIMESTAMP()` function converts a string into a timestamp based on the provided format. It returns a `TIMESTAMP WITH TIME ZONE` type. +The `to_timestamp()` function converts a string into a timestamp based on the provided format. It returns a `TIMESTAMP WITH TIME ZONE` type. == Syntax -The syntax for using the `TO_TIMESTAMP()` function is: +The syntax for using the `to_timestamp()` function is: [source,sql] ---- @@ -16,7 +16,7 @@ SELECT TO_TIMESTAMP('source', 'format'); * `source`: The date/time value to convert. Type is `TIMESTAMP` (`YYYY-MM-DD HH:MM:SS`). * `format`: The format of the input string. -NOTE: If the source string is `NULL`, `TO_TIMESTAMP` returns `NULL` instead of raising an error. This behavior is compatible with PostgreSQL. +NOTE: If the source string is `NULL`, `to_timestamp` returns `NULL` instead of raising an error. This behavior is compatible with PostgreSQL. == Format @@ -99,7 +99,7 @@ a|- Up to 6 digits. + === Timestamp into YYYY-MM-DD HH24:MI -The `TO_TIMESTAMP()` function converts the provided string into a timestamp with the format `YYYY-MM-DD HH24:MI`. +The `to_timestamp()` function converts the provided string into a timestamp with the format `YYYY-MM-DD HH24:MI`. [source,sql] ---- @@ -117,7 +117,7 @@ The output is a timestamp with a timezone. === Timestamp into MM-DD HH12:MI -The `TO_TIMESTAMP()` function converts the provided string into a timestamp with the format `MM-DD HH12:MI`. +The `to_timestamp()` function converts the provided string into a timestamp with the format `MM-DD HH12:MI`. [source,sql] ---- @@ -135,7 +135,7 @@ The output is a timestamp with a timezone. === Timestamp into YYYY-MM HH12:MI(AM/PM) -The `TO_TIMESTAMP()` function converts the provided string into a timestamp with the format `YYYY-MM HH12:MI` with meridiem indicator (AM/PM). +The `to_timestamp()` function converts the provided string into a timestamp with the format `YYYY-MM HH12:MI` with meridiem indicator (AM/PM). *Request 1* @@ -162,7 +162,7 @@ The output of both requests is the same. It changes the time into a 12-hour form === Timestamp into YYYY-MM-DD HH24:MI:SS.MS.US -The `TO_TIMESTAMP()` function converts the provided string into a timestamp with `YYYY-MM-DD HH24:MI:SS.MS.US` format. +The `to_timestamp()` function converts the provided string into a timestamp with `YYYY-MM-DD HH24:MI:SS.MS.US` format. [source,sql] ---- @@ -180,7 +180,7 @@ The output is a timestamp with milliseconds and microseconds. === Timestamp into YYYY-MM-DD HH24:MI:SS.MS -The `TO_TIMESTAMP()` function converts the provided string into a timestamp with `YYYY-MM-DD HH24:MI:SS.MS` format. +The `to_timestamp()` function converts the provided string into a timestamp with `YYYY-MM-DD HH24:MI:SS.MS` format. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-micros.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-micros.adoc index 8eb7e8c57..c2ed52066 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-micros.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-micros.adoc @@ -1,8 +1,8 @@ = unix_micros -:description: The UNIX_MICROS() function returns a given timestamp into a UNIX timestamp in microseconds, from 1970-01-01 00:00:00-00 (can be negative). +:description: The `unix_micros()` function returns a given timestamp into a UNIX timestamp in microseconds, from 1970-01-01 00:00:00-00 (can be negative). :page-topic-type: reference -The `UNIX_MICROS()` function returns a given timestamp into a UNIX timestamp in microseconds, from 1970-01-01 00:00:00-00 (can be negative): +The `unix_micros()` function returns a given timestamp into a UNIX timestamp in microseconds, from 1970-01-01 00:00:00-00 (can be negative): [source,sql] ---- @@ -13,9 +13,9 @@ Its input type is a `timestamp` expression, and the return data type is `int64` == Examples -=== Basic `UNIX_MICROS()` function +=== Basic `unix_micros()` function -This example shows how to use the `UNIX_MICROS()` function to convert a given timestamp into a UNIX timestamp in microseconds: +This example shows how to use the `unix_micros()` function to convert a given timestamp into a UNIX timestamp in microseconds: [source,sql] ---- @@ -33,7 +33,7 @@ The query returns: +-----------------------------+ ---- -=== `UNIX_MICROS()` function using columns +=== `unix_micros()` function using columns Suppose a table named *time_example* has these timestamp values: diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-millis.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-millis.adoc index 6d8330ddb..5ca0c5b69 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-millis.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-millis.adoc @@ -1,21 +1,21 @@ = unix_millis -:description: The UNIX_MILLIS() function returns a given timestamp to a UNIX timestamp in milliseconds from 1970-01-01 00:00:00-00 (can be negative). +:description: The `unix_millis()` function returns a given timestamp to a UNIX timestamp in milliseconds from 1970-01-01 00:00:00-00 (can be negative). :page-topic-type: reference -The `UNIX_MILLIS()` function returns a given timestamp to a UNIX timestamp in milliseconds from 1970-01-01 00:00:00-00 (can be negative). Its syntax is: +The `unix_millis()` function returns a given timestamp to a UNIX timestamp in milliseconds from 1970-01-01 00:00:00-00 (can be negative). Its syntax is: [source,sql] ---- SELECT UNIX_MILLIS(TIMESTAMP) ---- -Its input type is a `timestamp` expression, and the return data type is `BIGINT` representing time in milliseconds. +Its input type is a `timestamp` expression, and the return data type is `bigint` representing time in milliseconds. == Examples -=== Basic `UNIX_MILLIS()` function +=== Basic `unix_millis()` function -This example shows how to use the `UNIX_MILLIS()` function to convert a given timestamp into a UNIX timestamp in milliseconds: +This example shows how to use the `unix_millis()` function to convert a given timestamp into a UNIX timestamp in milliseconds: [source,sql] ---- @@ -33,7 +33,7 @@ The query returns: +-----------------------------+ ---- -=== `UNIX_MILLIS()` function using columns +=== `unix_millis()` function using columns Suppose a table named **time_example** has these timestamp values in the *time_stamp* column: diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-seconds.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-seconds.adoc index 9751beafd..acb82cdc0 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-seconds.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/unix-seconds.adoc @@ -1,21 +1,21 @@ = unix_seconds -:description: The UNIX_SECONDS() function returns a given timestamp to a UNIX timestamp in seconds, from 1970-01-01 00:00:00-00. +:description: The `unix_seconds()` function returns a given timestamp to a UNIX timestamp in seconds, from 1970-01-01 00:00:00-00. :page-topic-type: reference -The `UNIX_SECONDS()` function returns a given timestamp to a UNIX timestamp in seconds, from 1970-01-01 00:00:00-00. Its syntax is: +The `unix_seconds()` function returns a given timestamp to a UNIX timestamp in seconds, from 1970-01-01 00:00:00-00. Its syntax is: [source,sql] ---- SELECT UNIX_SECONDS(TIMESTAMP) ---- -Its input type is a `timestamp` expression, and the return data type is `BIGINT` representing time in seconds. +Its input type is a `timestamp` expression, and the return data type is `bigint` representing time in seconds. == Examples -=== Basic `UNIX_SECONDS()` function +=== Basic `unix_seconds()` function -This example shows how to use the `UNIX_SECONDS()` function to convert a given timestamp into a UNIX timestamp in seconds: +This example shows how to use the `unix_seconds()` function to convert a given timestamp into a UNIX timestamp in seconds: [source,sql] ---- @@ -33,7 +33,7 @@ The query returns: +-----------------------------+ ---- -=== `UNIX_SECONDS()` function using columns +=== `unix_seconds()` function using columns Suppose a table named **time_example** has these timestamp values in the *time_stampvalues* column: diff --git a/modules/reference/pages/sql/sql-functions/window-functions/avg.adoc b/modules/reference/pages/sql/sql-functions/window-functions/avg.adoc index 00e1636b4..fd66f93df 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/avg.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/avg.adoc @@ -1,8 +1,8 @@ = avg -:description: The AVG() window function calculates the average (arithmetic mean) of a set of numeric values within a window. +:description: The `avg()` window function calculates the average (arithmetic mean) of a set of numeric values within a window. :page-topic-type: reference -The `AVG()` window function calculates the average (arithmetic mean) of a set of numeric values within a window. This function computes averages over a set of rows that are related to the current row, such as rows within a partition of ordered set. +The `avg()` window function calculates the average (arithmetic mean) of a set of numeric values within a window. This function computes averages over a set of rows that are related to the current row, such as rows within a partition of ordered set. == Syntax @@ -56,7 +56,7 @@ INSERT INTO film(title, length, rating) VALUES === Rolling average by rating -This query uses the `AVG()` function to calculate the rolling average of `length` as rows are ordered by `rating`: +This query uses the `avg()` function to calculate the rolling average of `length` as rows are ordered by `rating`: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/window-functions/bool-and.adoc b/modules/reference/pages/sql/sql-functions/window-functions/bool-and.adoc index d22e687c9..59ee4adfa 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/bool-and.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/bool-and.adoc @@ -1,8 +1,8 @@ = bool_and -:description: The BOOL_AND() window function evaluates whether all values within a specified window of rows are TRUE. +:description: The `bool_and()` window function evaluates whether all values within a specified window of rows are TRUE. :page-topic-type: reference -The `BOOL_AND()` window function evaluates whether all values within a specified window of rows are `TRUE`. +The `bool_and()` window function evaluates whether all values within a specified window of rows are `TRUE`. == Syntax @@ -52,7 +52,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 'PG-13'); ---- -This query uses the `BOOL_AND()` function to evaluate if all films in each rating category have a length greater than 100: +This query uses the `bool_and()` function to evaluate if all films in each rating category have a length greater than 100: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/window-functions/bool-or.adoc b/modules/reference/pages/sql/sql-functions/window-functions/bool-or.adoc index 78ed7ce89..60d6ea1db 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/bool-or.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/bool-or.adoc @@ -1,8 +1,8 @@ = bool_or -:description: The BOOL_OR() window function evaluates whether at least one value within a specified window of rows is TRUE. +:description: The `bool_or()` window function evaluates whether at least one value within a specified window of rows is TRUE. :page-topic-type: reference -The `BOOL_OR()` window function evaluates whether at least one value within a specified window of rows is `TRUE`. +The `bool_or()` window function evaluates whether at least one value within a specified window of rows is `TRUE`. == Syntax @@ -52,7 +52,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 'PG-13'); ---- -This query uses the `BOOL_OR()` function to evaluate whether at least one film in each rating category have a length greater than 150: +This query uses the `bool_or()` function to evaluate whether at least one film in each rating category have a length greater than 150: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/window-functions/count.adoc b/modules/reference/pages/sql/sql-functions/window-functions/count.adoc index 9b2eb049c..f832a226e 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/count.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/count.adoc @@ -1,8 +1,8 @@ = count -:description: The COUNT() window function retrieves the number of records that meet a specific criteria. +:description: The `count()` window function retrieves the number of records that meet a specific criteria. :page-topic-type: reference -The `COUNT()` window function retrieves the number of records that meet a specific criteria. When using it with the `RANGE` clause, it performs counts within a defined range based on the values of the current row. This function can be used with all xref:reference:sql/sql-data-types/index.adoc[data types supported by Redpanda SQL]. +The `count()` window function retrieves the number of records that meet a specific criteria. When using it with the `RANGE` clause, it performs counts within a defined range based on the values of the current row. This function can be used with all xref:reference:sql/sql-data-types/index.adoc[data types supported by Redpanda SQL]. == Syntax @@ -22,7 +22,7 @@ COUNT(expression) OVER ( ) ---- -The `COUNT()` window function always return `BIGINT` as an output, which represents the total number of rows in a table irrespective of the input types. +The `count()` window function always return `bigint` as an output, which represents the total number of rows in a table irrespective of the input types. == Parameters diff --git a/modules/reference/pages/sql/sql-functions/window-functions/cume-dist.adoc b/modules/reference/pages/sql/sql-functions/window-functions/cume-dist.adoc index cea13fc4b..804072f05 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/cume-dist.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/cume-dist.adoc @@ -1,8 +1,8 @@ = cume_dist -:description: The CUME_DIST() function is a window function used to calculate the cumulative distribution of a value within a set of values. +:description: The `cume_dist()` function is a window function used to calculate the cumulative distribution of a value within a set of values. :page-topic-type: reference -The `CUME_DIST()` function is a window function used to calculate the cumulative distribution of a value within a set of values. This function returns a value between 0 and 1, representing a relative position of a row within a partition or result set. +The `cume_dist()` function is a window function used to calculate the cumulative distribution of a value within a set of values. This function returns a value between 0 and 1, representing a relative position of a row within a partition or result set. == Syntax @@ -52,7 +52,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 'PG-13'); ---- -The following query uses the `CUME_DIST()` function to calculate the cumulative distribution of film lengths: +The following query uses the `cume_dist()` function to calculate the cumulative distribution of film lengths: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/window-functions/dense-rank.adoc b/modules/reference/pages/sql/sql-functions/window-functions/dense-rank.adoc index 115a57f57..fef763fcc 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/dense-rank.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/dense-rank.adoc @@ -1,8 +1,8 @@ = dense_rank -:description: The DENSE_RANK() window function assigns a rank for each value within a specified group, based on the ORDER BY expression in the OVER clause. +:description: The `dense_rank()` window function assigns a rank for each value within a specified group, based on the ORDER BY expression in the OVER clause. :page-topic-type: reference -The `DENSE_RANK()` window function assigns a rank for each value within a specified group, based on the `ORDER BY` expression in the `OVER` clause. Unlike the `RANK()` function, which can leave gaps in the ranking sequence when there are ties, `DENSE_RANK()` provides consecutive rank values without any gaps. This function can be used with all xref:reference:sql/sql-data-types/index.adoc[data types supported by Redpanda SQL]. +The `dense_rank()` window function assigns a rank for each value within a specified group, based on the `ORDER BY` expression in the `OVER` clause. Unlike the `rank()` function, which can leave gaps in the ranking sequence when there are ties, `dense_rank()` provides consecutive rank values without any gaps. This function can be used with all xref:reference:sql/sql-data-types/index.adoc[data types supported by Redpanda SQL]. == Syntax @@ -16,11 +16,11 @@ DENSE_RANK() OVER ( ) ---- -The output type for this function is a `BIGINT` and it indicates the rank of values in a table, regardless of the input types. If the `ORDER BY` expression is omitted, all ranks default to 1. If an optional `PARTITION BY` expression is included, the rankings are reset for each group of rows. The rows with equal values for the ranking criteria receive the same rank. +The output type for this function is a `bigint` and it indicates the rank of values in a table, regardless of the input types. If the `ORDER BY` expression is omitted, all ranks default to 1. If an optional `PARTITION BY` expression is included, the rankings are reset for each group of rows. The rows with equal values for the ranking criteria receive the same rank. [NOTE] ==== -Unlike `RANK()` function, there is no gap in the sequence of ranked values (if two rows are ranked 1, the next rank is 2) +Unlike `rank()` function, there is no gap in the sequence of ranked values (if two rows are ranked 1, the next rank is 2) ==== == Parameters @@ -56,9 +56,9 @@ INSERT INTO winsales VALUES (30007, '9/7/2004', 3, 'c', 30, null); ---- -=== DENSE_RANK() with ORDER BY +=== `dense_rank()` with ORDER BY -This example executes the `DENSE_RANK()` function with `ORDER BY` keyword and calculates the descending dense rank of all rows based on the quantity sold: +This example executes the `dense_rank()` function with `ORDER BY` keyword and calculates the descending dense rank of all rows based on the quantity sold: [source,sql] ---- @@ -89,9 +89,9 @@ Output that includes the sales ID along with the quantity sold and both dense an (11 rows) ---- -=== DENSE_RANK() with ORDER BY and PARTITION_BY +=== `dense_rank()` with ORDER BY and PARTITION_BY -This example executes the `DENSE_RANK()` function with `ORDER BY` keyword and `PARTITION BY` clause, partitions the table by seller ID, orders each partition by the quantity, and assigns a dense rank to each row: +This example executes the `dense_rank()` function with `ORDER BY` keyword and `PARTITION BY` clause, partitions the table by seller ID, orders each partition by the quantity, and assigns a dense rank to each row: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/window-functions/first-value.adoc b/modules/reference/pages/sql/sql-functions/window-functions/first-value.adoc index fa9741c01..d4fef311e 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/first-value.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/first-value.adoc @@ -1,8 +1,8 @@ = first_value -:description: The FIRST_VALUE() is a window function that retrieves the first value in an ordered set of values within a specified partition. +:description: The `first_value()` is a window function that retrieves the first value in an ordered set of values within a specified partition. :page-topic-type: reference -The `FIRST_VALUE()` is a window function that retrieves the first value in an ordered set of values within a specified partition. +The `first_value()` is a window function that retrieves the first value in an ordered set of values within a specified partition. == Syntax @@ -56,7 +56,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 'PG-13'); ---- -The following query uses the `FIRST_VALUE()` function to retrieve the title of the film with the shortest duration, partitioning results by rating and ordering by length. +The following query uses the `first_value()` function to retrieve the title of the film with the shortest duration, partitioning results by rating and ordering by length. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/window-functions/lag.adoc b/modules/reference/pages/sql/sql-functions/window-functions/lag.adoc index a02708664..916ffe619 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/lag.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/lag.adoc @@ -1,8 +1,8 @@ = lag -:description: The LAG() window function returns the values from specific rows based on the offset argument (previous to the current row in the partition). +:description: The `lag()` window function returns the values from specific rows based on the offset argument (previous to the current row in the partition). :page-topic-type: reference -The `LAG()` window function returns the values from specific rows based on the offset argument (previous to the current row in the partition). It can be used with all xref:reference:sql/sql-data-types/index.adoc[data types supported by Redpanda SQL] +The `lag()` window function returns the values from specific rows based on the offset argument (previous to the current row in the partition). It can be used with all xref:reference:sql/sql-data-types/index.adoc[data types supported by Redpanda SQL] == Syntax @@ -54,7 +54,7 @@ INSERT INTO winsales VALUES === LAG(expression, offset) -This example executes the `LAG()` function with expression and offset parameters' values specified: +This example executes the `lag()` function with expression and offset parameters' values specified: [source,sql] ---- @@ -79,7 +79,7 @@ The query returns the buyer ID, date ID, quantity and previous quantity for all === LAG(expression, offset, default) -This example executes the `LAG()` function with expression, offset and default parameters' values specified: +This example executes the `lag()` function with expression, offset and default parameters' values specified: [source,sql] ---- @@ -109,9 +109,9 @@ The query returns the buyer ID, date ID, quantity and previous buyer ID for all (11 rows) ---- -=== Time series: LAG() to compare daily sales quantities +=== Time series: `lag()` to compare daily sales quantities -This example uses LAG() to compare each day's sales quantity (`qty`) with the previous day's quantity, ordered by `dateid`: +This example uses `lag()` to compare each day's sales quantity (`qty`) with the previous day's quantity, ordered by `dateid`: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/window-functions/last-value.adoc b/modules/reference/pages/sql/sql-functions/window-functions/last-value.adoc index d84125222..4495dd6fd 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/last-value.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/last-value.adoc @@ -1,8 +1,8 @@ = last_value -:description: The LAST_VALUE() is a window function that retrieves the last value in an ordered set of values within a specified partition. +:description: The `last_value()` is a window function that retrieves the last value in an ordered set of values within a specified partition. :page-topic-type: reference -The `LAST_VALUE()` is a window function that retrieves the last value in an ordered set of values within a specified partition. +The `last_value()` is a window function that retrieves the last value in an ordered set of values within a specified partition. == Syntax @@ -56,7 +56,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 'PG-13'); ---- -The following query uses the `LAST_VALUE()` function to retrieve the title of the film with the longest duration, partitioning results by rating and ordering by length. +The following query uses the `last_value()` function to retrieve the title of the film with the longest duration, partitioning results by rating and ordering by length. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/window-functions/lead.adoc b/modules/reference/pages/sql/sql-functions/window-functions/lead.adoc index 3f06fc9c8..ac20dd472 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/lead.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/lead.adoc @@ -1,8 +1,8 @@ = lead -:description: The LEAD() window function takes a column and an integer offset as arguments and returns the value of the cell in that column that is located at the s +:description: The `lead()` window function takes a column and an integer offset as arguments and returns the value of the cell in that column that is located at the s :page-topic-type: reference -The `LEAD()` window function takes a column and an integer offset as arguments, and returns the value of the cell in the column located at the specified number of rows after the current row. It can be used with all xref:reference:sql/sql-data-types/index.adoc[data types supported by Redpanda SQL] +The `lead()` window function takes a column and an integer offset as arguments, and returns the value of the cell in the column located at the specified number of rows after the current row. It can be used with all xref:reference:sql/sql-data-types/index.adoc[data types supported by Redpanda SQL] == Syntax @@ -54,7 +54,7 @@ INSERT INTO winsales VALUES === Lead(expression, offset) -This example executes the `LEAD()` function with expression and offset parameters' values specified: +This example executes the `lead()` function with expression and offset parameters' values specified: [source,sql] ---- @@ -79,7 +79,7 @@ This query returns the buyer ID, date ID, quantity and previous quantity for all === Expression, offset and default specified -This example executes the `LEAD()` function with expression, offset and default parameters' values specified: +This example executes the `lead()` function with expression, offset and default parameters' values specified: [source,sql] ---- @@ -109,9 +109,9 @@ The query returns the buyer ID, date ID, quantity and following buyer ID for all (11 rows) ---- -=== Time series: LEAD() to compare next day's sales quantity +=== Time series: `lead()` to compare next day's sales quantity -This example uses LEAD() to compare each day's sales quantity (`qty`) with the next day's quantity, ordered by `dateid`: +This example uses `lead()` to compare each day's sales quantity (`qty`) with the next day's quantity, ordered by `dateid`: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/window-functions/max.adoc b/modules/reference/pages/sql/sql-functions/window-functions/max.adoc index abcca2819..003159acb 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/max.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/max.adoc @@ -1,8 +1,8 @@ = max -:description: The MAX() window function computes the maximum value of an expression across a set of rows defined by a window specification. +:description: The `max()` window function computes the maximum value of an expression across a set of rows defined by a window specification. :page-topic-type: reference -The `MAX()` window function computes the maximum value of an expression across a set of rows defined by a window specification. +The `max()` window function computes the maximum value of an expression across a set of rows defined by a window specification. == Syntax @@ -53,7 +53,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 'PG-13'); ---- -The query uses the `MAX()` function to find the maximum length of films for each rating category and also calculates a running maximum length as you move through the films ordered by length. The `RunningMaxLength` column updates as it encounters longer films. +The query uses the `max()` function to find the maximum length of films for each rating category and also calculates a running maximum length as you move through the films ordered by length. The `RunningMaxLength` column updates as it encounters longer films. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/window-functions/min.adoc b/modules/reference/pages/sql/sql-functions/window-functions/min.adoc index b8f8e529f..d638e0276 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/min.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/min.adoc @@ -1,8 +1,8 @@ = min -:description: The MIN() window function computes the minimum value of an expression across a set of rows defined by a window specification. +:description: The `min()` window function computes the minimum value of an expression across a set of rows defined by a window specification. :page-topic-type: reference -The `MIN()` window function computes the minimum value of an expression across a set of rows defined by a window specification. +The `min()` window function computes the minimum value of an expression across a set of rows defined by a window specification. == Syntax @@ -53,7 +53,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 'PG-13'); ---- -The following query uses the `MIN()` to find the minimum length of films for each rating category and also calculates a running minimum length of films ordered by their length. +The following query uses the `min()` to find the minimum length of films for each rating category and also calculates a running minimum length of films ordered by their length. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/window-functions/nth-value.adoc b/modules/reference/pages/sql/sql-functions/window-functions/nth-value.adoc index fb5d2a55d..9aba932ce 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/nth-value.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/nth-value.adoc @@ -1,8 +1,8 @@ = nth_value -:description: The NTH_VALUE() is a window function that accesses the value from the nth row within a specified window frame. +:description: The `nth_value()` is a window function that accesses the value from the nth row within a specified window frame. :page-topic-type: reference -The `NTH_VALUE()` is a window function that accesses the value from the nth row within a specified window frame. +The `nth_value()` is a window function that accesses the value from the nth row within a specified window frame. == Syntax @@ -58,7 +58,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 'PG-13'); ---- -This query uses the `NTH_VALUE()` function to retrieve the title of the film with the second shortest duration, partitioning results by rating and ordering by length: +This query uses the `nth_value()` function to retrieve the title of the film with the second shortest duration, partitioning results by rating and ordering by length: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/window-functions/ntile.adoc b/modules/reference/pages/sql/sql-functions/window-functions/ntile.adoc index d4c64f62b..26e903772 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/ntile.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/ntile.adoc @@ -1,8 +1,8 @@ = ntile -:description: The NTILE() function is a window function used to divide an ordered data set into a specified number of approximately equal groups or buckets. +:description: The `ntile()` function is a window function used to divide an ordered data set into a specified number of approximately equal groups or buckets. :page-topic-type: reference -The `NTILE()` function is a window function used to divide an ordered data set into a specified number of approximately equal groups or buckets. This function assigns each group a bucket number starting form one. +The `ntile()` function is a window function used to divide an ordered data set into a specified number of approximately equal groups or buckets. This function assigns each group a bucket number starting form one. == Syntax @@ -57,7 +57,7 @@ INSERT INTO film(title, length, rating) VALUES ('CLOCKWORK PARADISE', 143, 'PG-13'); ---- -The following query uses the `NTILE()` function to divide the films into four quartiles based on their length: +The following query uses the `ntile()` function to divide the films into four quartiles based on their length: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/window-functions/percent-rank.adoc b/modules/reference/pages/sql/sql-functions/window-functions/percent-rank.adoc index 5889dff4c..ced0e4993 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/percent-rank.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/percent-rank.adoc @@ -1,8 +1,8 @@ = percent_rank -:description: PERCENT_RANK() window function determines the relative rank of a value in a group of values, based on the ORDER BY expression in the OVER clause. +:description: `percent_rank()` window function determines the relative rank of a value in a group of values, based on the ORDER BY expression in the OVER clause. :page-topic-type: reference -`PERCENT_RANK()` window function determines the relative rank of a value in a group of values, based on the `ORDER BY` expression in the `OVER` clause. It can be used with all xref:reference:sql/sql-data-types/index.adoc[data types supported by Redpanda SQL]. +`percent_rank()` window function determines the relative rank of a value in a group of values, based on the `ORDER BY` expression in the `OVER` clause. It can be used with all xref:reference:sql/sql-data-types/index.adoc[data types supported by Redpanda SQL]. == Syntax @@ -16,7 +16,7 @@ PERCENT_RANK() OVER ( ) ---- -The `PERCENT_RANK()` is calculated as: +The `percent_rank()` is calculated as: [source,bash] ---- @@ -25,7 +25,7 @@ The `PERCENT_RANK()` is calculated as: Where `r` is the rank of the current row and `n` is the total number of rows in the window or partition. -Rows with equal values for the ranking criteria receive the same relative rank. The output data type for this function is `DOUBLE PRECISION`. The output will indicate the rank of values in a table, regardless of the input types. +Rows with equal values for the ranking criteria receive the same relative rank. The output data type for this function is `double precision`. The output will indicate the rank of values in a table, regardless of the input types. * If the optional `PARTITION BY` expression is present, the rankings are reset for each group of rows * If the `ORDER BY` expression is omitted then all relative ranks are equal to 0 @@ -63,9 +63,9 @@ INSERT INTO winsales VALUES (30007, '9/7/2004', 3, 'c', 30, null); ---- -=== PERCENT_RANK() with ORDER BY +=== `percent_rank()` with ORDER BY -This example executes the `PERCENT_RANK()` function with `ORDER BY` keyword and calculates the descending percent rank of all rows based on the quantity sold: +This example executes the `percent_rank()` function with `ORDER BY` keyword and calculates the descending percent rank of all rows based on the quantity sold: [source,sql] ---- @@ -95,9 +95,9 @@ Output that includes the sales ID along with the quantity sold and both percent 40001 | 40 | 0 | 1 ---- -=== PERCENT_RANK() with ORDER BY and PARTITION BY +=== `percent_rank()` with ORDER BY and PARTITION BY -This example executes the `PERCENT_RANK()` function with `ORDER BY` keyword and `PARTITION BY` clause, partitions the table by seller ID, orders each partition by the quantity, and assigns a percent rank to each row: +This example executes the `percent_rank()` function with `ORDER BY` keyword and `PARTITION BY` clause, partitions the table by seller ID, orders each partition by the quantity, and assigns a percent rank to each row: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/window-functions/rank.adoc b/modules/reference/pages/sql/sql-functions/window-functions/rank.adoc index 016e0061e..617c3474a 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/rank.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/rank.adoc @@ -1,8 +1,8 @@ = rank -:description: The RANK() window function determines the rank of a value in a group of values, based on the ORDER BY expression in the OVER clause. +:description: The `rank()` window function determines the rank of a value in a group of values, based on the ORDER BY expression in the OVER clause. :page-topic-type: reference -The `RANK()` window function determines the rank of a value in a group of values, based on the `ORDER BY` expression in the `OVER` clause. It can be used with all xref:reference:sql/sql-data-types/index.adoc[data types supported by Redpanda SQL]. +The `rank()` window function determines the rank of a value in a group of values, based on the `ORDER BY` expression in the `OVER` clause. It can be used with all xref:reference:sql/sql-data-types/index.adoc[data types supported by Redpanda SQL]. == Syntax @@ -16,7 +16,7 @@ RANK() OVER ( ) ---- -Rows with equal values for the ranking criteria receive the same rank. The output type for this function is `BIGINT` and it indicates the rank of values in a table, regardles of the input types. +Rows with equal values for the ranking criteria receive the same rank. The output type for this function is `bigint` and it indicates the rank of values in a table, regardles of the input types. * If the optional `PARTITION BY` expression is present, the rankings are reset for each group of rows * If the `ORDER BY` expression is omitted then all ranks are equal to 1 @@ -52,9 +52,9 @@ INSERT INTO winsales VALUES (30007, '9/7/2004', 3, 'c', 30, null); ---- -=== RANK() with ORDER BY +=== `rank()` with ORDER BY -This example executes the `RANK()` function with `ORDER BY` keyword and calculates the rank of all rows based on the quantity sold: +This example executes the `rank()` function with `ORDER BY` keyword and calculates the rank of all rows based on the quantity sold: [source,sql] ---- @@ -84,9 +84,9 @@ Output that includes the sales ID along with the quantity sold and regular ranks (11 rows) ---- -=== RANK() with ORDER BY and PARTITION BY +=== `rank()` with ORDER BY and PARTITION BY -This example executes the `RANK()` function with `ORDER BY` keyword and `PARTITION BY` clause, partitions the table by seller ID, orders each partition by the quantity, and assigns a rank to each row: +This example executes the `rank()` function with `ORDER BY` keyword and `PARTITION BY` clause, partitions the table by seller ID, orders each partition by the quantity, and assigns a rank to each row: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/window-functions/row-number.adoc b/modules/reference/pages/sql/sql-functions/window-functions/row-number.adoc index 0d4ed3fd3..2bb54bca0 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/row-number.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/row-number.adoc @@ -1,8 +1,8 @@ = row_number -:description: The ROW_NUMBER() window function returns the number of the current row within its partition (counting from 1), based on the ORDER BY expression in the +:description: The `row_number()` window function returns the number of the current row within its partition (counting from 1), based on the ORDER BY expression in the :page-topic-type: reference -The `ROW_NUMBER()` window function returns the number of the current row within its partition (counting from 1), based on the `ORDER BY` expression in the `OVER` clause. It can be used with all xref:reference:sql/sql-data-types/index.adoc[data types] supported by Redpanda SQL. +The `row_number()` window function returns the number of the current row within its partition (counting from 1), based on the `ORDER BY` expression in the `OVER` clause. It can be used with all xref:reference:sql/sql-data-types/index.adoc[data types] supported by Redpanda SQL. == Syntax @@ -16,7 +16,7 @@ ROW_NUMBER() OVER ( ) ---- -The function returns a value of type `BIGINT`. Rows with equal values for the `ORDER BY` expression receive different row numbers nondeterministically. +The function returns a value of type `bigint`. Rows with equal values for the `ORDER BY` expression receive different row numbers nondeterministically. == Parameters @@ -49,9 +49,9 @@ INSERT INTO winsales VALUES (30007, '9/7/2004', 3, 'c', 30, null); ---- -=== ROW_NUMBER() with ORDER BY +=== `row_number()` with ORDER BY -This example executes the `ROW_NUMBER()` function with `ORDER BY` keyword, assigns a row number to each row, and orders the table by the row number (the results are sorted after the window function results are applied): +This example executes the `row_number()` function with `ORDER BY` keyword, assigns a row number to each row, and orders the table by the row number (the results are sorted after the window function results are applied): [source,sql] ---- @@ -81,9 +81,9 @@ The query returns: (11 rows) ---- -=== ROW_NUMBER() with ORDER BY and PARTITION BY +=== `row_number()` with ORDER BY and PARTITION BY -This example executes the `ROW_NUMBER()` function with `ORDER BY` keyword and `PARTITION BY` clause, partitions the table by seller ID, assigns a row number to each row, and orders the table by the sales ID and row number (the results are sorted after the window function results are applied): +This example executes the `row_number()` function with `ORDER BY` keyword and `PARTITION BY` clause, partitions the table by seller ID, assigns a row number to each row, and orders the table by the sales ID and row number (the results are sorted after the window function results are applied): [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/window-functions/sum.adoc b/modules/reference/pages/sql/sql-functions/window-functions/sum.adoc index 21374bbc8..269e84efe 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/sum.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/sum.adoc @@ -1,8 +1,8 @@ = sum -:description: The SUM() window function returns the sum of the input column or expression values. +:description: The `sum()` window function returns the sum of the input column or expression values. :page-topic-type: reference -The `SUM()` window function returns the sum of the input column or expression values. It can be used with a `RANGE` clause, that defines a logical frame of rows based on the values of the current row, rather than a fixed number of rows. +The `sum()` window function returns the sum of the input column or expression values. It can be used with a `RANGE` clause, that defines a logical frame of rows based on the values of the current row, rather than a fixed number of rows. == Syntax @@ -17,11 +17,11 @@ SUM(expression) OVER ( ) ---- -The expression's argument types supported by the `SUM` window function are `INTEGER`, `BIGINT`, `REAL` and `DOUBLE PRECISION`. The return types of the `SUM` function are: `BIGINT` for integer and `DOUBLE PRECISION` for floating-point arguments. +The expression's argument types supported by the `sum` window function are `integer`, `bigint`, `real` and `double precision`. The return types of the `sum` function are: `bigint` for integer and `double precision` for floating-point arguments. [NOTE] ==== -The `SUM()` window function works with numeric values and ignores NULL ones +The `sum()` window function works with numeric values and ignores NULL ones ==== == Parameters @@ -57,9 +57,9 @@ INSERT INTO winsales VALUES (30007, '9/7/2004', 3, 'c', 30, null); ---- -=== SUM() with ORDER BY +=== `sum()` with ORDER BY -This example executes the `SUM()` window function with `ORDER BY` keyword: +This example executes the `sum()` window function with `ORDER BY` keyword: [source,sql] ---- @@ -89,7 +89,7 @@ The output from this query includes the sales ID, date ID, seller ID, quantity a (11 rows) ---- -=== SUM() with ORDER BY and ROWS frame +=== `sum()` with ORDER BY and ROWS frame This example calculates the running total of `qty` ordered by dateid and salesid using a `ROWS UNBOUNDED PRECEDING` frame, which sums all rows from the start up to the current row: @@ -123,9 +123,9 @@ The query returns: The `running_qty_sum` column shows the cumulative sum of `qty` ordered by `dateid` and `salesid`. For each row, it sums all `qty` values from the first row up to the current row in that order. -=== SUM() with ORDER BY and PARTITION BY +=== `sum()` with ORDER BY and PARTITION BY -This example executes the `SUM()` function with `ORDER BY` keyword and `PARTITION BY` clause: +This example executes the `sum()` function with `ORDER BY` keyword and `PARTITION BY` clause: [source,sql] ---- @@ -155,7 +155,7 @@ The query returns: (11 rows) ---- -=== Time series: SUM() with RANGE BETWEEN for last 30 days +=== Time series: `sum()` with RANGE BETWEEN for last 30 days This example demonstrates a common time series use case: calculating the rolling sum of sales quantity over the last 30 days for each row, using the RANGE BETWEEN `interval` '`30 days`' PRECEDING AND CURRENT `row` frame: diff --git a/modules/reference/pages/sql/sql-statements/set-show.adoc b/modules/reference/pages/sql/sql-statements/set-show.adoc index 0dac3f447..a8ac4fba3 100644 --- a/modules/reference/pages/sql/sql-statements/set-show.adoc +++ b/modules/reference/pages/sql/sql-statements/set-show.adoc @@ -32,7 +32,7 @@ Available options: * `extra_float_digits`: Number of extra digits displayed after the decimal point in floating-point numbers. * `application_name`: Custom name for the application. * `timezone`: Time zone used for date and time functions. -* `client_min_messages`: Minimum message level sent to the client. Valid values: `DEBUG5`, `DEBUG4`, `DEBUG3`, `DEBUG2`, `DEBUG1`, `LOG`, `NOTICE`, `WARNING`, and `ERROR`. +* `client_min_messages`: Minimum message level sent to the client. Valid values: `DEBUG5`, `DEBUG4`, `DEBUG3`, `DEBUG2`, `DEBUG1`, `log`, `NOTICE`, `WARNING`, and `ERROR`. * `search_path`: Namespaces in which Redpanda SQL looks for tables. * `oxla.enable_fast_math`: Enables math optimizations that trade precision for speed using faster, less accurate functions. From 76845968db272ec001b3398f40805f19972b4c36 Mon Sep 17 00:00:00 2001 From: Kat Batuigas <36839689+kbatuigas@users.noreply.github.com> Date: Fri, 22 May 2026 17:22:11 -0700 Subject: [PATCH 10/16] Update modules/get-started/pages/whats-new-cloud.adoc Co-authored-by: Michele Cyran --- modules/get-started/pages/whats-new-cloud.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/get-started/pages/whats-new-cloud.adoc b/modules/get-started/pages/whats-new-cloud.adoc index 2e6ef51dd..1c011045d 100644 --- a/modules/get-started/pages/whats-new-cloud.adoc +++ b/modules/get-started/pages/whats-new-cloud.adoc @@ -10,7 +10,7 @@ This page lists new features added to Redpanda Cloud. === Redpanda SQL -Redpanda SQL is available on BYOC clusters running on AWS. Run real-time SQL queries on Redpanda topic data, including the Iceberg history of Iceberg-enabled topics, using standard PostgreSQL syntax. Connect with `psql` or any PostgreSQL driver. See the xref:sql:get-started/sql-quickstart.adoc[quickstart guide] and xref:sql:get-started/overview.adoc[Redpanda SQL Overview]. +Redpanda SQL is available on BYOC clusters running on AWS. Run real-time SQL queries on Redpanda topic data, including the Iceberg history of Iceberg-enabled topics, using standard PostgreSQL syntax. Connect with `psql` or any PostgreSQL driver. See the xref:sql:get-started/sql-quickstart.adoc[Quickstart] and xref:sql:get-started/overview.adoc[Overview]. === Centralized egress for BYOC on AWS: beta From 1381961efa35361e756df29e5fca7ebc3a21a9b5 Mon Sep 17 00:00:00 2001 From: Kat Batuigas Date: Fri, 22 May 2026 19:33:36 -0700 Subject: [PATCH 11/16] Lowercase subsection headings and xref labels per PG convention - numeric.adoc: H2 subsections use backticked-lowercase type names (`int` type, `bigint` type, etc.) to match numeric-data-type-aliases.adoc. - create-table.adoc, query-nested-fields.adoc: xref labels for type pages (ROW, JSON) now use lowercase backticked form. - aggregate-functions/index.adoc, aggregate-functions/statistics/index.adoc, window-functions/index.adoc: function-name xref labels lowercased to backticked function-call form (sum() instead of SUM, regr_avgx() instead of REGR_AVGX, etc.). DISTINCT xref label preserved as uppercase (SQL keyword, not a function). - substring.adoc, position.adoc: cross-reference labels for substr and strpos lowercased. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../pages/sql/sql-data-types/bytea.adoc | 4 +-- .../pages/sql/sql-data-types/json.adoc | 2 +- .../sql-data-types/numeric-type/numeric.adoc | 8 ++--- .../aggregate-functions/index.adoc | 18 +++++----- .../aggregate-functions/statistics/index.adoc | 36 +++++++++---------- .../string-functions/position.adoc | 2 +- .../string-functions/substring.adoc | 2 +- .../sql-functions/window-functions/index.adoc | 36 +++++++++---------- .../sql/sql-statements/create-table.adoc | 16 ++++----- .../redpanda-sql-vs-postgresql.adoc | 2 +- .../pages/query-data/query-nested-fields.adoc | 8 ++--- 11 files changed, 67 insertions(+), 67 deletions(-) diff --git a/modules/reference/pages/sql/sql-data-types/bytea.adoc b/modules/reference/pages/sql/sql-data-types/bytea.adoc index 40c10424f..dfc593f3f 100644 --- a/modules/reference/pages/sql/sql-data-types/bytea.adoc +++ b/modules/reference/pages/sql/sql-data-types/bytea.adoc @@ -85,10 +85,10 @@ The bytea data type supports a narrow set of operations. Operations not listed a | `'\xDEADBEEF'::bytea` | `length(payload)` -| Returns the byte count as `INT`. Distinct from `length(text)`, which returns the codepoint count. +| Returns the byte count as `int`. Distinct from `length(text)`, which returns the codepoint count. | `octet_length(payload)` -| Returns the byte count as `INT`. Equivalent to `length()` on a bytea value. +| Returns the byte count as `int`. Equivalent to `length()` on a bytea value. |=== == Read bytea from external sources diff --git a/modules/reference/pages/sql/sql-data-types/json.adoc b/modules/reference/pages/sql/sql-data-types/json.adoc index c8eb31478..4690340e5 100644 --- a/modules/reference/pages/sql/sql-data-types/json.adoc +++ b/modules/reference/pages/sql/sql-data-types/json.adoc @@ -1,5 +1,5 @@ = json -:description: The `json` data type stores values in JSON, an open standard format for key-value data. +:description: The `json` data type stores values in `json`, an open standard format for key-value data. :page-topic-type: reference == Overview diff --git a/modules/reference/pages/sql/sql-data-types/numeric-type/numeric.adoc b/modules/reference/pages/sql/sql-data-types/numeric-type/numeric.adoc index 3607a7dbb..bba284095 100644 --- a/modules/reference/pages/sql/sql-data-types/numeric-type/numeric.adoc +++ b/modules/reference/pages/sql/sql-data-types/numeric-type/numeric.adoc @@ -2,7 +2,7 @@ :description: Reference for numeric data types in Redpanda SQL. :page-topic-type: reference -== Int type +== `int` type The `int` data type represents whole numbers without decimal points. It is a 32-bit signed integer with a range from -2147483648 to 2147483647. @@ -52,7 +52,7 @@ This returns the following result. (4 rows) ---- -== Bigint type +== `bigint` type The `bigint` data type stores large whole numbers that exceed the `int` range. It is a 64-bit signed integer with a range from -9223372036854775808 to 9223372036854775807. @@ -101,7 +101,7 @@ The query returns the following output: (4 rows) ---- -== Real type +== `real` type The `real` data type is a 32-bit floating-point number compliant with the IEEE 754 binary32 format. @@ -207,7 +207,7 @@ The final output will only return numbers that match the range. (1 row) ---- -== Double precision type +== `double precision` type The `double precision` data type is a 64-bit floating-point number compliant with the IEEE 754 binary64 format. diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/index.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/index.adoc index 57e401e94..add89b256 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/index.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/index.adoc @@ -6,15 +6,15 @@ Aggregate functions compute a single result from a set of input values. Redpanda [width="100%",cols="36%,64%",options="header",] |=== |Function Name |Description -|xref:reference:sql/sql-functions/aggregate-functions/sum.adoc[SUM] |Calculates and returns the sum of all values -|xref:reference:sql/sql-functions/aggregate-functions/min.adoc[MIN] |Calculates and returns the minimum value -|xref:reference:sql/sql-functions/aggregate-functions/for-min.adoc[FOR_MIN] |Calculates and returns a value corresponding to the minimal metric in the same row from a set of values -|xref:reference:sql/sql-functions/aggregate-functions/max.adoc[MAX] |Calculates and returns the maximum value -|xref:reference:sql/sql-functions/aggregate-functions/for-max.adoc[FOR_MAX] |Calculates and Returns a value corresponding to the maximum metric in the same row from a set of values -|xref:reference:sql/sql-functions/aggregate-functions/avg.adoc[AVG] |Calculates and returns the average value -|xref:reference:sql/sql-functions/aggregate-functions/count.adoc[COUNT] |Counts the number of rows -|xref:reference:sql/sql-functions/aggregate-functions/bool-and.adoc[BOOL_AND] |Calculates the boolean of all the boolean values in the aggregated group. `FALSE` if at least one of aggregated rows is `FALSE` -|xref:reference:sql/sql-functions/aggregate-functions/bool-or.adoc[BOOL_OR] |Calculates the boolean of all the boolean values in the aggregated group. `TRUE` if at least one of aggregated rows is `TRUE` +|xref:reference:sql/sql-functions/aggregate-functions/sum.adoc[`sum()`] |Calculates and returns the sum of all values +|xref:reference:sql/sql-functions/aggregate-functions/min.adoc[`min()`] |Calculates and returns the minimum value +|xref:reference:sql/sql-functions/aggregate-functions/for-min.adoc[`for_min()`] |Calculates and returns a value corresponding to the minimal metric in the same row from a set of values +|xref:reference:sql/sql-functions/aggregate-functions/max.adoc[`max()`] |Calculates and returns the maximum value +|xref:reference:sql/sql-functions/aggregate-functions/for-max.adoc[`for_max()`] |Calculates and Returns a value corresponding to the maximum metric in the same row from a set of values +|xref:reference:sql/sql-functions/aggregate-functions/avg.adoc[`avg()`] |Calculates and returns the average value +|xref:reference:sql/sql-functions/aggregate-functions/count.adoc[`count()`] |Counts the number of rows +|xref:reference:sql/sql-functions/aggregate-functions/bool-and.adoc[`bool_and()`] |Calculates the boolean of all the boolean values in the aggregated group. `FALSE` if at least one of aggregated rows is `FALSE` +|xref:reference:sql/sql-functions/aggregate-functions/bool-or.adoc[`bool_or()`] |Calculates the boolean of all the boolean values in the aggregated group. `TRUE` if at least one of aggregated rows is `TRUE` |=== [width="100%",cols="36%,64%",options="header",] diff --git a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/index.adoc b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/index.adoc index 9cd3aa026..b1601521f 100644 --- a/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/index.adoc +++ b/modules/reference/pages/sql/sql-functions/aggregate-functions/statistics/index.adoc @@ -6,22 +6,22 @@ Aggregate functions for statistics are typically used for statistical analysis. [width="100%",cols="42%,58%",options="header",] |=== |Functions |Description -|xref:reference:sql/sql-functions/aggregate-functions/statistics/corr.adoc[CORR] |Calculates the Pearson correlation coefficient between two sets of number pairs -|xref:reference:sql/sql-functions/aggregate-functions/statistics/covar-pop.adoc[COVAR_POP] |Calculates the population covariance between two sets of number pairs -|xref:reference:sql/sql-functions/aggregate-functions/statistics/covar-samp.adoc[COVAR_SAMP] |Calculates the sample covariance between two sets of number pairs -|xref:reference:sql/sql-functions/aggregate-functions/statistics/regr-avgx.adoc[REGR_AVGX] |Calculates the average of the independent variable (sum(X)/N) -|xref:reference:sql/sql-functions/aggregate-functions/statistics/regr-avgy.adoc[REGR_AVGY] |Calculates the average of the dependent variable (sum(Y)/N) -|xref:reference:sql/sql-functions/aggregate-functions/statistics/regr-count.adoc[REGR_COUNT] |Calculates the number of input rows in which both expressions are non-null -|xref:reference:sql/sql-functions/aggregate-functions/statistics/regr-intercept.adoc[REGR_INTERCEPT] |Calculates the y-intercept of the univariate linear regression line for a group of data points -|xref:reference:sql/sql-functions/aggregate-functions/statistics/regr-r2.adoc[REGR_R2] |Calculates the coefficient of determination (R2) for a linear regression model -|xref:reference:sql/sql-functions/aggregate-functions/statistics/regr-slope.adoc[REGR_SLOPE] |Calculates slope of the least-squares-fit linear equation determined by the (X, Y) pairs -|xref:reference:sql/sql-functions/aggregate-functions/statistics/regr-sxx.adoc[REGR_SXX] |Calculates the sum(X2) - sum(X)2/N ("`sum of squares`" of the independent variable) -|xref:reference:sql/sql-functions/aggregate-functions/statistics/regr-sxy.adoc[REGR_SXY] |Calculates the sum(X_Y) - sum(X)_ sum(Y)/N ("`sum of products`" of independent times dependent variable) -|xref:reference:sql/sql-functions/aggregate-functions/statistics/regr-syy.adoc[REGR_SYY] |Calculates the sum(Y2) - sum(Y)2/N ("`sum of squares`" of the dependent variable) -|xref:reference:sql/sql-functions/aggregate-functions/statistics/stddev.adoc[STDDEV] |Calculates the sample standard deviation of a set of numeric values -|xref:reference:sql/sql-functions/aggregate-functions/statistics/stddev-pop.adoc[STDDEV_POP] |Calculates the population standard deviation of the input values -|xref:reference:sql/sql-functions/aggregate-functions/statistics/stddev-samp.adoc[STDDEV_SAMP] |Calculates the sample standard deviation of the input values -|xref:reference:sql/sql-functions/aggregate-functions/statistics/variance.adoc[VARIANCE] |Calculates the the sample variance of a set of numeric values. -|xref:reference:sql/sql-functions/aggregate-functions/statistics/var-pop.adoc[VAR_POP] |Calculates the population variance of the input values (square of the population standard deviation) -|xref:reference:sql/sql-functions/aggregate-functions/statistics/var-samp.adoc[VAR_SAMP] |Calculates the sample variance of the input values (square of the sample standard deviation) +|xref:reference:sql/sql-functions/aggregate-functions/statistics/corr.adoc[`corr()`] |Calculates the Pearson correlation coefficient between two sets of number pairs +|xref:reference:sql/sql-functions/aggregate-functions/statistics/covar-pop.adoc[`covar_pop()`] |Calculates the population covariance between two sets of number pairs +|xref:reference:sql/sql-functions/aggregate-functions/statistics/covar-samp.adoc[`covar_samp()`] |Calculates the sample covariance between two sets of number pairs +|xref:reference:sql/sql-functions/aggregate-functions/statistics/regr-avgx.adoc[`regr_avgx()`] |Calculates the average of the independent variable (sum(X)/N) +|xref:reference:sql/sql-functions/aggregate-functions/statistics/regr-avgy.adoc[`regr_avgy()`] |Calculates the average of the dependent variable (sum(Y)/N) +|xref:reference:sql/sql-functions/aggregate-functions/statistics/regr-count.adoc[`regr_count()`] |Calculates the number of input rows in which both expressions are non-null +|xref:reference:sql/sql-functions/aggregate-functions/statistics/regr-intercept.adoc[`regr_intercept()`] |Calculates the y-intercept of the univariate linear regression line for a group of data points +|xref:reference:sql/sql-functions/aggregate-functions/statistics/regr-r2.adoc[`regr_r2()`] |Calculates the coefficient of determination (R2) for a linear regression model +|xref:reference:sql/sql-functions/aggregate-functions/statistics/regr-slope.adoc[`regr_slope()`] |Calculates slope of the least-squares-fit linear equation determined by the (X, Y) pairs +|xref:reference:sql/sql-functions/aggregate-functions/statistics/regr-sxx.adoc[`regr_sxx()`] |Calculates the sum(X2) - sum(X)2/N ("`sum of squares`" of the independent variable) +|xref:reference:sql/sql-functions/aggregate-functions/statistics/regr-sxy.adoc[`regr_sxy()`] |Calculates the sum(X_Y) - sum(X)_ sum(Y)/N ("`sum of products`" of independent times dependent variable) +|xref:reference:sql/sql-functions/aggregate-functions/statistics/regr-syy.adoc[`regr_syy()`] |Calculates the sum(Y2) - sum(Y)2/N ("`sum of squares`" of the dependent variable) +|xref:reference:sql/sql-functions/aggregate-functions/statistics/stddev.adoc[`stddev()`] |Calculates the sample standard deviation of a set of numeric values +|xref:reference:sql/sql-functions/aggregate-functions/statistics/stddev-pop.adoc[`stddev_pop()`] |Calculates the population standard deviation of the input values +|xref:reference:sql/sql-functions/aggregate-functions/statistics/stddev-samp.adoc[`stddev_samp()`] |Calculates the sample standard deviation of the input values +|xref:reference:sql/sql-functions/aggregate-functions/statistics/variance.adoc[`variance()`] |Calculates the the sample variance of a set of numeric values. +|xref:reference:sql/sql-functions/aggregate-functions/statistics/var-pop.adoc[`var_pop()`] |Calculates the population variance of the input values (square of the population standard deviation) +|xref:reference:sql/sql-functions/aggregate-functions/statistics/var-samp.adoc[`var_samp()`] |Calculates the sample variance of the input values (square of the sample standard deviation) |=== diff --git a/modules/reference/pages/sql/sql-functions/string-functions/position.adoc b/modules/reference/pages/sql/sql-functions/string-functions/position.adoc index 4526b2d2d..62917bda5 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/position.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/position.adoc @@ -2,7 +2,7 @@ :description: The `position()` function returns the position of the first occurrence of a substring in a string. :page-topic-type: reference -The `position()` function returns the position of the first occurrence of a substring in a string. It works the same as xref:reference:sql/sql-functions/string-functions/strpos.adoc[STRPOS], but it has slightly different syntax. +The `position()` function returns the position of the first occurrence of a substring in a string. It works the same as xref:reference:sql/sql-functions/string-functions/strpos.adoc[`strpos()`], but it has slightly different syntax. == Syntax diff --git a/modules/reference/pages/sql/sql-functions/string-functions/substring.adoc b/modules/reference/pages/sql/sql-functions/string-functions/substring.adoc index eb3ac6b1e..f29a0f3dc 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/substring.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/substring.adoc @@ -4,7 +4,7 @@ [WARNING] ==== -SUBSTR is an alias for SUBSTRING. Learn more at xref:reference:sql/sql-functions/string-functions/substr.adoc[SUBSTR] documentation. +SUBSTR is an alias for SUBSTRING. Learn more at xref:reference:sql/sql-functions/string-functions/substr.adoc[`substr()`] documentation. ==== The `substring()` function lets you extract a part of a string and return that substring. diff --git a/modules/reference/pages/sql/sql-functions/window-functions/index.adoc b/modules/reference/pages/sql/sql-functions/window-functions/index.adoc index eb6e98879..8c5f80eb4 100644 --- a/modules/reference/pages/sql/sql-functions/window-functions/index.adoc +++ b/modules/reference/pages/sql/sql-functions/window-functions/index.adoc @@ -8,13 +8,13 @@ Window functions is a group of SQL functions, that operate on a partition or "`w [width="100%",cols="40%,60%",options="header",] |=== |Function Name |Description -|xref:reference:sql/sql-functions/window-functions/count.adoc[COUNT] |Counts all the rows or those specified by the given expression -|xref:reference:sql/sql-functions/window-functions/avg.adoc[AVG] |Calculates the average (arithmetic mean) of a set of numeric values within a window -|xref:reference:sql/sql-functions/window-functions/sum.adoc[SUM] |Calculates and returns the sum of values from the input column or expression values -|xref:reference:sql/sql-functions/window-functions/min.adoc[MIN] |Computes the minimum value of an expression across a set of rows -|xref:reference:sql/sql-functions/window-functions/max.adoc[MAX] |Computes the maximum value of an expression across a set of rows -|xref:reference:sql/sql-functions/window-functions/bool-and.adoc[BOOL_AND] |Evaluates whether all values within a specified window of rows are true -|xref:reference:sql/sql-functions/window-functions/bool-or.adoc[BOOL_OR] |Evaluates whether at least one value within a specified window of rows is true +|xref:reference:sql/sql-functions/window-functions/count.adoc[`count()`] |Counts all the rows or those specified by the given expression +|xref:reference:sql/sql-functions/window-functions/avg.adoc[`avg()`] |Calculates the average (arithmetic mean) of a set of numeric values within a window +|xref:reference:sql/sql-functions/window-functions/sum.adoc[`sum()`] |Calculates and returns the sum of values from the input column or expression values +|xref:reference:sql/sql-functions/window-functions/min.adoc[`min()`] |Computes the minimum value of an expression across a set of rows +|xref:reference:sql/sql-functions/window-functions/max.adoc[`max()`] |Computes the maximum value of an expression across a set of rows +|xref:reference:sql/sql-functions/window-functions/bool-and.adoc[`bool_and()`] |Evaluates whether all values within a specified window of rows are true +|xref:reference:sql/sql-functions/window-functions/bool-or.adoc[`bool_or()`] |Evaluates whether at least one value within a specified window of rows is true |=== == Ranking functions @@ -22,10 +22,10 @@ Window functions is a group of SQL functions, that operate on a partition or "`w [width="100%",cols="<40%,<60%",options="header",] |=== |*Function Name* |*Description* -|xref:reference:sql/sql-functions/window-functions/row-number.adoc[ROW_NUMBER] |Returns the current row index within its partition (beginning with 1) -|xref:reference:sql/sql-functions/window-functions/rank.adoc[RANK] |Calculates and returns the rank of a value within a specified group of values -|xref:reference:sql/sql-functions/window-functions/dense-rank.adoc[DENSE_RANK] |Calculates the percent rank of a value within a group and returns the result -|xref:reference:sql/sql-functions/window-functions/ntile.adoc[NTILE] |Divides an ordered data set into a specified number of approximately equal groups +|xref:reference:sql/sql-functions/window-functions/row-number.adoc[`row_number()`] |Returns the current row index within its partition (beginning with 1) +|xref:reference:sql/sql-functions/window-functions/rank.adoc[`rank()`] |Calculates and returns the rank of a value within a specified group of values +|xref:reference:sql/sql-functions/window-functions/dense-rank.adoc[`dense_rank()`] |Calculates the percent rank of a value within a group and returns the result +|xref:reference:sql/sql-functions/window-functions/ntile.adoc[`ntile()`] |Divides an ordered data set into a specified number of approximately equal groups |=== == Distribution functions @@ -33,8 +33,8 @@ Window functions is a group of SQL functions, that operate on a partition or "`w [width="100%",cols="<40%,<60%",options="header",] |=== |*Function Name* |*Description* -|xref:reference:sql/sql-functions/window-functions/cume-dist.adoc[CUME_DIST] |Calculates the cumulative distribution of a value within a set of values -|xref:reference:sql/sql-functions/window-functions/percent-rank.adoc[PERCENT_RANK] |Calculates and returns the percent rank of a value within a specified group of values +|xref:reference:sql/sql-functions/window-functions/cume-dist.adoc[`cume_dist()`] |Calculates the cumulative distribution of a value within a set of values +|xref:reference:sql/sql-functions/window-functions/percent-rank.adoc[`percent_rank()`] |Calculates and returns the percent rank of a value within a specified group of values |=== == Value functions @@ -42,11 +42,11 @@ Window functions is a group of SQL functions, that operate on a partition or "`w [width="100%",cols="<40%,<60%",options="header",] |=== |*Function Name* |*Description* -|xref:reference:sql/sql-functions/window-functions/first-value.adoc[FIRST_VALUE] |Returns the first value in an ordered set of values within a specified partition -|xref:reference:sql/sql-functions/window-functions/last-value.adoc[LAST_VALUE] |Returns the last value in an ordered set of values within a specified partition -|xref:reference:sql/sql-functions/window-functions/nth-value.adoc[NTH_VALUE] |Returns a value from the nth row in an ordered partition of a result set -|xref:reference:sql/sql-functions/window-functions/lag.adoc[LAG] |Returns the values for a row located at a defined offset, either above or below the current row within the partition -|xref:reference:sql/sql-functions/window-functions/lead.adoc[LEAD] |Returns the values for a row located at a defined offset, either above or below the current row within the partition +|xref:reference:sql/sql-functions/window-functions/first-value.adoc[`first_value()`] |Returns the first value in an ordered set of values within a specified partition +|xref:reference:sql/sql-functions/window-functions/last-value.adoc[`last_value()`] |Returns the last value in an ordered set of values within a specified partition +|xref:reference:sql/sql-functions/window-functions/nth-value.adoc[`nth_value()`] |Returns a value from the nth row in an ordered partition of a result set +|xref:reference:sql/sql-functions/window-functions/lag.adoc[`lag()`] |Returns the values for a row located at a defined offset, either above or below the current row within the partition +|xref:reference:sql/sql-functions/window-functions/lead.adoc[`lead()`] |Returns the values for a row located at a defined offset, either above or below the current row within the partition |=== == Window clause diff --git a/modules/reference/pages/sql/sql-statements/create-table.adoc b/modules/reference/pages/sql/sql-statements/create-table.adoc index 3ff8c7ecb..5ca60a9cc 100644 --- a/modules/reference/pages/sql/sql-statements/create-table.adoc +++ b/modules/reference/pages/sql/sql-statements/create-table.adoc @@ -53,7 +53,7 @@ a|How to handle records that fail deserialization. |No a|How to map nested structures from the topic schema to SQL columns. -* `COMPOUND` (default): Maps each nested structure to a user-defined type with named fields, queryable using `(column).field_name` syntax. Cyclic types are not supported in `COMPOUND` mode. Use `JSON` for recursive schemas. See xref:reference:sql/sql-data-types/row.adoc[ROW] for the field-access syntax. +* `COMPOUND` (default): Maps each nested structure to a user-defined type with named fields, queryable using `(column).field_name` syntax. Cyclic types are not supported in `COMPOUND` mode. Use `JSON` for recursive schemas. See xref:reference:sql/sql-data-types/row.adoc[`row`] for the field-access syntax. * `JSON`: Stores each nested structure as a JSON value. Required for recursive (cyclic) types. |`output_schema_message_full_name` @@ -86,17 +86,17 @@ Contains Kafka record metadata. Always present on every row. |Field |Type |Nullable |Description |`partition` -|`INT` +|`int` |No |Partition the record was read from. |`offset` -|`BIGINT` +|`bigint` |No |Offset of the record within its partition. |`timestamp` -|`TIMESTAMP WITH TIME ZONE` +|`timestamp with time zone` |Yes |Record timestamp. @@ -106,12 +106,12 @@ Contains Kafka record metadata. Always present on every row. |Record headers, as an array where each element is a struct of header name and value bytes. |`key` -|`BYTEA` +|`bytea` |Yes |Record key bytes. |`timestamp_type` -|`INT` +|`int` |Yes |Kafka timestamp type code. `0` for `CreateTime`, `1` for `LogAppendTime`. `NULL` when not available. |=== @@ -127,12 +127,12 @@ Use `redpanda_raw` as a dead-letter pattern. Rows whose value fails schema deser |Field |Type |Nullable |Description |`key` -|`BYTEA` +|`bytea` |Yes |Raw record key bytes. |`value` -|`BYTEA` +|`bytea` |Yes |Raw record value bytes that failed to decode. |=== diff --git a/modules/sql/pages/get-started/redpanda-sql-vs-postgresql.adoc b/modules/sql/pages/get-started/redpanda-sql-vs-postgresql.adoc index 3cb8ed78b..20a5b2e1d 100644 --- a/modules/sql/pages/get-started/redpanda-sql-vs-postgresql.adoc +++ b/modules/sql/pages/get-started/redpanda-sql-vs-postgresql.adoc @@ -79,7 +79,7 @@ SELECT COS(0), LN(1); === ABS output -The `ABS` function returns different results for decimal inputs: +The `abs` function returns different results for decimal inputs: [source,sql] ---- diff --git a/modules/sql/pages/query-data/query-nested-fields.adoc b/modules/sql/pages/query-data/query-nested-fields.adoc index b86bbdf66..a6fc254a8 100644 --- a/modules/sql/pages/query-data/query-nested-fields.adoc +++ b/modules/sql/pages/query-data/query-nested-fields.adoc @@ -6,7 +6,7 @@ :learning-objective-2: Query nested fields using ROW field-access syntax :learning-objective-3: Resolve cyclic-reference errors -When a glossterm:topic[]'s schema includes nested Protobuf, Avro, or JSON message types, you can map those nested structures as user-defined types (UDTs) with named fields. UDT columns are queryable using SQL `ROW` field-access syntax instead of opaque JSON, so nested fields are queryable by name, includable in projections, and usable in `WHERE`, `GROUP BY`, and `ORDER BY` clauses without parsing JSON at query time. +When a glossterm:topic[]'s schema includes nested Protobuf, Avro, or JSON message types, you can map those nested structures as user-defined types (UDTs) with named fields. UDT columns are queryable using SQL `row` field-access syntax instead of opaque JSON, so nested fields are queryable by name, includable in projections, and usable in `WHERE`, `GROUP BY`, and `ORDER BY` clauses without parsing JSON at query time. Use this page to: @@ -89,7 +89,7 @@ For schemas with multiple levels of nesting, chain the parenthesized field acces SELECT ((customer).address).zip_code FROM default_redpanda_catalog=>orders; ---- -For the full `ROW` reference, including comparison operators, NULL handling, and `::text` casting, see xref:reference:sql/sql-data-types/row.adoc[ROW]. +For the full `row` reference, including comparison operators, NULL handling, and `::text` casting, see xref:reference:sql/sql-data-types/row.adoc[`row`]. [[handle-recursive-cyclic-schemas]] == Handle recursive (cyclic) schemas @@ -111,7 +111,7 @@ CREATE TABLE default_redpanda_catalog=>comments WITH ( ); ---- -Query JSON-mapped fields with standard JSON functions instead of ROW field access. See xref:reference:sql/sql-data-types/json.adoc[JSON]. +Query JSON-mapped fields with standard JSON functions instead of `row` field access. See xref:reference:sql/sql-data-types/json.adoc[`json`]. == Choose between COMPOUND and JSON @@ -132,5 +132,5 @@ Query JSON-mapped fields with standard JSON functions instead of ROW field acces * xref:sql:query-data/query-streaming-topics.adoc[Query streaming topics]: Query a topic without Iceberg history. * xref:sql:query-data/query-iceberg-topics.adoc[Query Iceberg-enabled topics]: Query a topic with both its live streaming data and Iceberg history. Use `struct_mapping_policy = 'COMPOUND'` so nested fields align between the Redpanda topic and the linked Iceberg table. -* xref:reference:sql/sql-data-types/row.adoc[ROW]: Full reference for the `ROW` data type, including comparisons, NULL semantics, and conversion to text. +* xref:reference:sql/sql-data-types/row.adoc[`row`]: Full reference for the `row` data type, including comparisons, NULL semantics, and conversion to text. * xref:reference:sql/sql-statements/create-table.adoc[CREATE TABLE]: Complete option list for mapping a Redpanda topic to a SQL table. From 6d4615f8774c958348d0972b28675e3ed41386ec Mon Sep 17 00:00:00 2001 From: Kat Batuigas Date: Fri, 22 May 2026 19:36:28 -0700 Subject: [PATCH 12/16] DOC-2207: Document SELECT DISTINCT Add a SELECT DISTINCT section to select.adoc covering the supported form and the unsupported PostgreSQL-specific DISTINCT ON form. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../pages/sql/sql-statements/select.adoc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/reference/pages/sql/sql-statements/select.adoc b/modules/reference/pages/sql/sql-statements/select.adoc index ed58ff395..bdbd686ff 100644 --- a/modules/reference/pages/sql/sql-statements/select.adoc +++ b/modules/reference/pages/sql/sql-statements/select.adoc @@ -126,3 +126,20 @@ SELECT name FROM default_redpanda_catalog=>student_data WHERE domicile='Sydney'; | Will | +----------+ ---- + +== SELECT DISTINCT + +To return only unique rows from the result set, add the `DISTINCT` keyword after `SELECT`: + +[source,sql] +---- +SELECT DISTINCT column1, column2, ... +FROM default_redpanda_catalog=>table_name; +---- + +`DISTINCT` deduplicates rows based on the combined values of all listed columns. + +[NOTE] +==== +Redpanda SQL does not support `SELECT DISTINCT ON (column_list) ...`, the PostgreSQL-specific form that keeps the first row for each combination of `ON` columns. +==== From e619e585ccd16d22a683b3799177f94aa96c9d55 Mon Sep 17 00:00:00 2001 From: Kat Batuigas Date: Fri, 22 May 2026 19:45:25 -0700 Subject: [PATCH 13/16] Minor edit --- modules/reference/pages/sql/sql-statements/set-show.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/reference/pages/sql/sql-statements/set-show.adoc b/modules/reference/pages/sql/sql-statements/set-show.adoc index a8ac4fba3..0dac3f447 100644 --- a/modules/reference/pages/sql/sql-statements/set-show.adoc +++ b/modules/reference/pages/sql/sql-statements/set-show.adoc @@ -32,7 +32,7 @@ Available options: * `extra_float_digits`: Number of extra digits displayed after the decimal point in floating-point numbers. * `application_name`: Custom name for the application. * `timezone`: Time zone used for date and time functions. -* `client_min_messages`: Minimum message level sent to the client. Valid values: `DEBUG5`, `DEBUG4`, `DEBUG3`, `DEBUG2`, `DEBUG1`, `log`, `NOTICE`, `WARNING`, and `ERROR`. +* `client_min_messages`: Minimum message level sent to the client. Valid values: `DEBUG5`, `DEBUG4`, `DEBUG3`, `DEBUG2`, `DEBUG1`, `LOG`, `NOTICE`, `WARNING`, and `ERROR`. * `search_path`: Namespaces in which Redpanda SQL looks for tables. * `oxla.enable_fast_math`: Enables math optimizations that trade precision for speed using faster, less accurate functions. From c4aa7b65f7c09bc85cc9f24ba7582d84d08b2a32 Mon Sep 17 00:00:00 2001 From: Kat Batuigas Date: Fri, 22 May 2026 20:31:02 -0700 Subject: [PATCH 14/16] Consolidate substr and substring --- .../string-functions/substr.adoc | 144 ------------------ .../string-functions/substring.adoc | 131 ++++++++++++++-- 2 files changed, 120 insertions(+), 155 deletions(-) delete mode 100644 modules/reference/pages/sql/sql-functions/string-functions/substr.adoc diff --git a/modules/reference/pages/sql/sql-functions/string-functions/substr.adoc b/modules/reference/pages/sql/sql-functions/string-functions/substr.adoc deleted file mode 100644 index 582229c91..000000000 --- a/modules/reference/pages/sql/sql-functions/string-functions/substr.adoc +++ /dev/null @@ -1,144 +0,0 @@ -= substr -:description: The `substr()` function extracts a specific number of characters from a string. -:page-topic-type: reference - -The `substr()` function extracts a specific number of characters from a string. - -== Syntax - -The syntax of the function is: - -*2 Arguments* - -[source,sql] ----- -substr( string, start_position) ----- - -*3 Arguments* - -[source,sql] ----- -substr( string, start_position, length ) ----- - -[TIP] -==== -Both syntaxes will have input and return of type `string`. -==== - -=== Start position - -Use the `start_position` as the starting position, specifying the part from where the substring is to be returned. It is written as an integer value. - -[width="100%",cols="36%,64%",options="header",] -|=== -|*Input* |*Return* -|`start_position < 0 ``start_position < string` |The `start_position` is a given character in the string. The count starts from the first character. -|`start_position > string` |Returns an empty substring. -|`start_position` = negative value |The count starts from the provided negative value, with subsequent characters yielded as it approaches 0. -|=== - -If the index is less than or equal to 0, no characters are returned. - -Once it exceeds 0, characters from the string are yielded, starting from the first one. | - -=== Length - -Use the `length` function to determine the number of characters to be extracted__.__ It can be one or more characters. - -[width="100%",cols="20%,80%",options="header",] -|=== -|*Input* |*Return* -|`length` = 0 |Returns an empty substring. -|`length` is not set |The function will start from the specified `start_position` and end at the last character of the `string`. -|`length` = negative value |Returns an error. -|=== - -== Examples - -=== `substr()` function with specified `start_position` & `length` - -In this example, the `start_position` is set to the first six characters and five characters are extracted: - -[source,sql] ----- -SELECT substr('Watermelon',6,5) AS "Fruit"; ----- - -The query returns: - -[source,sql] ----- -Fruit -------- - melon ----- - -=== `substr()` function with `length` = 0 - -This query extracts a string with `length` = 0: - -[source,sql] ----- -SELECT substr('Watermelon',6,0) AS "Fruit"; ----- - -This displays an empty output as there is no `length` specified: - -[source,sql] ----- -Fruit -------- ----- - -=== `substr()` function with `length` = negative value - -This example checks if the `length` is specified with a negative value: - -[source,sql] ----- -SELECT substr('Watermelon',6,-2) AS "Fruit"; ----- - -Instead of extracting the string from the last characters, it returns an error: - -[source,sql] ----- -ERROR: Length of substring cannot be negative ----- - -=== `substr()` function with `start_position` > `string` - -The string *Watermelon* has only ten characters. This example shows what happens when the specified `start_position` is larger than the string's characters: - -[source,sql] ----- -SELECT substr('Watermelon',20,2) AS "Fruit"; ----- - -This displays an empty output: - -[source,sql] ----- -Fruit -------- ----- - -=== `substr()` function with 2 arguments - -In this example, the `start_position` is set to the first six characters and five characters are extracted. - -[source,sql] ----- -SELECT substr('database', 6) AS "Result"; ----- - -This displays the substring from position 6: - -[source,sql] ----- -Result --------- - ase ----- diff --git a/modules/reference/pages/sql/sql-functions/string-functions/substring.adoc b/modules/reference/pages/sql/sql-functions/string-functions/substring.adoc index f29a0f3dc..374c5f8b1 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/substring.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/substring.adoc @@ -1,22 +1,19 @@ -= substring -:description: SUBSTR is an alias for `substring`. += SUBSTRING +:description: The `SUBSTRING` function extracts a part of a string. `SUBSTR` is an alias. :page-topic-type: reference +:page-aliases: reference:sql/sql-functions/string-functions/substr.adoc -[WARNING] -==== -SUBSTR is an alias for SUBSTRING. Learn more at xref:reference:sql/sql-functions/string-functions/substr.adoc[`substr()`] documentation. -==== -The `substring()` function lets you extract a part of a string and return that substring. +The `SUBSTRING` function extracts a part of a string and returns the result. `SUBSTR` is an alias for `SUBSTRING`. Both names produce the same result. == Syntax -Here are the 2 basic syntaxes of the `substring()` function in Redpanda SQL: +Use either name (`SUBSTRING` or `SUBSTR`) with the same syntax: *2 Arguments* [source,sql] ---- -SUBSTRING( string, start_position ) +SUBSTRING(string, start_position) ---- *3 Arguments* @@ -28,12 +25,38 @@ SUBSTRING(string, start_position, length) [TIP] ==== -Both syntaxes will have input and return of type `string`. +Both syntaxes have input and return of type `string`. ==== +=== Start position + +Use `start_position` as the starting position, specifying the part from where the substring is to be returned. It is written as an integer value. + +[width="100%",cols="36%,64%",options="header",] +|=== +|Input |Return +|`start_position < string` |The `start_position` is a given character in the string. The count starts from the first character. +|`start_position > string` |Returns an empty substring. +|`start_position` = negative value |The count starts from the provided negative value, with subsequent characters yielded as it approaches 0. +|=== + +If the index is less than or equal to 0, no characters are returned. Once it exceeds 0, characters from the string are yielded, starting from the first one. + +=== Length + +Use `length` to determine the number of characters to be extracted. It can be one or more characters. + +[width="100%",cols="20%,80%",options="header",] +|=== +|Input |Return +|`length` = 0 |Returns an empty substring. +|`length` is not set |The function starts from the specified `start_position` and ends at the last character of the `string`. +|`length` = negative value |Returns an error. +|=== + == Examples -This example shows how to use the `substring()` function to extract the first 7 characters from the string: +=== Extract a substring from position 1 [source,sql] ---- @@ -48,3 +71,89 @@ substring ----------- Redpanda ---- + +=== `SUBSTRING` with specified `start_position` and `length` + +In this example, the `start_position` is set to position 6 and 5 characters are extracted: + +[source,sql] +---- +SELECT SUBSTRING('Watermelon', 6, 5) AS "Fruit"; +---- + +The query returns: + +[source,sql] +---- +Fruit +------- + melon +---- + +=== `SUBSTRING` with `length` = 0 + +This query extracts a string with `length` = 0: + +[source,sql] +---- +SELECT SUBSTRING('Watermelon', 6, 0) AS "Fruit"; +---- + +This displays an empty output as there is no `length` specified: + +[source,sql] +---- +Fruit +------- +---- + +=== `SUBSTRING` with `length` = negative value + +This example shows what happens when `length` is specified with a negative value: + +[source,sql] +---- +SELECT SUBSTRING('Watermelon', 6, -2) AS "Fruit"; +---- + +Instead of extracting the string from the last characters, it returns an error: + +[source,sql] +---- +ERROR: Length of substring cannot be negative +---- + +=== `SUBSTRING` with `start_position` > `string` + +The string `Watermelon` has only ten characters. This example shows what happens when the specified `start_position` is larger than the string's characters: + +[source,sql] +---- +SELECT SUBSTRING('Watermelon', 20, 2) AS "Fruit"; +---- + +This displays an empty output: + +[source,sql] +---- +Fruit +------- +---- + +=== `SUBSTRING` with 2 arguments + +In this example, the `start_position` is set to position 6: + +[source,sql] +---- +SELECT SUBSTRING('database', 6) AS "Result"; +---- + +This displays the substring from position 6: + +[source,sql] +---- +Result +-------- + ase +---- From a7673e555b4ce37aab345ce340be80d8ff51d180 Mon Sep 17 00:00:00 2001 From: Kat Batuigas Date: Fri, 22 May 2026 20:36:01 -0700 Subject: [PATCH 15/16] Uppercase keyword-syntax and conditional functions per PG/CockroachDB convention Function-like operators that use SQL keyword syntax (EXTRACT, POSITION, SUBSTRING, SUBSTR) and conditional expressions (COALESCE, NULLIF, GREATEST, LEAST) get UPPERCASE in H1, body prose, and xref labels, matching how PostgreSQL and CockroachDB docs classify them. Regular call-syntax functions (sum, count, avg, abs, log, concat, length, etc.) stay lowercase. SQL keyword DISTINCT stays uppercase. Co-Authored-By: Claude Opus 4.7 (1M context) --- modules/ROOT/nav.adoc | 1 - .../pages/sql/sql-data-types/interval.adoc | 2 +- .../pages/sql/sql-data-types/text.adoc | 2 +- .../math-functions/greatest.adoc | 8 +++--- .../sql-functions/math-functions/index.adoc | 4 +-- .../sql-functions/math-functions/least.adoc | 10 +++---- .../other-functions/coalesce.adoc | 26 +++++++++---------- .../sql-functions/other-functions/index.adoc | 6 ++--- .../sql-functions/other-functions/nullif.adoc | 12 ++++----- .../sql-functions/string-functions/index.adoc | 4 +-- .../string-functions/position.adoc | 6 ++--- .../string-functions/strpos.adoc | 4 +-- .../timestamp-functions/extract.adoc | 20 +++++++------- .../timestamp-functions/index.adoc | 2 +- 14 files changed, 53 insertions(+), 54 deletions(-) diff --git a/modules/ROOT/nav.adoc b/modules/ROOT/nav.adoc index 586f9c95d..64a7b9148 100644 --- a/modules/ROOT/nav.adoc +++ b/modules/ROOT/nav.adoc @@ -705,7 +705,6 @@ ***** xref:reference:sql/sql-functions/string-functions/replace.adoc[] ***** xref:reference:sql/sql-functions/string-functions/starts-with.adoc[] ***** xref:reference:sql/sql-functions/string-functions/strpos.adoc[] -***** xref:reference:sql/sql-functions/string-functions/substr.adoc[] ***** xref:reference:sql/sql-functions/string-functions/substring.adoc[] ***** xref:reference:sql/sql-functions/string-functions/upper.adoc[] **** xref:reference:sql/sql-functions/timestamp-functions/index.adoc[Timestamp] diff --git a/modules/reference/pages/sql/sql-data-types/interval.adoc b/modules/reference/pages/sql/sql-data-types/interval.adoc index e9f7053b2..b9d13e079 100644 --- a/modules/reference/pages/sql/sql-data-types/interval.adoc +++ b/modules/reference/pages/sql/sql-data-types/interval.adoc @@ -145,7 +145,7 @@ SELECT INTERVAL '2-4 5 DAYS 04:05:06.070809' YEAR TO MONTH as "Interval"; === Extract data from interval -To extract interval numbers from a timestamp, use the `extract()` function: +To extract interval numbers from a timestamp, use the `EXTRACT` function: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-data-types/text.adoc b/modules/reference/pages/sql/sql-data-types/text.adoc index 6caa03c22..d2a775f68 100644 --- a/modules/reference/pages/sql/sql-data-types/text.adoc +++ b/modules/reference/pages/sql/sql-data-types/text.adoc @@ -42,7 +42,7 @@ The following output shows the created table: == Text with SUBSTR function -The `substr()` function extracts a specific number of characters from a text. +The `SUBSTR` function extracts a specific number of characters from a text. === Syntax diff --git a/modules/reference/pages/sql/sql-functions/math-functions/greatest.adoc b/modules/reference/pages/sql/sql-functions/math-functions/greatest.adoc index ca9c50f06..72077b5fa 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/greatest.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/greatest.adoc @@ -1,8 +1,8 @@ -= greatest -:description: The `greatest()` function extracts the greatest or largest value from a set of values. += GREATEST +:description: The `GREATEST` function returns the largest value from a set of values. :page-topic-type: reference -The `greatest()` function returns the greatest value from a set of values. The arguments must be of compatible types. For example, comparing a text value with a number returns an error. +The `GREATEST` function returns the greatest value from a set of values. The arguments must be of compatible types. For example, comparing a text value with a number returns an error. == Syntax @@ -98,7 +98,7 @@ greatest === Use table data -You can also use `greatest()` to find the greatest value across columns. For example, create a table named `Student` that stores student names and scores. +You can also use `GREATEST` to find the greatest value across columns. For example, create a table named `Student` that stores student names and scores. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/math-functions/index.adoc b/modules/reference/pages/sql/sql-functions/math-functions/index.adoc index 39f8259fb..4c778d2e6 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/index.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/index.adoc @@ -14,8 +14,8 @@ Mathematical, trigonometric, and hyperbolic functions in Redpanda SQL are design |xref:reference:sql/sql-functions/math-functions/ceil.adoc[`ceil()`] |This function rounds up to the nearest positive or negative integer value greater than or equal to the argument |xref:reference:sql/sql-functions/math-functions/exp.adoc[`exp()`] |This function returns the exponential value of a number specified in the argument |xref:reference:sql/sql-functions/math-functions/floor.adoc[`floor()`] |This function returns a number rounded down that is less than or equal to the specified argument -|xref:reference:sql/sql-functions/math-functions/greatest.adoc[`greatest()`] |This function extracts the greatest or largest value from a set of values. -|xref:reference:sql/sql-functions/math-functions/least.adoc[`least()`] |This function returns the least or smallest value in a list of values +|xref:reference:sql/sql-functions/math-functions/greatest.adoc[`GREATEST`] |This function extracts the greatest or largest value from a set of values. +|xref:reference:sql/sql-functions/math-functions/least.adoc[`LEAST`] |This function returns the least or smallest value in a list of values |xref:reference:sql/sql-functions/math-functions/ln.adoc[`ln()`] |This function returns the exponential value of its argument |xref:reference:sql/sql-functions/math-functions/log.adoc[`log()`] |This function returns the base-10 logarithm or logarithm of the specified base of a given number |xref:reference:sql/sql-functions/math-functions/power.adoc[`power()`] |This function returns the value of a number raised to the power of another number specified in the arguments diff --git a/modules/reference/pages/sql/sql-functions/math-functions/least.adoc b/modules/reference/pages/sql/sql-functions/math-functions/least.adoc index 06ce640a2..27a008317 100644 --- a/modules/reference/pages/sql/sql-functions/math-functions/least.adoc +++ b/modules/reference/pages/sql/sql-functions/math-functions/least.adoc @@ -1,14 +1,14 @@ -= least -:description: The `least()` function returns the least or smallest value in a list of values. += LEAST +:description: The `LEAST` function returns the smallest value in a list of values. :page-topic-type: reference -The `least()` function returns the least or smallest value in a list of values. It needs at least one argument to work with. If different types are mixed, like a text and a number, it returns an error. +The `LEAST` function returns the least or smallest value in a list of values. It needs at least one argument to work with. If different types are mixed, like a text and a number, it returns an error. For example, comparing the greatest value among 4, "`two`", and 9 would result in an error. == Syntax -The syntax for the `least()` function is: +The syntax for the `LEAST` function is: [source,sql] ---- @@ -29,7 +29,7 @@ Where: == Examples -These examples show how to use the `least()` function: +These examples show how to use the `LEAST` function: === Basic usage diff --git a/modules/reference/pages/sql/sql-functions/other-functions/coalesce.adoc b/modules/reference/pages/sql/sql-functions/other-functions/coalesce.adoc index 0e597f8a5..0c66b6904 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/coalesce.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/coalesce.adoc @@ -1,12 +1,12 @@ -= coalesce -:description: The `coalesce()` function returns the first non-NULL argument from a list of arguments. += COALESCE +:description: The `COALESCE` function returns the first non-NULL argument from a list of arguments. :page-topic-type: reference -The `coalesce()` function returns the first non-NULL argument from a list of arguments. After finding the first non-NULL argument, the function stops evaluating the remaining arguments. +The `COALESCE` function returns the first non-NULL argument from a list of arguments. After finding the first non-NULL argument, the function stops evaluating the remaining arguments. [NOTE] ==== -If all arguments are NULL, `coalesce()` returns NULL. +If all arguments are NULL, `COALESCE` returns NULL. ==== == Syntax @@ -20,17 +20,17 @@ COALESCE (argument_1, argument_2, …); Key points from the syntax: -* `coalesce()` requires a minimum of two inputs. +* `COALESCE` requires a minimum of two inputs. * It can take an unlimited number of arguments. * Evaluation occurs sequentially from left to right, stopping at the first non-null value. == Examples -Here are some examples to illustrate the application of `coalesce()`: +Here are some examples to illustrate the application of `COALESCE`: === Return the first non-null value -In this example, a set of values is provided. The `coalesce()` function returns the first non-null value from this set. +In this example, a set of values is provided. The `COALESCE` function returns the first non-null value from this set. [source,sql] ---- @@ -91,7 +91,7 @@ In this query, NULL appears in the first, second, fourth, and last positions: Select COALESCE(NULL, NULL ,3, NULL, 7,9,4,5, NULL); ---- -The `coalesce()` function ignores the first two NULLs and returns the first non-null value, `3`. It does not process the subsequent NULL values. +The `COALESCE` function ignores the first two NULLs and returns the first non-null value, `3`. It does not process the subsequent NULL values. [source,sql] ---- @@ -109,7 +109,7 @@ Assume that the given values are entirely composed of nulls. Select COALESCE(NULL, NULL ,NULL, NULL); ---- -In this case, the `coalesce()` function returns an empty value (NULL). +In this case, the `COALESCE` function returns an empty value (NULL). [source,sql] ---- @@ -117,7 +117,7 @@ In this case, the `coalesce()` function returns an empty value (NULL). ---------- ---- -=== `coalesce()` with table data +=== `COALESCE` with table data Consider the `employee_absent` table, which comprises a mix of NULL and non-null values: @@ -156,7 +156,7 @@ SELECT * FROM employee_absent; Emily | HR | ---- -The following query uses the `coalesce()` function on the `absent` column. It retrieves names and absences (with `out of office` for NULL values) for each employee. +The following query uses the `COALESCE` function on the `absent` column. It retrieves names and absences (with `out of office` for NULL values) for each employee. [source,sql] ---- @@ -174,7 +174,7 @@ SELECT emp_name, COALESCE(absent, 'out of office') AS DisplayAbsent FROM employe Emily | out of office ---- -=== Error output in `coalesce()` +=== Error output in `COALESCE` When specifying arguments with different datatypes, they should be convertible. @@ -183,7 +183,7 @@ When specifying arguments with different datatypes, they should be convertible. Select Coalesce ('x',NULL,1); ---- -If the datatypes cannot be converted, the `coalesce()` function generates an error. +If the datatypes cannot be converted, the `COALESCE` function generates an error. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/other-functions/index.adoc b/modules/reference/pages/sql/sql-functions/other-functions/index.adoc index 48ab04c8f..8149b1802 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/index.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/index.adoc @@ -1,5 +1,5 @@ = Other Functions -:description: Reference for other Redpanda SQL functions, including coalesce, nullif, and PostgreSQL system information functions. +:description: Reference for other Redpanda SQL functions, including `COALESCE`, `NULLIF`, and PostgreSQL system information functions. :page-topic-type: reference Besides xref:reference:sql/sql-functions/math-functions/index.adoc[math], xref:reference:sql/sql-functions/aggregate-functions/index.adoc[aggregate], xref:reference:sql/sql-functions/window-functions/index.adoc[window], xref:reference:sql/sql-functions/string-functions/index.adoc[string], xref:reference:sql/sql-functions/timestamp-functions/index.adoc[timestamp], and xref:reference:sql/sql-functions/json-functions/index.adoc[`json`] functions, Redpanda SQL also supports these functions: @@ -7,11 +7,11 @@ Besides xref:reference:sql/sql-functions/math-functions/index.adoc[math], xref:r [cols="46%,54%",options="header",] |=== |Function |Description -|xref:reference:sql/sql-functions/other-functions/coalesce.adoc[coalesce()] |Returns the first argument that is not NULL, while the remaining arguments from the first non-null argument are not evaluated. +|xref:reference:sql/sql-functions/other-functions/coalesce.adoc[`COALESCE`] |Returns the first argument that is not NULL, while the remaining arguments from the first non-null argument are not evaluated. |xref:reference:sql/sql-functions/other-functions/current-database.adoc[current_database()] |Returns the current database's name. |xref:reference:sql/sql-functions/other-functions/current-schema.adoc[current_schema()] |Returns the schema's name (first in the search path). |xref:reference:sql/sql-functions/other-functions/has-schema-privilege.adoc[has_schema_privilege()] |Checks whether the current user has specific privileges on a schema. -|xref:reference:sql/sql-functions/other-functions/nullif.adoc[nullif()] |Replaces a given value with NULL if it matches a specific criterion. +|xref:reference:sql/sql-functions/other-functions/nullif.adoc[`NULLIF`] |Replaces a given value with NULL if it matches a specific criterion. |xref:reference:sql/sql-functions/other-functions/pg-get-expr.adoc[pg_get_expr()] |Retrieves the internal form of an individual expression (such as the default value for a column). |xref:reference:sql/sql-functions/other-functions/pg-total-relation-size.adoc[pg_total_relation_size()] |Retrieves the size of a table. |xref:reference:sql/sql-functions/other-functions/pg-typeof.adoc[pg_typeof()] |Retrieves the data type of any given value. diff --git a/modules/reference/pages/sql/sql-functions/other-functions/nullif.adoc b/modules/reference/pages/sql/sql-functions/other-functions/nullif.adoc index 12b6b6c38..186bfc4da 100644 --- a/modules/reference/pages/sql/sql-functions/other-functions/nullif.adoc +++ b/modules/reference/pages/sql/sql-functions/other-functions/nullif.adoc @@ -1,8 +1,8 @@ -= nullif -:description: The `nullif()` function replaces a given value with NULL if it matches a specific criterion. += NULLIF +:description: The `NULLIF` function replaces a given value with NULL if it matches a specific criterion. :page-topic-type: reference -The `nullif()` function replaces a given value with NULL if it matches a specific criterion. +The `NULLIF` function replaces a given value with NULL if it matches a specific criterion. == Syntax @@ -11,21 +11,21 @@ The `nullif()` function replaces a given value with NULL if it matches a specifi NULLIF(argument_1,argument_2); ---- -The `nullif` function takes two arguments: +The `NULLIF` function takes two arguments: * The first argument is the value to evaluate. * The second argument is the value to treat as NULL if the first argument matches it. [TIP] ==== -If the first argument matches the second argument, the `nullif()` function returns `NULL`. Otherwise, it returns the first argument as-is. +If the first argument matches the second argument, the `NULLIF` function returns `NULL`. Otherwise, it returns the first argument as-is. ==== == Examples === Handle equal values -In this case, the `nullif` function compares the values 4 and 4. +In this case, the `NULLIF` function compares the values 4 and 4. [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/string-functions/index.adoc b/modules/reference/pages/sql/sql-functions/string-functions/index.adoc index 4bc064a93..3e61c8c4d 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/index.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/index.adoc @@ -14,12 +14,12 @@ Use string functions to analyze and manipulate string values. Redpanda SQL suppo |xref:reference:sql/sql-functions/string-functions/starts-with.adoc[`starts_with()`] |Checks if a string starts with a specified substring |xref:reference:sql/sql-functions/string-functions/ends-with.adoc[`ends_with()`] |Checks if a string ends with a specified substring |xref:reference:sql/sql-functions/string-functions/concat.adoc[`concat()`] |Adds two or more strings together -|xref:reference:sql/sql-functions/string-functions/substr.adoc[`substr()`] |Extracts a substring from a string +|xref:reference:sql/sql-functions/string-functions/substring.adoc[`SUBSTRING`] |Extracts a substring from a string. `SUBSTR` is an alias. |xref:reference:sql/sql-functions/string-functions/strpos.adoc[`strpos()`] |Finds the position at which the substring starts within the string |xref:reference:sql/sql-functions/string-functions/regex/regexp-match.adoc[`regexp_match()`] |Matches a POSIX regular expression pattern to a string |xref:reference:sql/sql-functions/string-functions/regex/regexp-replace.adoc[`regexp_replace()`] |Substitutes new text for substrings that match POSIX regular expression patterns |xref:reference:sql/sql-functions/string-functions/replace.adoc[`replace()`] |Finds and replace occurences of a substring in a string -|xref:reference:sql/sql-functions/string-functions/position.adoc[`position()`] |Returns the position of the first occurrence of a substring in a string +|xref:reference:sql/sql-functions/string-functions/position.adoc[`POSITION`] |Returns the position of the first occurrence of a substring in a string |=== == String operators diff --git a/modules/reference/pages/sql/sql-functions/string-functions/position.adoc b/modules/reference/pages/sql/sql-functions/string-functions/position.adoc index 62917bda5..cff3d6045 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/position.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/position.adoc @@ -1,8 +1,8 @@ -= position -:description: The `position()` function returns the position of the first occurrence of a substring in a string. += POSITION +:description: The `POSITION` function returns the position of the first occurrence of a substring in a string. :page-topic-type: reference -The `position()` function returns the position of the first occurrence of a substring in a string. It works the same as xref:reference:sql/sql-functions/string-functions/strpos.adoc[`strpos()`], but it has slightly different syntax. +The `POSITION` function returns the position of the first occurrence of a substring in a string. It works the same as xref:reference:sql/sql-functions/string-functions/strpos.adoc[`strpos()`], but it has slightly different syntax. == Syntax diff --git a/modules/reference/pages/sql/sql-functions/string-functions/strpos.adoc b/modules/reference/pages/sql/sql-functions/string-functions/strpos.adoc index 6152a577f..aa1a36763 100644 --- a/modules/reference/pages/sql/sql-functions/string-functions/strpos.adoc +++ b/modules/reference/pages/sql/sql-functions/string-functions/strpos.adoc @@ -1,5 +1,5 @@ = strpos -:description: Use the `strpos()` to return the position from where the substring (the second argument) is matched with the string (the first argument). +:description: Use the `strpos()` function to return the position from where the substring (the second argument) is matched with the string (the first argument). :page-topic-type: reference Use the `strpos()` function to return the position from where the substring (the second argument) is matched with the string (the first argument). @@ -14,7 +14,7 @@ The input and return must be of type `string`. *Special cases:* * Returns `NULL` if there are no input rows or `NULL` values. -* If the `substring` is not found in the string, then the `strpos()` function will return 0. +* If the `SUBSTRING` is not found in the string, then the `strpos()` function will return 0. == Examples diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/extract.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/extract.adoc index a7e08c307..23975814b 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/extract.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/extract.adoc @@ -1,8 +1,8 @@ -= extract -:description: The `extract()` function retrieves a specified part (field) from a given date/time or interval value. += EXTRACT +:description: The `EXTRACT` function retrieves a specified part (field) from a given date/time or interval value. :page-topic-type: reference -The `extract()` function retrieves a specified part (field) from a given date/time or interval value. It is commonly used to obtain components such as year, month, day, and hour from timestamps or dates. +The `EXTRACT` function retrieves a specified part (field) from a given date/time or interval value. It is commonly used to obtain components such as year, month, day, and hour from timestamps or dates. == Syntax @@ -16,7 +16,7 @@ EXTRACT (field FROM source) * `field`: String or identifier specifying the part of the date / time to extract. * `source`: Date / time value from which to extract the specifed field. -This table shows the supported input and corresponding return types for the `extract()` function: +This table shows the supported input and corresponding return types for the `EXTRACT` function: [width="100%",cols="24%,55%,21%",options="header",] |=== @@ -33,9 +33,9 @@ The SECOND field returns a fractional value as `double precision` to include fra == Examples -=== `extract()` with timestamp - year +=== `EXTRACT` with timestamp - year -This example shows how to use the `extract()` function to extract a given timestamp's year: +This example shows how to use the `EXTRACT` function to extract a given timestamp's year: [source,sql] ---- @@ -53,9 +53,9 @@ The query returns: +----------+ ---- -=== `extract()` with timestamp - month +=== `EXTRACT` with timestamp - month -This example uses the `extract()` function to extract a given timestamp's month: +This example uses the `EXTRACT` function to extract a given timestamp's month: [source,sql] ---- @@ -73,9 +73,9 @@ The query returns the month's part of the given timestamp: +----------+ ---- -=== `extract()` with timestamp - seconds (including fractional seconds) +=== `EXTRACT` with timestamp - seconds (including fractional seconds) -This example uses the `extract()` function to extract a given timestamp's seconds, including fractional seconds: +This example uses the `EXTRACT` function to extract a given timestamp's seconds, including fractional seconds: [source,sql] ---- diff --git a/modules/reference/pages/sql/sql-functions/timestamp-functions/index.adoc b/modules/reference/pages/sql/sql-functions/timestamp-functions/index.adoc index 7da291e10..322b81b9b 100644 --- a/modules/reference/pages/sql/sql-functions/timestamp-functions/index.adoc +++ b/modules/reference/pages/sql/sql-functions/timestamp-functions/index.adoc @@ -15,7 +15,7 @@ Timestamp functions return a date-time value based on a specified timestamp/inte |xref:reference:sql/sql-functions/timestamp-functions/timestamp-millis.adoc[`timestamp_millis()`] |Converts a UNIX timestamp in milliseconds to a timestamp. |xref:reference:sql/sql-functions/timestamp-functions/timestamp-micros.adoc[`timestamp_micros()`] |Converts a UNIX timestamp in microseconds to a timestamp. |xref:reference:sql/sql-functions/timestamp-functions/timestamp-trunc.adoc[`timestamp_trunc()`] |Truncates a given timestamp to the nearest time part. Supported time parts are YEAR, MONTH, DAY, HOUR, MINUTE, and SECOND -|xref:reference:sql/sql-functions/timestamp-functions/extract.adoc[`extract()`] |Extracts some part of a specified timestamp or interval. +|xref:reference:sql/sql-functions/timestamp-functions/extract.adoc[`EXTRACT`] |Extracts some part of a specified timestamp or interval. |xref:reference:sql/sql-functions/timestamp-functions/to-timestamp.adoc[`to_timestamp()`] |Converts a string into a timestamp based on the provided format. |xref:reference:sql/sql-functions/timestamp-functions/date-trunc.adoc[`date_trunc()`] |Truncates intervals or timestamps/time zones to a specified field. |xref:reference:sql/sql-functions/timestamp-functions/to-char.adoc[`to_char()` from Timestamp] |Formats a timestamp into a string using a given format. From 326821ac475d865bda46d0816f6a5699595d003e Mon Sep 17 00:00:00 2001 From: Kat Batuigas Date: Fri, 22 May 2026 20:42:18 -0700 Subject: [PATCH 16/16] Add missing index page --- modules/sql/pages/manage/index.adoc | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 modules/sql/pages/manage/index.adoc diff --git a/modules/sql/pages/manage/index.adoc b/modules/sql/pages/manage/index.adoc new file mode 100644 index 000000000..3f9084492 --- /dev/null +++ b/modules/sql/pages/manage/index.adoc @@ -0,0 +1,3 @@ += Manage Redpanda SQL +:description: Manage access, security, and operations for Redpanda SQL. +:page-layout: index