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

refactor(backends): split memtable existence check out #10053

Merged

Conversation

cpcloud
Copy link
Member

@cpcloud cpcloud commented Sep 7, 2024

First of two a few PRs to implement #10044. This one factors out memtable existence checks to allow a generic implementation of register-only-if-not-exists, as well as to allow improvement over time of this check as we discover faster existence check implementations.

@cpcloud cpcloud added refactor Issues or PRs related to refactoring the codebase performance Issues related to ibis's performance labels Sep 7, 2024
@@ -33,7 +33,6 @@ class Backend(SQLBackend):
name = "druid"
compiler = sc.druid.compiler
supports_create_or_replace = False
supports_in_memory_tables = True
Copy link
Member Author

Choose a reason for hiding this comment

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

The default value of this flag is True, hence the removal in a few places.

@@ -253,50 +253,47 @@ def _register_in_memory_table(self, op: ops.InMemoryTable) -> None:
f"got null typed columns: {null_columns}"
)

# only register if we haven't already done so
if (name := op.name) not in self.list_tables():
Copy link
Member Author

Choose a reason for hiding this comment

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

The only bits I changed here were to remove this conditional, and then dedent what was previously indented inside the branch.

@cpcloud cpcloud changed the title refactor(backends): split memtable existence check out to enable optimization over time refactor(backends): split memtable existence check out to allow a generic implementation of register-only-if-not-exists Sep 7, 2024
@cpcloud cpcloud force-pushed the factor-out-memtable-existence-check branch 2 times, most recently from 63fe2b9 to 31372ea Compare September 7, 2024 16:49
@cpcloud cpcloud changed the title refactor(backends): split memtable existence check out to allow a generic implementation of register-only-if-not-exists refactor(backends): split memtable existence check out Sep 8, 2024
@cpcloud cpcloud force-pushed the factor-out-memtable-existence-check branch from 31372ea to 33bdc39 Compare September 8, 2024 11:19
@cpcloud cpcloud added sql Backends that generate SQL postgres The PostgreSQL backend sqlite The SQLite backend snowflake The Snowflake backend risingwave The RisingWave backend pyspark The Apache PySpark backend labels Sep 8, 2024
@cpcloud cpcloud requested a review from jcrist September 9, 2024 11:29
@cpcloud
Copy link
Member Author

cpcloud commented Sep 9, 2024

I'll split out the perf improvements to a separate PR.

@cpcloud cpcloud force-pushed the factor-out-memtable-existence-check branch 2 times, most recently from d05de5e to 1b5dbb4 Compare September 9, 2024 14:42
ibis/backends/__init__.py Outdated Show resolved Hide resolved
Copy link
Member

@jcrist jcrist left a comment

Choose a reason for hiding this comment

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

LGTM (besides the method name).

@cpcloud cpcloud added this to the 9.5 milestone Sep 9, 2024
@cpcloud cpcloud force-pushed the factor-out-memtable-existence-check branch 2 times, most recently from c342081 to 9935cb9 Compare September 9, 2024 15:49
@cpcloud cpcloud force-pushed the factor-out-memtable-existence-check branch from e3341ae to 1fa978c Compare September 9, 2024 16:15
@cpcloud cpcloud enabled auto-merge (squash) September 9, 2024 16:53
@cpcloud cpcloud merged commit 77448bf into ibis-project:main Sep 9, 2024
81 checks passed
@cpcloud cpcloud deleted the factor-out-memtable-existence-check branch September 9, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issues related to ibis's performance postgres The PostgreSQL backend pyspark The Apache PySpark backend refactor Issues or PRs related to refactoring the codebase risingwave The RisingWave backend snowflake The Snowflake backend sql Backends that generate SQL sqlite The SQLite backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants