These are chat archives for Nitro/avro-codegen

16th
Dec 2015
Eric Biggs
@ebiggs
Dec 16 2015 00:34
Regarding your commit message about namespaces, I want to explain what I ran into and maybe we can come up with a better solution... The avro specification makes a distinction between no namespace and the null namespace. The null namespace is referred to by an empty string, And specifying no namespace means to inherit from the parent context. However, if there is no parent context, then use the null namespace. Unfortunately there's no way to distinguish between these two different semantics using the fully qualified name, but the Av* AST does make a distinction. So if you specified namesakes == None, it infers the null namespace and a reference that refers to None will not work.. I think there's probably a way to clean this up I just didn't take the time to think it through and write the tests etc..
Malcolm Greaves
@malcolmgreaves
Dec 16 2015 00:34
Paul and I paired today, getting the codegen module to actually use the partial schema parser. Updated the e2e tests to exercise this new behavior. Now 0.3.1 is out which is nice and useable! =D
wrt to the runtime stuff @ebiggs : I think that could work. It is generated code, though, so I don't know how much of a burden this change will lift off our collective shoulders... You're advocating this just to reduce repetition?
wrt namespaces: ah, I didn't realize that distinction in the spec
with that, I think what I had earlier was a test exercising the null namespace...but without actually using null.<name_of_schema>
so that e2e test case was actually probably wrong to begin with...
With this new info, I'm not sure if this namespace thing is as important. IMO everyone should put their schemas into namespaces. Maybe we could have an option to fail the codegen if we encounter a schema w/o a namespace?
Eric Biggs
@ebiggs
Dec 16 2015 00:39
Perhaps, but if it's less intuitive to work with than .avsc there's probably a way to make it feel the same.. we just have to figure out exactly what that means..
Malcolm Greaves
@malcolmgreaves
Dec 16 2015 00:39
I hear you
this does seem like a more minor issue, right? so we could open it up and maybe flesh out some details there
Eric Biggs
@ebiggs
Dec 16 2015 00:42
Yes there is an issue regarding repetitive / long string literals, which is fairly inconsequential... but I'm also finding that I'd like to repurpose the AST in my scala 2.11 code so I was trying to make an excuse to have it published that way :)
Yeah it's minor, I mean it doesn't bother me, but it might help make the software more approachable to newbies
Malcolm Greaves
@malcolmgreaves
Dec 16 2015 00:44
Definitely. Not dismissing, just sort-of mentally triaging.
Eric Biggs
@ebiggs
Dec 16 2015 00:44
I also have a desire for something that might be a bit crazy that having the AST would make it much more easy to implement.
Malcolm Greaves
@malcolmgreaves
Dec 16 2015 00:44
I'll let @pkinsky weigh in with his thoughts here. But I'd personally be open to review a PR for it.
Eric Biggs
@ebiggs
Dec 16 2015 00:45
I'm not even sure if it's a feasible feature
but essentially want I want to be able to do is have it codegen case class that take a type parameter, which when specified will create different Avro schema depending on the parameter you call it with
Malcolm Greaves
@malcolmgreaves
Dec 16 2015 00:45
the crazy thing?
oh interesting...
Eric Biggs
@ebiggs
Dec 16 2015 00:46
Yeah simple in principle but the edge cases, and how to extend avro to even make sense of it, would take some serious thinking
Malcolm Greaves
@malcolmgreaves
Dec 16 2015 00:46
so I have gotta get home right now
I'll catch up on messages in a little while
Eric Biggs
@ebiggs
Dec 16 2015 00:46
ok, later
Malcolm Greaves
@malcolmgreaves
Dec 16 2015 00:46
(need some zzzzs! =D )