@Override public void initialize(Arguments args) throws DirectiveParseException { this.col = ((ColumnName) args.value("source")).value(); this.start = ((Numeric) args.value("start")).value().intValue(); this.end = ((Numeric) args.value("end")).value().intValue(); this.dest = ((ColumnName) args.value("destination")).value(); this.start = this.start - 1; this.end = this.end - 1; }
@Override public void initialize(Arguments args) throws DirectiveParseException { this.col = ((ColumnName) args.value("column")).value(); List<LazyNumber> numbers = ((NumericList) args.value("width")).value(); this.widths = new int[numbers.size()]; int idx = 0; int sum = 0; while (idx < numbers.size()) { this.widths[idx] = numbers.get(idx).intValue(); sum += this.widths[idx]; idx = idx + 1; } this.recordLength = sum; if(args.contains("padding")) { this.padding = ((Text) args.value("padding")).value(); } else { this.padding = null; } }
@Override public void initialize(Arguments args) throws DirectiveParseException { this.col = ((ColumnName) args.value("column")).value(); if (args.contains("depth")) { this.depth = ((Numeric) args.value("depth")).value().intValue(); } else { this.depth = Integer.MAX_VALUE; } }
@Override public void initialize(Arguments args) throws DirectiveParseException { this.column = ((ColumnName) args.value("column")).value(); if (args.contains("depth")) { this.depth = ((Numeric) args.value("depth")).value().intValue(); } else { this.depth = Integer.MAX_VALUE; } }
@Override public void initialize(Arguments args) throws DirectiveParseException { this.column = ((ColumnName) args.value("column")).value(); this.schemaId = ((Identifier) args.value("schema-id")).value(); this.type = ((Identifier) args.value("encode-type")).value(); if (!"json".equalsIgnoreCase(type) && !"binary".equalsIgnoreCase(type)) { throw new DirectiveParseException( String.format("Parsing AVRO can be either of type 'json' or 'binary'") ); } if(args.contains("version")) { this.version = ((Numeric) args.value("version")).value().intValue(); } else { this.version = -1; } }
@Override public void initialize(Arguments args) throws DirectiveParseException { column = ((ColumnName) args.value("column")).value(); delimiter = ((Text) args.value("delimiter")).value(); if (args.contains("limit")) { Numeric numeric = args.value("limit"); limit = numeric.value().intValue(); } else { limit = Integer.MAX_VALUE; } }
@Override public void initialize(Arguments args) throws DirectiveParseException { this.column = ((ColumnName) args.value("column")).value(); this.schemaId = ((Identifier) args.value("schema-id")).value(); this.recordName = ((Text) args.value("record-name")).value(); if(args.contains("version")) { this.version = ((Numeric) args.value("version")).value().intValue(); } else { this.version = -1; } }
@Override public void initialize(Arguments args) throws DirectiveParseException { this.column = ((ColumnName) args.value("column")).value(); if (args.contains("depth")) { this.depth = ((Numeric) args.value("depth")).value().intValue(); } else { this.depth = Integer.MAX_VALUE; } context = new DefaultHapiContext(); context.setValidationContext(new NoValidation()); ModelClassFactory modelClassFactory = new GenericModelClassFactory(); parser = new PipeParser(modelClassFactory); parser.getParserConfiguration().setAllowUnknownVersions(true); }