wren-engine icon indicating copy to clipboard operation
wren-engine copied to clipboard

Allow to set default catalog and default schema when `transform_sql`

Open goldmedal opened this issue 1 year ago • 6 comments

Description

Currently, wren-core-rs recognizes a qualified table name to generate the corresponding model. The user needs to provide the full name of the model in the query, such as:

SELECT * FROM wren.public.orders

It would be more convenient if the user could simply query with the table name:

SELECT * FROM orders

Solution

We can modify the transform_sql API to apply the catalog and schema of MDL to the DataFusion SessionContext.

goldmedal avatar Jul 25 '24 03:07 goldmedal

It is also related to the V3 validation API. https://github.com/Canner/wren-engine/blob/8449442a54a7953dee694bf5526f35448da23273/ibis-server/tests/routers/v3/connector/test_postgres.py#L311-L312

goldmedal avatar Jul 25 '24 03:07 goldmedal

@goldmedal Can you assign it to me?

himanshu634 avatar Jul 31 '24 04:07 himanshu634

Thanks @himanshu634. If you have any questions about it, feel free to ask me here or leave message.

goldmedal avatar Jul 31 '24 05:07 goldmedal

Hey @goldmedal , I want to understand the project. What module does what work?

himanshu634 avatar Aug 09 '24 10:08 himanshu634

Hey @goldmedal , I want to understand the project. What module does what work?

Hi @himanshu634, sorry for the delayed response; I had some personal matters to attend to.

This project is transitioning to a Rust implementation. There are many legacy Java modules you can ignore. You only need to focus on the following three modules:

  • ibis-server: This is a server responsible for data source connections (e.g., Postgres, BigQuery, etc.).
  • wren-modeling-rs: This Rust module handles data modeling and can translate a semantic SQL based on an MDL (provided by WrenAI web) into a real SQL. For more information about modeling concepts, you can check our documentation.
  • wren-modeling-py: This is a Python API for wren-modeling-rs. The ibis-server uses it to invoke wren-modeling-rs. You can refer to https://github.com/Canner/wren-engine/pull/710 to see how it is used.

I hope this information is helpful to you.

goldmedal avatar Aug 12 '24 02:08 goldmedal

Hey @goldmedal , I want to understand the project. What module does what work? Here's a grammatically corrected version:

Hi @himanshu634, sorry for the delayed response; I had some personal matters to attend to.

This project is transitioning to a Rust implementation. There are many legacy Java modules you can ignore. You only need to focus on the following three modules:

I hope this information is helpful to you.

Thanks.

himanshu634 avatar Aug 12 '24 08:08 himanshu634

Hi @himanshu634 Due to our schedule, I finished this work first. I found it may not be so simple for someone unfamiliar with our project and Rust. Maybe it's not a good first issue I think 🤔 Anyway, thank you for trying to contribute to wren-engine.

goldmedal avatar Aug 20 '24 05:08 goldmedal