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

remove or reconsider the NumbersTable #1827

Open
waynexia opened this issue Jun 25, 2023 · 3 comments
Open

remove or reconsider the NumbersTable #1827

waynexia opened this issue Jun 25, 2023 · 3 comments
Labels
C-enhancement Category Enhancements good first issue Good for newcomers

Comments

@waynexia
Copy link
Member

What type of enhancement is this?

Tech debt reduction

What does the enhancement do?

we have a built-in system table NumbersTable for testing. But it's very bad implemented and brings tons of special logic.

Implementation challenges

No response

@tisonkun
Copy link
Collaborator

tisonkun commented Nov 9, 2023

very bad implemented and brings tons of special logic

What kind of real issues you specify here? From my point of view, except:

} else if schema == DEFAULT_SCHEMA_NAME && table_name == NUMBERS_TABLE_NAME {
            Some(NumbersTable::table(NUMBERS_TABLE_ID))

This table impl is barely an internal testing table for convenient testing.

If we don't want it pollute the main logic but only whitebox table tests, we can exclude its usage in the main process (planning/name resolution) and annotate it with #[cfg(test)]. What do you think?

cc @waynexia

@waynexia
Copy link
Member Author

waynexia commented Nov 9, 2023

From my point of view, except:

That's one.

It also breaks a system-level invariant that every table should contain one TIME INDEX column.

If we don't want it pollute the main logic but only whitebox table tests, we can exclude its usage in the main process (planning/name resolution) and annotate it with #[cfg(test)]. What do you think?

Blackbox tests use this table more often. So #[cfg(test)] might not work. But for most cases in blackbox and whitebox tests we can use other ways to workaround NumbersTable. Like creating a temporary real table.

@tisonkun
Copy link
Collaborator

tisonkun commented Nov 9, 2023

It also breaks a system-level invariant that every table should contain one TIME INDEX column.

@waynexia How do we implement it or how can we check this invariant?

I found MemTable::default_numbers_table that may replace the NumbersTable but it doesn't seem to have TIME INDEX also.

Besides, it is expected to remove:

} else if schema == DEFAULT_SCHEMA_NAME && table_name == NUMBERS_TABLE_NAME {
            Some(NumbersTable::table(NUMBERS_TABLE_ID))

? I'm unsure if SELECT * FROM numbers should work or we can drop it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category Enhancements good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants