ST_CreateDuration

ST_CreateDuration takes an integer and a temporal unit and returns a duration tuple. The temporal unit can be milliseconds, seconds, minutes, hours, or days. The value must be a short or long integer. Both the value and unit can be specified as either literal values or columns.

The duration tuple can be used as a track offset to to query and split tracks.

Tracks are linestrings that represent the change in an entity's location over time. Each vertex in the linestring has a timestamp (stored as the M-value) and the vertices are ordered sequentially.

For more information on using tracks in GeoAnalytics Engine, see the core concept topic on tracks.

FunctionSyntax
Pythoncreate_duration(value, unit)
SQLST_CreateDuration(value, unit)
ScalacreateDuration(value, unit)

For more details, go to the GeoAnalytics Engine API reference for create_duration.

Examples

PythonPythonSQLScala
1
2
3
4
5
6
7
8

from geoanalytics.sql import functions as ST

data = [(55, "seconds"),(7, "minutes"),(82, "seconds")]

spark.createDataFrame(data, ["value", "units"]) \
     .select(ST.create_duration("value", "units").alias("create_duration")) \
     .show(truncate=False)
Result
1
2
3
4
5
6
7
+---------------+
|create_duration|
+---------------+
|{55, second}   |
|{7, minute}    |
|{82, second}   |
+---------------+

Version table

ReleaseNotes

1.4.0

Python and SQL functions introduced

1.5.0

Scala function introduced

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close