Skip to content
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

Materialized connector inital setup #417

Merged
merged 1 commit into from
May 14, 2024

Conversation

andresgutgon
Copy link
Contributor

@andresgutgon andresgutgon commented May 14, 2024

What?

We want to allow users cache queries from their sources on disk to improve performance. The queries will be stored in parquet format and read with DuckDB. For that reason, this new connector inherits from our existing DuckDB connector. This PR starts the work in this connector to make it usable in development and writing queries to disk.

Issue ticket number and link

#369

Dependency

#416

Checklist before requesting a review

  • Pass Source to connectors (done in another PR)
  • Implement materializedReffunction

Copy link

changeset-bot bot commented May 14, 2024

⚠️ No Changeset found

Latest commit: 0da39e0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@andresgutgon andresgutgon mentioned this pull request May 14, 2024
2 tasks
@andresgutgon andresgutgon force-pushed the feature/find-query-files-with-relative-paths branch 4 times, most recently from 2d36079 to 8a6b394 Compare May 14, 2024 11:01
Base automatically changed from feature/find-query-files-with-relative-paths to canary May 14, 2024 11:05
@andresgutgon andresgutgon force-pushed the feature/materialize-connector-start branch 2 times, most recently from 7bd871f to 38f2639 Compare May 14, 2024 12:16
const compiledSubQuery = await this.source.compileQuery(
const refSource =
await this.source.manager.loadFromQuery(fullSubQueryPath)
const compiledSubQuery = await refSource.compileQuery(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is important. Now runQuery is cross-source. Meaning you can call a query from another source.

Comment on lines +65 to +68
const materialize = compiledSubQuery.config.materialize_query
const isFalse = materialize === false

if (isFalse) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The isFalse variable is not really needed... You can just do if (!materialize)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know but I want to let users know when they configured with false

Comment on lines +78 to +79
throw new Error(
`'${referencedQuery}' query can not have parameters to filter the SQL query. You're using ${usedParams} params in the query`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to show the user which params have they used? I think that can be implicit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it doesn't hurt no?

This commit just introduce the materialize connector but is will need
another piece to work that we'll introduce in another PR. For now we
don't publish this connector
@andresgutgon andresgutgon force-pushed the feature/materialize-connector-start branch from 38f2639 to 0da39e0 Compare May 14, 2024 13:12
@andresgutgon andresgutgon merged commit cc7d310 into canary May 14, 2024
4 checks passed
@andresgutgon andresgutgon deleted the feature/materialize-connector-start branch May 14, 2024 13:21
@github-actions github-actions bot locked and limited conversation to collaborators May 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants