You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/01/05 11:38:00 UTC

[jira] [Work logged] (AVRO-3216) Rust: failure reading multiple use of named schemas in file

     [ https://issues.apache.org/jira/browse/AVRO-3216?focusedWorklogId=703887&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-703887 ]

ASF GitHub Bot logged work on AVRO-3216:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 05/Jan/22 11:37
            Start Date: 05/Jan/22 11:37
    Worklog Time Spent: 10m 
      Work Description: martin-g merged pull request #1345:
URL: https://github.com/apache/avro/pull/1345


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 703887)
    Time Spent: 0.5h  (was: 20m)

> Rust: failure reading multiple use of named schemas in file
> -----------------------------------------------------------
>
>                 Key: AVRO-3216
>                 URL: https://issues.apache.org/jira/browse/AVRO-3216
>             Project: Apache Avro
>          Issue Type: Bug
>            Reporter: Guðjón
>            Assignee: Martin Tzvetanov Grigorov
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.12.0
>
>         Attachments: weather-complex.avro
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> I have an avro file that contains records of a specific schema. The file is written using the java implementation, with the generated classes. 
> The schema itself uses named schemas in a way where two or more fields use the same named schema. A good example of this could be this weather schema 
> {code:json}
> {
> 	"doc": "A weather reading.",
> 	"name": "Weather",
> 	"namespace": "test",
> 	"type": "record",
> 	"fields": [
> 		{
> 			"name": "station",
> 			"type": "string"
> 		},
> 		{
> 			"name": "max_temp",
> 			"type": "Temp"
> 		},
> 		{
> 			"name": "min_temp",
> 			"type": "Temp"
> 		}
> 	]
> }
> {code}
> with the named schema Temp being 
> {code:json}
> {
> 	"doc": "A temperature reading.",
> 	"name": "Temp",
> 	"namespace": "test",
> 	"type": "record",
> 	"fields": [
> 		{
> 			"name": "temp",
> 			"type": "long"
> 		}
> 	]
> }
> {code}
> The schema that is written in the file inlines the Temp schema in the case of the first field (max_temp) but references it by name in the second field (min_temp). In both java and python implementations it manages to read the file correctly but the avro-rs crate fails on the second field with a message:
> {noformat}
> panicked at 'Failure reading file: Unknown primitive type: Temp'
> {noformat}
> The attached file weather-complex.avro is a file written using the java library with generated classes and contains one record. 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)