You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Michael A. Smith" <mi...@smith-li.com> on 2019/11/06 02:36:31 UTC

What is the length of an avro schema?

AVRO-239 asks for an implementation of `__len__` in Python's
implementation of avro schema. It points to BSON as an example, but I
don't really understand what the ask is -- what's the purpose of
having a "length" of a schema, and what would it mean? If schema had a
consistent length, how could users benefit from it?

Thanks,
Michael A. Smith

Re: What is the length of an avro schema?

Posted by Ryan Skraba <ry...@skraba.com>.
+1 for closing the JIRA if we can't find the interesting use case...
For me, an implicit `__len__` would be more confusing than using
`str()` and getting the length.

All my best, Ryan

On Thu, Nov 21, 2019 at 3:47 AM Michael A. Smith <mi...@smith-li.com> wrote:
>
> We could define the length of a schema as e.g. the length of the
> parsing canonical form, but I'm just not that convinced there's value
> here. I'm inclined to close this issue.
>
> On Thu, Nov 7, 2019 at 4:06 AM Ryan Skraba <ry...@skraba.com> wrote:
> >
> > I think you're correct: as written, the JIRA doesn't have a lot of sense.
> >
> > Does the BSON example imply that it would be useful to get the Avro
> > length of a datum given a schema?
> >
> > Roughly: `len(my_schema.from_datum({"hello": "world"})) == 22` ?  It
> > doesn't seem quite right either!
> >
> >
> > On Wed, Nov 6, 2019 at 3:36 AM Michael A. Smith <mi...@smith-li.com> wrote:
> > >
> > > AVRO-239 asks for an implementation of `__len__` in Python's
> > > implementation of avro schema. It points to BSON as an example, but I
> > > don't really understand what the ask is -- what's the purpose of
> > > having a "length" of a schema, and what would it mean? If schema had a
> > > consistent length, how could users benefit from it?
> > >
> > > Thanks,
> > > Michael A. Smith

Re: What is the length of an avro schema?

Posted by "Michael A. Smith" <mi...@smith-li.com>.
We could define the length of a schema as e.g. the length of the
parsing canonical form, but I'm just not that convinced there's value
here. I'm inclined to close this issue.

On Thu, Nov 7, 2019 at 4:06 AM Ryan Skraba <ry...@skraba.com> wrote:
>
> I think you're correct: as written, the JIRA doesn't have a lot of sense.
>
> Does the BSON example imply that it would be useful to get the Avro
> length of a datum given a schema?
>
> Roughly: `len(my_schema.from_datum({"hello": "world"})) == 22` ?  It
> doesn't seem quite right either!
>
>
> On Wed, Nov 6, 2019 at 3:36 AM Michael A. Smith <mi...@smith-li.com> wrote:
> >
> > AVRO-239 asks for an implementation of `__len__` in Python's
> > implementation of avro schema. It points to BSON as an example, but I
> > don't really understand what the ask is -- what's the purpose of
> > having a "length" of a schema, and what would it mean? If schema had a
> > consistent length, how could users benefit from it?
> >
> > Thanks,
> > Michael A. Smith

Re: What is the length of an avro schema?

Posted by Ryan Skraba <ry...@skraba.com>.
I think you're correct: as written, the JIRA doesn't have a lot of sense.

Does the BSON example imply that it would be useful to get the Avro
length of a datum given a schema?

Roughly: `len(my_schema.from_datum({"hello": "world"})) == 22` ?  It
doesn't seem quite right either!


On Wed, Nov 6, 2019 at 3:36 AM Michael A. Smith <mi...@smith-li.com> wrote:
>
> AVRO-239 asks for an implementation of `__len__` in Python's
> implementation of avro schema. It points to BSON as an example, but I
> don't really understand what the ask is -- what's the purpose of
> having a "length" of a schema, and what would it mean? If schema had a
> consistent length, how could users benefit from it?
>
> Thanks,
> Michael A. Smith