static Query convertToLuceneNumericRangeQuery(QueryTask.Query query) { QueryTask.QueryTerm term = query.term; term.range.validate(); if (term.range.type == ServiceDocumentDescription.TypeName.LONG) { return createLongRangeQuery(term.propertyName, term.range); } else if (term.range.type == ServiceDocumentDescription.TypeName.DOUBLE) { return createDoubleRangeQuery(term.propertyName, term.range); } else if (term.range.type == ServiceDocumentDescription.TypeName.DATE) { // Date specifications must be in microseconds since epoch return createLongRangeQuery(term.propertyName, term.range); } else { throw new IllegalArgumentException("Type is not supported:" + term.range.type); } }
private static String convertToSqlNumericRangeQuery(QueryTask.Query query, ColumnDescription cd) { QueryTask.QueryTerm term = query.term; term.range.validate(); String condition; if (term.range.type == ServiceDocumentDescription.TypeName.LONG) { condition = createLongRangeQuery(term.propertyName, term.range, cd); } else if (term.range.type == ServiceDocumentDescription.TypeName.DOUBLE) { condition = createDoubleRangeQuery(term.propertyName, term.range, cd); } else if (term.range.type == ServiceDocumentDescription.TypeName.DATE) { // Date specifications must be in microseconds since epoch condition = createLongRangeQuery(term.propertyName, term.range, cd); } else { throw new IllegalArgumentException("Type is not supported:" + term.range.type); } return condition; }