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

Method parseMasks

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

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

(StringPosition source, TypeDescription schema)

Source from the content-addressed store, hash-verified

559 * @throws IllegalArgumentException if there are conflicting masks for a field
560 */
561 public static void parseMasks(StringPosition source, TypeDescription schema) {
562 if (source.hasCharactersLeft()) {
563 do {
564 // parse the mask and parameters, but only get the underlying string
565 int start = source.position;
566 parseName(source);
567 while (consumeChar(source, ',')) {
568 parseName(source);
569 }
570 String maskString = source.fromPosition(start);
571 requireChar(source, ':');
572 for (TypeDescription field : findSubtypeList(schema, source)) {
573 String prev = field.getAttributeValue(TypeDescription.MASK_ATTRIBUTE);
574 if (prev != null && !prev.equals(maskString)) {
575 throw new IllegalArgumentException("Conflicting encryption masks " +
576 maskString + " and " + prev);
577 }
578 field.setAttribute(TypeDescription.MASK_ATTRIBUTE, maskString);
579 }
580 } while (consumeChar(source, ';'));
581 }
582 }
583
584 public static MaskDescriptionImpl buildMaskDescription(String value) {
585 StringPosition source = new StringPosition(value);

Callers 1

annotateEncryptionMethod · 0.95

Calls 9

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

Tested by

no test coverage detected