/** * Initialize an ObjectReader. * * @return an initialized ObjectReader */ protected static ObjectReader initDefault() { return init(CsvSchema.emptySchema()); }
/** * Extracts the values to be used in the JobRowFilter query from the query. * * @param tokenizedQuery The tokenized filter expression.. * @param filterQuery The raw query. Used for logging. * * @return The set of values to be used in the JobRowFilter query. * @throws BadFilterException If the fragment of the query that specifies the values is malformed. */ private Set<String> extractValues(Matcher tokenizedQuery, String filterQuery) throws BadFilterException { try { // replaceAll takes care of any leading ['s or trailing ]'s which might mess up the values set. return new LinkedHashSet<>( FilterTokenizer.split( tokenizedQuery.group(3) .replaceAll("\\[", "") .replaceAll("\\]", "") .trim() ) ); } catch (IllegalArgumentException e) { LOG.debug(FILTER_ERROR.logFormat(filterQuery, e.getMessage()), e); throw new BadFilterException(FILTER_ERROR.format(filterQuery, e.getMessage()), e); } }
/** * Given a string representing a set of values to be used in the having query, turns the string into a set. * * @param query The tokenized having query. * @param havingQuery The raw query. Used for logging. * * @return A set of strings representing the values to be used in the having query. * @throws BadHavingException If the string of values is malformed. */ private List<String> createValueList(Matcher query, String havingQuery) throws BadHavingException { try { // replaceAll takes care of any leading ['s or trailing ]'s which might mess up the values set. return new LinkedList<>( FilterTokenizer.split( query.group(3) .replaceAll("\\[", "") .replaceAll("\\]", "") .trim() ) ); } catch (IllegalArgumentException e) { LOG.debug(HAVING_ERROR.logFormat(havingQuery, e.getMessage()), e); throw new BadHavingException(HAVING_ERROR.format(havingQuery, e.getMessage()), e); } }
FilterTokenizer.split( matcher.group(4) .replaceAll("\\[", "")
/** * Initialize an ObjectReader that does not quote things. * * @return an initialized ObjectReader */ protected static ObjectReader initRaw() { return init(CsvSchema.emptySchema().withoutQuoteChar()); }