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

Allow any column name in property Parquet files #634

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

darabos
Copy link
Contributor

@darabos darabos commented Oct 19, 2021

Hi,
With this change I'm able to use the same Parquet files in a new RDG version under a new name.
I'm not sure about the C++. ValueOrDie sounds scary, but it's after the ok() check. Is there a better way?

@darabos darabos requested a review from tylershunt October 19, 2021 15:58
std::shared_ptr<arrow::Schema> schema = out->schema();
if (schema->num_fields() != 1) {
return KATANA_ERROR(
tsuba::ErrorCode::InvalidArgument, "expected 1 field found {} instead",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

RenameColumns() performs this same check, so we can just rely on that.

return KATANA_ERROR(
tsuba::ErrorCode::InvalidArgument, "expected {} found {} instead",
expected_name, schema->field(0)->name());
auto renamed = out->RenameColumns({expected_name});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure renaming is necessary. This way nobody outside of this function can even tell that the name in the Parquet file is not the same as in the metadata. Perhaps nobody looks at it anyway?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, renaming is important since we rely on the arrow schema to name properties. thanks!

Copy link
Contributor

@tylershunt tylershunt left a comment

Choose a reason for hiding this comment

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

thanks for this! I'll open a PR for katana-enterprise to make sure CI is ok with this and then we should be able to merge.

@darabos
Copy link
Contributor Author

darabos commented Nov 30, 2021

thanks for this! I'll open a PR for katana-enterprise to make sure CI is ok with this and then we should be able to merge.

Sorry, I totally forgot about it! Let me know if you have an update on this. This is still kind of required for the LynxKite integration. Thanks!

@wkyu2kg
Copy link
Contributor

wkyu2kg commented Dec 7, 2021

@tylershunt Daniel mentioned about this PR in today's meeting. Would you review and approve this?

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

Successfully merging this pull request may close these issues.

3 participants