Field Name Encoding
Learn how Upsolver handles field name encoding in Avro and Parquet files.
Upsolver ensures compatibility with various target systems, including those that have specific restrictions on field names, such as Avro. This document outlines how Upsolver handles field name encoding in AVRO and Parquet files, ensuring the proper encoding and representation of field names.
Avro Field Name Restrictions
Avro imposes specific restrictions on field names, which must:
Start with characters
[A-Za-z_]
Subsequently contain only
[A-Za-z0-9_]
Upsolver's Encoding Strategy
To support any Unicode character in field names, Upsolver encodes these names. Moreover, for targets with case-insensitive column names such as Amazon Athena, Upsolver encodes uppercase characters.
The user generally will not see these encoded names in the target system but may encounter them in intermediate files or if looking directly at the source files.
Only fields containing unsupported characters are encoded.
Encoding Pattern
An encoded field starts with x_
, and every encoded character is represented as _<char-code>_
.
Example
Consider the following original data:
When converted to a Parquet file for use in Athena (which is case insensitive), it will be encoded as follows:
This encoding ensures that the field names comply with the restrictions while preserving the original field names within the data content, thereby maintaining consistency and compatibility across different systems. In Athena, the table/view definition will name the columns by their original unencoded name.
Last updated