-
Notifications
You must be signed in to change notification settings - Fork 59
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
Using other string types besides UTF8.class #399
base: master
Are you sure you want to change the base?
Conversation
@FelixGV could you please review |
i see this adding "defaultStringClass", but where is it used? is it intendd to be used by subclasses? a followup PR? |
it's intended to be used in client's code like this
|
@oleg-smith |
@gaojieliu can you bring an example of how to instruct the generator to use String. class this way? |
@oleg-smith
If you want to use Java String type as the deserialized Map key:
Of coz, you need to use Avro-1.7+ to take advantage of these annotations. |
@gaojieliu I meant how to do it from Java code? I don't have access to schema file |
and how to do it for all String fields at once? |
@oleg-smith @radai-rosenblatt |
how come - it comes from the external jar as already generated Avro schema |
also, is there a way to make deserializer generation synchronous? it's a bit of undeterministic now |
@oleg-smith Regarding supporting specific CharSequence impl override in fast-avro, I think a utility to add right string annotation could be the right way to go since the string annotated schema can be used by vanilla Avro as well in case fast-avro has a bug, you still could fall back to vanilla Avro with the same outcome. |
Can this method be used in FastSerdeCache? |
yeah, it is a public method in |
a config would still be needed - because some folks would like to ignore hints on schemas even if you plan on supporting those hints |
@gaojieliu I mean is there a way to build it and put it into the cache synchronously? looks like currently it's only async |
to clarify what i posted above: even if fast-avro respected "logical types" (which those string hints are), some users (me) would like to be able to override them to get consistent behaviour across all schemas in my codebase at runtime. so i think making this a config option to fast-avro at runtime (as originally suggested) is a better approach, and definitely needs to happen before fast-avro starts respecting logical types :-) also - this means that an implementation is required, which is not part of this PR? |
I see. |
By this, do you mean that we would provide a "schema processing" utility, where the input is a schema containing string fields, and the output would be the same schema where all string fields were overridden to be of a type defined by the user? |
No description provided.