Repository navigation
Conversation
|
Producing a view without the proper joins does not feel that helpful. It is not a correct view. Why not use AI for this, which can even suggest a way of joining the columns? /cc @jschoedl |
The relationship and references will be implemented soon, at this state the export is enough for my needs. |
|
Thanks @simonharrer, fair point: a view with a cross join isn't a correct view. I'd rather not call an LLM from
It will also accept column references in AI suggesting joins when there are no relationships sounds useful, maybe in |
|
relationships does not help, as this only is for the tables of the data contract, not for the source tables. I still see this as an issue. We typically create valid things via export. Here, we create something that is obviously flawed. People will not expect this. They are REQUIRED to improve it manually. So what is the gain? We could generate the view, but add a placeholder in the view that makes it unexecutable so a user has to fix it. Then, I am okay with it. But it should not just work without the join column. Or simply comment the FROM out, and one has to comment it in afterwards. Something like this. |
|
I agree with Simon: ODCS has no place for a full join specification (yet), and we should rather make this limitation obvious than guess during the export. For specific company-internal conventions, it can in general be more helpful to use a custom exporter, as you @dmaresma shared here. The native exporters in @OGsiji Could you limit the PR to views with a single source object? If there are several known source objects, you may generate a non-executable draft, which could look like this: CREATE OR REPLACE VIEW orders_enriched AS
SELECT
order_id,
customer_id,
customer_name
FROM bronze.orders
JOIN bronze.customers ON <TODO: join condition>;and similar with |
30d9aec to
52b3689
Compare
|
Makes sense, thanks @jschoedl and @simonharrer. Pushed that:
The draft cases also log a warning. I dropped the relationships join and the fallback to a table, and rebased on main. |

Closes #1031.
A schema with
physicalType: viewnow exports asCREATE OR REPLACE VIEW … AS SELECT …instead ofCREATE TABLE. Column types and the primary key are left out.transformSourceObjects. An entry whose last part is the property's name, such asbronze.orders.order_id, is read as a column of that object.JOIN bronze.customers ON <TODO: join condition>. With none, it selectsFROM <TODO: source object>. Both log a warning, and the view cannot be created until the TODOs are filled in.CREATE OR ALTER VIEW.