-- Analytical fact table: prediction_vs_outcome
-- Partitioned by dt on MinIO

CREATE TABLE IF NOT EXISTS lakehouse.stonks.prediction_vs_outcome (
    recommendation_id VARCHAR,
    ticker            VARCHAR,
    predicted_action  VARCHAR,
    predicted_confidence DOUBLE,
    actual_move_pct   DOUBLE,
    outcome           VARCHAR,
    horizon_days      INTEGER,
    predicted_at      TIMESTAMP(6) WITH TIME ZONE,
    evaluated_at      TIMESTAMP(6) WITH TIME ZONE,
    dt                DATE
) WITH (
    format = 'PARQUET',
    partitioned_by = ARRAY['dt'],
    external_location = 's3a://stonks-lakehouse/warehouse/prediction_vs_outcome/'
);
