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

schema: missing field metadata when deserialize #241

Closed
BohuTANG opened this issue Apr 30, 2021 · 1 comment · Fixed by #260
Closed

schema: missing field metadata when deserialize #241

BohuTANG opened this issue Apr 30, 2021 · 1 comment · Fixed by #260
Labels
arrow Changes to the arrow crate bug good first issue Good for newcomers

Comments

@BohuTANG
Copy link

BohuTANG commented Apr 30, 2021

Describe the bug
In flight server/client mode, if the server schema is:

let schema = Schema::new(vec![
                Field::new("name", DataType::Utf8, false),
                Field::new("address", DataType::Utf8, false),
                Field::new("priority", DataType::UInt8, false),
            ])

The client will get an error:
status: Internal, message: "missing fieldmetadataat line 1 column 431", details: [], metadata: MetadataMap { headers: {"content-type": "application/grpc", "date": "Fri, 30 Apr 2021 08:43:12 GMT"} }

If we change the server schema(placehold an empty metadta) to:

let metadata: HashMap<String, String> = [("Key".to_string(), "Value".to_string())].iter().cloned().collect();
let schema = Schema::new_with_metadata(vec![
                Field::new("name", DataType::Utf8, false),
                Field::new("address", DataType::Utf8, false),
                Field::new("priority", DataType::UInt8, false),
            ], metadata)

All is ok.

I have removed this line from my local crate, it works too:

#[serde(skip_serializing_if = "HashMap::is_empty")]

@alamb
Copy link
Contributor

alamb commented May 3, 2021

Thanks for the report @BohuTANG

@alamb alamb added the good first issue Good for newcomers label May 3, 2021
hulunbier pushed a commit to hulunbier/arrow-rs that referenced this issue May 5, 2021
nevi-me pushed a commit that referenced this issue May 7, 2021
* Fix empty Schema::metadata deserialization error

Hope this fixes issue #241

* Rename UT name to `test_ser_de_metadata`

Co-authored-by: hulunbier <hulunbier>
@jorgecarleitao jorgecarleitao added arrow Changes to the arrow crate and removed arrow-flight Changes to the arrow-flight crate labels May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate bug good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants