use of water.parser.ParserInfo in project h2o-3 by h2oai.
the class ParseSetupV3 method fillImpl.
@Override
public ParseSetup fillImpl(ParseSetup impl) {
ParseSetup parseSetup = fillImpl(impl, new String[] { "parse_type" });
// Transform the field parse_type
ParserInfo pi = GUESS_INFO;
if (this.parse_type != null) {
ParserProvider pp = ParserService.INSTANCE.getByName(this.parse_type);
if (pp != null) {
pi = pp.info();
} else
throw new H2OIllegalValueException("Cannot find right parser for specified parser type!", this.parse_type);
}
parseSetup.setParseType(pi);
return parseSetup;
}
use of water.parser.ParserInfo in project h2o-3 by h2oai.
the class ParseHandler method parse.
// Entry point for parsing.
// called through reflection by RequestServer
@SuppressWarnings("unused")
public ParseV3 parse(int version, ParseV3 parse) {
ParserInfo parserInfo = ParserService.INSTANCE.getByName(parse.parse_type).info();
ParseSetup setup = new ParseSetup(parserInfo, parse.separator, parse.single_quotes, parse.check_header, parse.number_columns, delNulls(parse.column_names), ParseSetup.strToColumnTypes(parse.column_types), parse.domains, parse.na_strings, null, new ParseWriter.ParseErr[0], parse.chunk_size);
if (parse.source_frames == null)
throw new H2OIllegalArgumentException("Data for Frame '" + parse.destination_frame.name + "' is not available. Please check that the path is valid (for all H2O nodes).'");
Key[] srcs = new Key[parse.source_frames.length];
for (int i = 0; i < parse.source_frames.length; i++) srcs[i] = parse.source_frames[i].key();
parse.job = new JobV3(ParseDataset.parse(parse.destination_frame.key(), srcs, parse.delete_on_done, setup, parse.blocking)._job);
if (parse.blocking) {
Frame fr = DKV.getGet(parse.destination_frame.key());
parse.rows = fr.numRows();
}
return parse;
}
Aggregations