LuciferYang opened a new pull request, #13997:
URL: https://github.com/apache/gravitino/pull/13997

   ### What changes were proposed in this pull request?
   
   - `HivePartition` escapes column names and values with Hive's partition path 
escaping when it builds a name, and unescapes them when it parses one, in all 
three parse helpers. The escaping is copied from Hive's `FileUtils`, because 
Hive classes are not visible to `HivePartition` in a deployed server.
   - The Spark connector's `HiveGravitinoOperationOperator` escapes the 
partition names it sends and unescapes the values it reads from 
`listPartitionNames`, using Spark's `ExternalCatalogUtils`.
   
   ### Why are the changes needed?
   
   HMS and `HiveTableConverter` use escaped partition names, while 
`HivePartition` and the connector used plain ones. Partitions whose values 
contain `/`, `=`, `%`, `:` and similar characters could not be added, or could 
be added but not loaded or dropped, and partitions created by Spark or Hive 
with such values were unreachable through Gravitino.
   
   Fix: #13993
   
   ### Does this PR introduce _any_ user-facing change?
   
   Partition names now follow the HMS escaping in both directions. Names of 
ordinary values are unchanged. A caller that passes an unescaped name whose 
value contains `%` followed by two hex digits now gets that sequence decoded, 
as HMS does.
   
   ### How was this patch tested?
   
   - `TestHivePartition`: names match `FileUtils.makePartName` for special 
values and round-trip; the drop filter unescapes values and field names; the 
copied escaping matches Hive's `FileUtils` for every character.
   - `TestHiveGravitinoOperationOperator`: the connector drops `ds=a%2Fb` for 
the value `a/b` and lists it back as `a/b`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to