Prerequisites
To follow the steps on this page:- Create a target with the Real-time analytics capability enabled. You need your connection details. This procedure also works for .
- Set up an AWS Account
Prepare your Tiger Cloud service to ingest data from SageMaker
Create a table in to store model predictions generated by SageMaker.-
Connect to your
For , open an SQL editor in . For , use
psql. -
For better performance and easier real-time analytics, create a
s are tables that automatically partition your data by time. You interact
with s in the same way as regular tables, but with extra features that makes managing your
time-series data much easier.
When you create a using CREATE TABLE … WITH …, the default partitioning column is automatically the first column with a timestamp data type. Also, creates a columnstore policy that automatically converts your data to the , after an interval equal to the value of the chunk_interval, defined through
compress_afterin the policy. This columnar format enables fast scanning and aggregation, optimizing performance for analytical workloads while also saving significant storage space. In the conversion, chunks are compressed by up to 98%, and organized for efficient, large-scale queries. You can customize this policy later using alter_job. However, to changeafterorcreated_before, the compression settings, or the the policy is acting on, you must remove the columnstore policy and add a new one. You can also manually convert chunks in a to the .
Create the code to inject data into a Tiger Cloud service
-
Create a SageMaker Notebook instance
- In Amazon SageMaker > Notebooks and Git repos, click
Create Notebook instance. - Follow the wizard to create a default Notebook instance.
- In Amazon SageMaker > Notebooks and Git repos, click
-
Write a Notebook script that inserts data into your
-
When your Notebook instance is
inService,clickOpen JupyterLaband clickconda_python3. -
Update the following script with your connection details, then paste it in the Notebook.
-
When your Notebook instance is
-
Test your SageMaker script
- Run the script in your SageMaker notebook.
-
Verify that the data is in your
Open an SQL editor and check the
sensor_datatable:You see something like:time model_name prediction 2025-02-06 16:56:34.370316+00 timescale-cloud-model 0.95