Skip to content

Commit 25f1ca4

Browse files
docs: DOC-888: Refactor auto-imported functions (deephaven#7708)
Refactors the page to reduce load time
1 parent 2c00339 commit 25f1ca4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1898
-5366
lines changed

docs/groovy/conceptual/time-in-deephaven.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ There are four important tools provided by DQL that are relevant to the discussi
2828

2929
### 1. Built-in Java functions
3030

31-
Deephaven has a collection of [built-in functions](../reference/query-language/query-library/auto-imported-functions.md) that are useful for working with date-time types. For the sake of performance, these functions are implemented in Java. DQL supports calling these functions directly in query strings, opening up all of Deephaven's [built-in Java functions](../reference/query-language/query-library/auto-imported-functions.md) to the Groovy interface. The following example uses the built-in Deephaven function [`now`](https://deephaven.io/core/javadoc/io/deephaven/time/DateTimeUtils.html#now()) to get the current system time as a Java [`Instant`](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/time/Instant.html):
31+
Deephaven has a collection of [built-in functions](../reference/query-language/formulas/auto-imported-functions.md) that are useful for working with date-time types. For the sake of performance, these functions are implemented in Java. DQL supports calling these functions directly in query strings, opening up all of Deephaven's [built-in Java functions](../reference/query-language/formulas/auto-imported-functions.md) to the Groovy interface. The following example uses the built-in Deephaven function [`now`](https://deephaven.io/core/javadoc/io/deephaven/time/DateTimeUtils.html#now()) to get the current system time as a Java [`Instant`](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/time/Instant.html):
3232

3333
```groovy test-set=2
3434
t = emptyTable(5).update("CurrentTime = now()")
@@ -37,7 +37,7 @@ t = emptyTable(5).update("CurrentTime = now()")
3737
> [!NOTE]
3838
> [`now`](https://deephaven.io/core/javadoc/io/deephaven/time/DateTimeUtils.html#now()) uses the [current clock](https://deephaven.io/core/javadoc/io/deephaven/time/DateTimeUtils.html#currentClock()) of the Deephaven engine. This clock is typically the system clock, but it may be set to a simulated clock when replaying tables.
3939
40-
These [functions](../reference/query-language/query-library/auto-imported-functions.md) can also be applied to columns, constants, and variables. This slightly more complex example uses the built-in Deephaven function [`epochDaysToLocalDate`](https://deephaven.io/core/javadoc/io/deephaven/time/DateTimeUtils.html#epochDaysToLocalDate(long)) to create a [`LocalDate`](https://docs.oracle.com/en/java/javase/17/docs//api/java.base/java/time/LocalDate.html) from a long that represents the number of days since the [Unix epoch](https://en.wikipedia.org/wiki/Unix_time):
40+
These [functions](../reference/query-language/formulas/auto-imported-functions.md) can also be applied to columns, constants, and variables. This slightly more complex example uses the built-in Deephaven function [`epochDaysToLocalDate`](https://deephaven.io/core/javadoc/io/deephaven/time/DateTimeUtils.html#epochDaysToLocalDate(long)) to create a [`LocalDate`](https://docs.oracle.com/en/java/javase/17/docs//api/java.base/java/time/LocalDate.html) from a long that represents the number of days since the [Unix epoch](https://en.wikipedia.org/wiki/Unix_time):
4141

4242
```groovy test-set=3
4343
t = emptyTable(5).update("DaysSinceEpoch = ii", "LocalDateColumn = epochDaysToLocalDate(DaysSinceEpoch)")
@@ -72,7 +72,7 @@ To be clear:
7272

7373
- `DaysSinceEpoch` is a 64-bit integer.
7474
- `LocalDateColumn` is a Java [`LocalDate`](https://docs.oracle.com/en/java/javase/17/docs//api/java.base/java/time/LocalDate.html) object.
75-
- [`epochDaysToLocalDate`](https://deephaven.io/core/javadoc/io/deephaven/time/DateTimeUtils.html#epochDaysToLocalDate(long)) is a Java function from the [built-in Deephaven library](../reference/query-language/query-library/auto-imported-functions.md).
75+
- [`epochDaysToLocalDate`](https://deephaven.io/core/javadoc/io/deephaven/time/DateTimeUtils.html#epochDaysToLocalDate(long)) is a Java function from the [built-in Deephaven library](../reference/query-language/formulas/auto-imported-functions.md).
7676
- `DayOfWeek` is the return value of [`getDayOfWeek`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/LocalDate.html#getDayOfWeek()), a Java method bound to the [`LocalDate`](https://docs.oracle.com/en/java/javase/17/docs//api/java.base/java/time/LocalDate.html) class.
7777

7878
### 3. Arithmetic and inequality operators
@@ -95,7 +95,7 @@ t = emptyTable(5).update(
9595
9696
### 4. Date-times using DQL
9797

98-
In Deephaven, date-time values can be expressed using very simple [literal](https://en.wikipedia.org/wiki/Literal_(computer_programming)) syntax. These literal values can be used directly in query strings or as string inputs to [built-in functions](../reference/query-language/query-library/auto-imported-functions.md).
98+
In Deephaven, date-time values can be expressed using very simple [literal](https://en.wikipedia.org/wiki/Literal_(computer_programming)) syntax. These literal values can be used directly in query strings or as string inputs to [built-in functions](../reference/query-language/formulas/auto-imported-functions.md).
9999

100100
> [!TIP]
101101
> In query strings, time literals are denoted with _single quotes_.

docs/groovy/getting-started/crash-course/query-strings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ There are many more such operators supported in Deephaven. See the [guide on ope
163163

164164
## Built-in functions
165165

166-
Aside from the common operations, Deephaven hosts a large library of functions known as [built-in or auto-imported functions](../../reference/query-language/query-library/auto-imported-functions.md) that can be used in query strings.
166+
Aside from the common operations, Deephaven hosts a large library of functions known as [built-in or auto-imported functions](../../reference/query-language/formulas/auto-imported-functions.md) that can be used in query strings.
167167

168168
The [numeric subset of this library](/core/javadoc/io/deephaven/function/package-summary.html) is full of functions that perform common mathematical operations on numeric types. These include exponentials, trigonometric functions, random number generators, and more.
169169

@@ -251,7 +251,7 @@ lastByBin = binnedTimestamps.lastBy("Last5Mins")
251251

252252
The [time user guide](../../conceptual/time-in-deephaven.md) provides a comprehensive overview of working with date-time data in Deephaven.
253253

254-
These functions provide only a glimpse of what the built-in library offers. There are modules for [sorting](/core/javadoc/io/deephaven/function/Sort.html), [searching](/core/javadoc/io/deephaven/function/BinSearch.html), [string parsing](/core/javadoc/io/deephaven/function/Parse.html), [null handling](https://deephaven.io/core/javadoc/io/deephaven/function/Basic.html#isNull(byte)), and much more. See the document on [auto-imported functions](../../reference/query-language/query-library/auto-imported-functions.md) for a comprehensive list of what's available or the [module summary page](/core/javadoc/io/deephaven/function/package-summary.html) for a high-level overview of what's offered.
254+
These functions provide only a glimpse of what the built-in library offers. There are modules for [sorting](/core/javadoc/io/deephaven/function/Sort.html), [searching](/core/javadoc/io/deephaven/function/BinSearch.html), [string parsing](/core/javadoc/io/deephaven/function/Parse.html), [null handling](https://deephaven.io/core/javadoc/io/deephaven/function/Basic.html#isNull(byte)), and much more. See the document on [auto-imported functions](../../reference/query-language/formulas/auto-imported-functions.md) for a comprehensive list of what's available or the [module summary page](/core/javadoc/io/deephaven/function/package-summary.html) for a high-level overview of what's offered.
255255

256256
## Java methods
257257

docs/groovy/how-to-guides/built-in-constants.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,6 @@ Deephaven has only two built-in math constants:
124124
- [Built-in functions](./built-in-functions.md)
125125
- [Handle nulls, infinities, and NaNs](./null-inf-nan.md)
126126
- [Work with date-times](../conceptual/time-in-deephaven.md)
127-
- [Auto-imported functions](../reference/query-language/query-library/auto-imported-functions.md)
127+
- [Auto-imported functions](../reference/query-language/formulas/auto-imported-functions.md)
128128
- [`emptyTable`](../reference/table-operations/create/emptyTable.md)
129129
- [`update`](../reference/table-operations/select/update.md)

docs/groovy/how-to-guides/built-in-functions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ source = emptyTable(40).update(
4444
)
4545
```
4646

47-
This page does not provide a comprehensive list of all built-ins. For the complete list of functions built into the query language, see [Auto-imported functions](../reference/query-language/query-library/auto-imported-functions.md).
47+
This page does not provide a comprehensive list of all built-ins. For the complete list of functions built into the query language, see [Auto-imported functions](../reference/query-language/formulas/auto-imported-functions.md).
4848

4949
## Related documentation
5050

5151
- [Built-in constants](./built-in-constants.md)
5252
- [Built-in variables](./built-in-variables.md)
53-
- [Auto-imported functions](../reference/query-language/query-library/auto-imported-functions.md)
53+
- [Auto-imported functions](../reference/query-language/formulas/auto-imported-functions.md)

docs/groovy/how-to-guides/groovy-closures.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Deephaven has a built-in [`sin`](https://deephaven.io/core/javadoc/io/deephaven/
5656
source = emptyTable(100).update("X = 0.1 * ii", "Y = sin(X)")
5757
```
5858

59-
Familiarity with Deephaven's built-in methods can speed up your workflow. Deephaven has a large number of built-in methods that can be called from query strings without any imports or classpaths. For more information and a complete list of what's available, see [auto-imported functions in Deephaven](../reference/query-language/query-library/auto-imported-functions.md).
59+
Familiarity with Deephaven's built-in methods can speed up your workflow. Deephaven has a large number of built-in methods that can be called from query strings without any imports or classpaths. For more information and a complete list of what's available, see [auto-imported functions in Deephaven](../reference/query-language/formulas/auto-imported-functions.md).
6060

6161
## Passing tables to functions
6262

@@ -142,12 +142,12 @@ import com.example.MyClass
142142
143143
## Related documentation
144144

145-
- [Auto-imported functions](../reference/query-language/query-library/auto-imported-functions.md)
145+
- [Auto-imported functions](../reference/query-language/formulas/auto-imported-functions.md)
146146
- [Create a new table](../how-to-guides/new-and-empty-table.md#newtable)
147147
- [Docker volumes](../conceptual/docker-data-volumes.md)
148148
- [How to use variables and functions in query strings](../how-to-guides/query-scope.md)
149149
- [How to install Java packages](../how-to-guides/install-and-use-java-packages.md)
150150
- [How to use Deephaven's built-in query language functions](../how-to-guides/built-in-functions.md)
151-
- [Query language functions](../reference/query-language/query-library/auto-imported-functions.md)
151+
- [Query language functions](../reference/query-language/formulas/auto-imported-functions.md)
152152
- [update](../reference/table-operations/select/update.md)
153153
- [view](../reference/table-operations/select/view.md)

docs/groovy/how-to-guides/null-inf-nan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,4 +204,4 @@ result = source.update(
204204
- [Operators in query strings](./operators.md)
205205
- [Groovy variables in query strings](./groovy-variables.md)
206206
- [Groovy closures in query strings](./groovy-closures.md)
207-
- [Auto-imported functions](../reference/query-language/query-library/auto-imported-functions.md)
207+
- [Auto-imported functions](../reference/query-language/formulas/auto-imported-functions.md)

docs/groovy/how-to-guides/rolling-aggregations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ fXyz = plotBollinger(result, "XYZ")
597597

598598
The [`updateBy`](/core/javadoc/io/deephaven/engine/table/impl/updateby/UpdateBy.html) module enables users to create custom rolling aggregations with the [`RollingFormula`](../reference/table-operations/update-by-operations/rolling-formula.md) function.
599599

600-
The user-defined formula can utilize any of Deephaven's [built-in functions](../reference/query-language/query-library/auto-imported-functions.md), [arithmetic operators](../how-to-guides/operators.md), or even [user-defined Groovy functions](../how-to-guides/groovy-closures.md).
600+
The user-defined formula can utilize any of Deephaven's [built-in functions](../reference/query-language/formulas/auto-imported-functions.md), [arithmetic operators](../how-to-guides/operators.md), or even [user-defined Groovy functions](../how-to-guides/groovy-closures.md).
601601

602602
#### Tick-based rolling formulas
603603

docs/groovy/sidebar.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -826,15 +826,6 @@
826826
}
827827
]
828828
},
829-
{
830-
"label": "Imports",
831-
"items": [
832-
{
833-
"label": "Auto-imported functions",
834-
"path": "reference/query-language/query-library/auto-imported-functions.md"
835-
}
836-
]
837-
},
838829
{
839830
"label": "Errors and troubleshooting",
840831
"items": [

docs/python/conceptual/time-in-deephaven.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ There are four important tools provided by DQL that are relevant to the discussi
6262

6363
### 1. Built-in Java functions
6464

65-
Deephaven has a collection of [built-in functions](../reference/query-language/query-library/auto-imported-functions.md) that are useful for working with date-time types. For the sake of performance, these functions are implemented in Java. DQL supports calling these functions directly in query strings, opening up all of Deephaven's [built-in Java functions](../reference/query-language/query-library/auto-imported-functions.md) to the Python interface. The following example uses the built-in Deephaven function [`now`](https://deephaven.io/core/javadoc/io/deephaven/time/DateTimeUtils.html#now()) to get the current system time as a Java [`Instant`](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/time/Instant.html):
65+
Deephaven has a collection of [built-in functions](../reference/query-language/query-library/auto-imported/index.md) that are useful for working with date-time types. For the sake of performance, these functions are implemented in Java. DQL supports calling these functions directly in query strings, opening up all of Deephaven's [built-in Java functions](../reference/query-language/query-library/auto-imported/index.md) to the Python interface. The following example uses the built-in Deephaven function [`now`](https://deephaven.io/core/javadoc/io/deephaven/time/DateTimeUtils.html#now()) to get the current system time as a Java [`Instant`](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/time/Instant.html):
6666

6767
```python test-set=2
6868
from deephaven import empty_table
@@ -73,7 +73,7 @@ t = empty_table(5).update("CurrentTime = now()")
7373
> [!NOTE]
7474
> The [`now`](https://deephaven.io/core/javadoc/io/deephaven/time/DateTimeUtils.html#now()) function uses the [current clock](https://deephaven.io/core/javadoc/io/deephaven/time/DateTimeUtils.html#currentClock()) of the Deephaven engine. This clock is typically the system clock, but it may be set to a simulated clock when replaying tables.
7575
76-
These [functions](../reference/query-language/query-library/auto-imported-functions.md) can also be applied to columns, constants, and variables. This slightly more complex example uses the built-in Deephaven function [`epochDaysToLocalDate`](https://deephaven.io/core/javadoc/io/deephaven/time/DateTimeUtils.html#epochDaysToLocalDate(long)) to create a [`LocalDate`](https://docs.oracle.com/en/java/javase/17/docs//api/java.base/java/time/LocalDate.html) from a long that represents the number of days since the [Unix epoch](https://en.wikipedia.org/wiki/Unix_time):
76+
These [functions](../reference/query-language/query-library/auto-imported/index.md) can also be applied to columns, constants, and variables. This slightly more complex example uses the built-in Deephaven function [`epochDaysToLocalDate`](https://deephaven.io/core/javadoc/io/deephaven/time/DateTimeUtils.html#epochDaysToLocalDate(long)) to create a [`LocalDate`](https://docs.oracle.com/en/java/javase/17/docs//api/java.base/java/time/LocalDate.html) from a long that represents the number of days since the [Unix epoch](https://en.wikipedia.org/wiki/Unix_time):
7777

7878
```python test-set=3
7979
from deephaven import empty_table
@@ -120,7 +120,7 @@ To be clear:
120120

121121
- `DaysSinceEpoch` is a 64-bit integer.
122122
- `LocalDateColumn` is a Java [`LocalDate`](https://docs.oracle.com/en/java/javase/17/docs//api/java.base/java/time/LocalDate.html) object.
123-
- [`epochDaysToLocalDate`](https://deephaven.io/core/javadoc/io/deephaven/time/DateTimeUtils.html#epochDaysToLocalDate(long)) is a Java function from the [built-in Deephaven library](../reference/query-language/query-library/auto-imported-functions.md).
123+
- [`epochDaysToLocalDate`](https://deephaven.io/core/javadoc/io/deephaven/time/DateTimeUtils.html#epochDaysToLocalDate(long)) is a Java function from the [built-in Deephaven library](../reference/query-language/query-library/auto-imported/index.md).
124124
- `DayOfWeek` is the return value of [`getDayOfWeek`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/LocalDate.html#getDayOfWeek()), a Java method bound to the [`LocalDate`](https://docs.oracle.com/en/java/javase/17/docs//api/java.base/java/time/LocalDate.html) class.
125125

126126
DQL enables them all to be used seamlessly from the Python API!
@@ -149,7 +149,7 @@ t = empty_table(5).update(
149149
150150
### 4. Date-times using DQL
151151

152-
In Deephaven, date-time values can be expressed using very simple [literal](https://en.wikipedia.org/wiki/Literal_(computer_programming)) syntax. These literal values can be used directly in query strings or as string inputs to [built-in functions](../reference/query-language/query-library/auto-imported-functions.md).
152+
In Deephaven, date-time values can be expressed using very simple [literal](https://en.wikipedia.org/wiki/Literal_(computer_programming)) syntax. These literal values can be used directly in query strings or as string inputs to [built-in functions](../reference/query-language/query-library/auto-imported/index.md).
153153

154154
> [!TIP]
155155
> In query strings, time literals are denoted with _single quotes_.
@@ -708,7 +708,7 @@ reformat_gsod_local_date = format_gsod_local_date.update(
708708
Because Deephaven queries can contain Python and the Deephaven query engine is implemented in Java, performance-conscious users should be aware of [Python-Java boundary crossings](../conceptual/python-java-boundary.md). Every time a query's execution passes between Python and Java, there is a performance penalty. Fast queries must be written to minimize such [boundary crossings](../conceptual/python-java-boundary.md).
709709

710710
> [!WARNING]
711-
> Avoid [`deephaven.time`](/core/pydoc/code/deephaven.time.html#module-deephaven.time) functions in query strings. Because [`deephaven.time`](/core/pydoc/code/deephaven.time.html#module-deephaven.time) provides functions that convert between Python and Java types, every call crosses the [Python-Java boundary](../conceptual/python-java-boundary.md). Thus, each call incurs a tiny overhead. This overhead can add up when applied millions or billions of times during a query. Instead, use the [built-in functions](../reference/query-language/query-library/auto-imported-functions.md) that provide the same functionality and do not cross the [Python-Java boundary](../conceptual/python-java-boundary.md).
711+
> Avoid [`deephaven.time`](/core/pydoc/code/deephaven.time.html#module-deephaven.time) functions in query strings. Because [`deephaven.time`](/core/pydoc/code/deephaven.time.html#module-deephaven.time) provides functions that convert between Python and Java types, every call crosses the [Python-Java boundary](../conceptual/python-java-boundary.md). Thus, each call incurs a tiny overhead. This overhead can add up when applied millions or billions of times during a query. Instead, use the [built-in functions](../reference/query-language/query-library/auto-imported/index.md) that provide the same functionality and do not cross the [Python-Java boundary](../conceptual/python-java-boundary.md).
712712
713713
Here is an example that demonstrates the effects that excess boundary crossings can have on performance:
714714

0 commit comments

Comments
 (0)