MCPcopy Create free account
hub / github.com/apache/orc / parseKeys

Method parseKeys

java/core/src/java/org/apache/orc/impl/ParserUtils.java:528–543  ·  view source on GitHub ↗

Annotate the given schema with the encryption information. Format of the string is a key-list. key-list = key (';' key-list)? key = key-name ':' field-list field-list = field-name ( ',' field-list )? field-name = number | field-part ('.' field-name)?

(StringPosition source, TypeDescription schema)

Source from the content-addressed store, hash-verified

526 * @throws IllegalArgumentException if there are conflicting keys for a field
527 */
528 public static void parseKeys(StringPosition source, TypeDescription schema) {
529 if (source.hasCharactersLeft()) {
530 do {
531 String keyName = parseName(source);
532 requireChar(source, ':');
533 for (TypeDescription field : findSubtypeList(schema, source)) {
534 String prev = field.getAttributeValue(TypeDescription.ENCRYPT_ATTRIBUTE);
535 if (prev != null && !prev.equals(keyName)) {
536 throw new IllegalArgumentException("Conflicting encryption keys " +
537 keyName + " and " + prev);
538 }
539 field.setAttribute(TypeDescription.ENCRYPT_ATTRIBUTE, keyName);
540 }
541 } while (consumeChar(source, ';'));
542 }
543 }
544
545 /**
546 * Annotate the given schema with the masking information.

Callers 1

annotateEncryptionMethod · 0.95

Calls 8

parseNameMethod · 0.95
requireCharMethod · 0.95
findSubtypeListMethod · 0.95
consumeCharMethod · 0.95
hasCharactersLeftMethod · 0.80
setAttributeMethod · 0.80
getAttributeValueMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected