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 redundant information in Column #230

Open
crwen opened this issue Nov 21, 2024 · 1 comment
Open

Remove redundant information in Column #230

crwen opened this issue Nov 21, 2024 · 1 comment

Comments

@crwen
Copy link
Contributor

crwen commented Nov 21, 2024

Column need a lot of information that can be found in ColumnDesc. Is there an elegant way to remove these fields?

pub struct Column {
    pub datatype: Datatype,
    pub value: Arc<dyn Any>,
    pub is_nullable: bool,
    pub name: String,
}

Here are some reasons that why we need these fields now:

  • Encoding and decoding: datatype is needed to decode from wal, and is_nullable is used to decide whether to cast to Option
  • Bindings:
    • Bindings can use name to identify columns. If we remove name, We need to ensure that the order of columns(getting from tonbo) is the same as the order defined by the schema, and we should set name for every column that is to return to user
    • Bindings use datatype to convert the value to the corresponding value, we can use column description though
Copy link

linear bot commented Nov 21, 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

No branches or pull requests

1 participant