vitessio / vitess

Vitess is a database clustering system for horizontal scaling of MySQL.
http://vitess.io
Apache License 2.0
18.6k stars 2.1k forks source link

Feature Request: Support JOIN as an aggregation in vitess materialize #14750

Open Amila-Rukshan opened 10 months ago

Amila-Rukshan commented 10 months ago

Feature Description

I would like to have the support for the above so we can have materialized joined table outputs:

Sample command:

vtctlclient Materialize -- '{"workflow": "car_search", "source_keyspace": "car-listing-marketplace", "target_keyspace": "car-listing-marketplace", "table_settings": [{"target_table": "car_search", "source_expression": "SELECT id, make, model, year, mileage, price, JSON_ARRAYAGG(JSON_OBJECT('\''start'\'', booking.start_time, '\''end'\'', booking.end_time)) AS booked_times FROM car LEFT JOIN booking ON car.id = booking.car_id GROUP BY car.id" }]}'

Use Case(s)

Users can keep derived tables by joining main tables where joining big tables is frequent and / or expensive.

mattlord commented 1 month ago

@rohit-nayak-ps this is another issue related to your work on supporting JOINs.