Usage Considerations
Before using API_Request in-database function with Amazon Forecast, you should deploy your trained model using Amazon Forecast and get the endpoint information.
You should also have credentials which have permissions on Amazon SageMaker to use this in-database function.
Usage Example
SELECT Timestamp, Predictionvalue FROM tapidb.API_Request( ON (SELECT fkey_1, fvalue_1 FROM forecast_input_tbl) USING AUTHORIZATION('{"Access_ID":"your_access_id", "Access_Key":"your_access_key", "Region":"aws_region", "SESSION_TOKEN":"session_token"}') API_TYPE('aws-forecast') ENDPOINT('arn:aws:forecast:us-west-2:076:forecast/demo_deep_ar_plus') ) as "DT" ;
API_Request query result:
Timestamp PredictionValue ------------------- ---------------------- 2022-04-01T00:00:00 5.20171852112000E 001 2022-04-01T01:00:00 5.10696907043000E 001 2022-04-01T02:00:00 5.02745094299000E 001 2022-04-01T03:00:00 4.43840866089000E 001 2022-04-01T04:00:00 4.46497497559000E 001 2022-04-01T05:00:00 4.81300239563000E 001 2022-04-01T06:00:00 4.94036216736000E 001 2022-04-01T07:00:00 5.24066925049000E 001 2022-04-01T08:00:00 5.77213211060000E 001 2022-04-01T09:00:00 8.73532180786000E 001 .......