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

Why using intput.schema() in keyCalculationExtension? #742

Open
zhuliquan opened this issue Sep 19, 2024 · 0 comments
Open

Why using intput.schema() in keyCalculationExtension? #742

zhuliquan opened this issue Sep 19, 2024 · 0 comments

Comments

@zhuliquan
Copy link
Contributor

I notice that schema in func output_scheame is not compatible with func schema in keyCalculationExtension.

in output_schemme, using self.input.schema() as output.

fn output_schema(&self) -> ArroyoSchema {
let arrow_schema = Arc::new(self.input.schema().as_ref().into());
ArroyoSchema::from_schema_keys(arrow_schema, self.keys.clone()).unwrap()
}

but in schema, using self.schema as output.

fn schema(&self) -> &DFSchemaRef {
&self.schema
}

I notice that self.schema is not equal to self.input.schema()

let output_fields: Vec<_> = fields_with_qualifiers(input.schema())
.into_iter()
.enumerate()
.filter_map(|(index, field)| {
if !keys.contains(&index) {
Some(field.clone())
} else {
None
}
})
.collect();
let schema =
schema_from_df_fields_with_metadata(&output_fields, input.schema().metadata().clone())
.unwrap();
Self {
name: Some(name),
input,
keys,
schema: Arc::new(schema),
}

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