Hi Matt,

In addition to Martins comments, aliases are a good way to link different
names together. They can be used for schema evolution, but also for
projecting a table schema onto an avro record.

Note: aliases can be anything (they are intentionally not verified). The
only constraint is that they must be unambiguous / unique within their
scope.

Kind regards,
Oscar
-- 
Oscar Westra van Holthe - Kind <os...@westravanholthe.nl>

Op za 12 okt. 2024 10:56 schreef Martin Grigorov <mgrigo...@apache.org>:

> Hi Matt,
>
> Which SDK do you use ?
>
> Most of the SDKs support custom attributes so you should be able to store
> the invalid names in them and later recover the initial values!
>
> Some of the SDKs allow the use of custom name validators. This way you can
> relax the checks.
> For the Rust SDK see
> https://github.com/apache/avro-rs/blob/main/avro/README.md#custom-names-validators
>
> IIRC the Java SDK also has hooks for this but I can't point you to the
> exact APIs at the moment.
>
> Martin
>
> On Thu, Oct 10, 2024 at 8:14 PM Matt Burgess <mattyb...@gmail.com> wrote:
>
>> Hi all,
>>
>> I'm new to this list so I apologize if this has been discussed before,
>> but I couldn't find anything in the archives about it.
>>
>> I'm on the PMC for Apache NiFi and I'm facing an issue with a source and
>> a target database that allow digits as the first character of a table /
>> column name. I'd like to be able to keep the data in Avro throughout the
>> NiFi flow, but the names are not valid for Avro. Is there any workaround
>> (perhaps using aliases or custom attributes/metadata?) for having the
>> invalid name somewhere in the schema that my code could use (while renaming
>> the fields to Avro-valid names in the middle of the flow) to "restore" the
>> original name when inserting the data into the target database?
>>
>> Thank you in advance,
>> Matt
>>
>

Reply via email to