Skip to content

Introduce the View of MDL #645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 3, 2024
Merged

Conversation

goldmedal
Copy link
Contributor

@goldmedal goldmedal commented Jul 1, 2024

Description

Introduce View

Now, we can support the view in the MDL.

  "views": [
    {
      "name": "customer_view",
      "statement": "select * from test.test.customer"
    }

User can store the Wren SQL as a view statement.

There're some limitations:

  • The table name should be qualified ( full catalog.schema.table name )
  • A complex expression should have alias name. There's an issue for the complex expression. The SQL as below can't be supported currently.
select order_id, sum(price) from wrenai.public.order_items group by order_id

Include SessionContext

In this PR, I include the Datafusion::SessionContext in the SQL planning flow. It will be responsible for store what we can use when planning SQL. I create another API named transform_sql_with_ctx that accepts a SessionContext which might be registered some tables. The original API transform_sql will create a default SessionContext for planning.

@goldmedal goldmedal marked this pull request as ready for review July 2, 2024 07:26
@goldmedal goldmedal requested a review from grieve54706 July 2, 2024 07:27
Copy link
Contributor

@grieve54706 grieve54706 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@grieve54706 grieve54706 merged commit a7de461 into Canner:main Jul 3, 2024
9 checks passed
grieve54706 pushed a commit that referenced this pull request Dec 13, 2024
* use session context handle table provider

* use positive match

* introduce the view in mdl

* modify the wren-modeling-py

* remove unused tests

* cargo clippy

* cargo fmt

* revert python change and provide sync fn for sql transform

* cargo fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants