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

feat: create table in integration table from evadb select query #1125

Merged
merged 7 commits into from
Sep 15, 2023

Conversation

gaurav274
Copy link
Member

@gaurav274 gaurav274 commented Sep 14, 2023

  1. CREATE TABLE postgres_db.table AS SELECT ...
  2. Moved native_storage_engine to sqlalchemy

1. Converting to lowercase for the time being. Changing the binder to
take care of case sensitive databases is a long commitment and we can
revisit it later.
@gaurav274 gaurav274 self-assigned this Sep 14, 2023
@gaurav274 gaurav274 added Feature Request ✨ New feature or request High Effort 🏋 Difficult solution or problem to solve labels Sep 14, 2023
@gaurav274 gaurav274 added this to the v0.3.5 milestone Sep 14, 2023
@gaurav274 gaurav274 marked this pull request as ready for review September 14, 2023 22:22
"""USE test_data_source {
DROP TABLE IF EXISTS derived_table
}""",
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the clean up code? If so, shall we put it in the cls teardown?

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree. The test class is getting complicated and needs to be simplified.

"DATETIME": datetime.datetime,
}

def preprocess_sqlite_type(sqlite_type):
Copy link
Member

Choose a reason for hiding this comment

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

What will be the format of sqlite_type passed in?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't need a separate local function anymore. I can directly call the split on the input of the outer function.

@@ -146,3 +151,45 @@ def execute_native_query(self, query_string: str) -> DBHandlerResponse:
return DBHandlerResponse(data=self._fetch_results_as_df(cursor))
except sqlite3.Error as e:
return DBHandlerResponse(data=None, error=str(e))

def _sqlite_to_python_types(self, sqlite_type: str):
mapping = {
Copy link
Member

Choose a reason for hiding this comment

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

You probably already explained once, but why don't we directly map to ColumnType?

And, how do we handle types that are not part of our ColumnType (e.g., DATETIME)?

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. Don't want to expose EvaDB types to third-party integrations.
  2. We don't support it right now.

@gaurav274 gaurav274 linked an issue Sep 15, 2023 that may be closed by this pull request
2 tasks
@gaurav274 gaurav274 merged commit 696aaf6 into staging Sep 15, 2023
5 checks passed
@gaurav274 gaurav274 deleted the insert branch September 15, 2023 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request ✨ New feature or request High Effort 🏋 Difficult solution or problem to solve
Projects
Development

Successfully merging this pull request may close these issues.

Support inserting into postgres directly from evadb's select query
3 participants