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

model executor for postgres and mysql to duckdb #6083

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

k-anshul
Copy link
Member

@k-anshul k-anshul commented Nov 12, 2024

subtask for https://github.com/rilldata/rill-private-issues/issues/854

  • Adds a model executor that ingests data from postgres/mysql using duckdb extension.
  • Also supports incremental ingestion.

Sample model yaml that ingests from postgres.

connector: postgres
sql: SELECT * FROM students 
dsn: "postgresql://postgres:postgres@localhost:5432/postgres"

output:
  connector: duckdb

@k-anshul k-anshul self-assigned this Nov 12, 2024
@k-anshul k-anshul changed the title model executor for postgres to duckdb model executor for postgres and mysql to duckdb Nov 13, 2024
@k-anshul k-anshul marked this pull request as draft November 13, 2024 13:35
@k-anshul k-anshul marked this pull request as ready for review December 18, 2024 09:10
runtime/drivers/duckdb/model_executor_sqlstore_self.go Outdated Show resolved Hide resolved
runtime/drivers/duckdb/model_executor_sqlstore_self.go Outdated Show resolved Hide resolved
runtime/drivers/duckdb/model_executor_sqlstore_self.go Outdated Show resolved Hide resolved
@@ -123,3 +132,55 @@ func allMySQLDataTypesTest(t *testing.T, db *sql.DB, dsn string) {
require.NoError(t, res.Close())
require.NoError(t, to.Close())
}

func mysqlToDuckDB(t *testing.T, dsn string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move this test to a test file that starts with model_executor_ instead? For when we drop the transporter files?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually I planned to rename this file and drop the transporter test when re drop the transporter files. Till then kept it in the same file to avoid creating more test containers and keep test time short.
I am okay to also create new test if you prefer that way.

@@ -86,3 +93,80 @@ func allDataTypesTest(t *testing.T, db *sql.DB, dbURL string) {
require.NoError(t, res.Close())
require.NoError(t, to.Close())
}

func pgxToDuckDB(t *testing.T, pgdb *sql.DB, dbURL string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar comment about moving to a model executor related test file

@k-anshul k-anshul assigned AdityaHegde and k-anshul and unassigned k-anshul and AdityaHegde Dec 20, 2024
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.

3 participants