use of com.xiaomi.linden.thrift.common.LindenSortType in project linden by XiaoMi.
the class BQLCompilerAnalyzer method exitSort_spec.
@Override
public void exitSort_spec(BQLParser.Sort_specContext ctx) {
LindenSortField sortField;
if (ctx.DISTANCE() != null) {
sortField = new LindenSortField().setName("").setType(LindenSortType.DISTANCE);
} else if (ctx.SCORE() != null) {
sortField = new LindenSortField().setName("").setType(LindenSortType.SCORE);
} else {
String col = unescapeColumnName(ctx.column_name());
Map.Entry<String, LindenType> fieldNameAndType = getFieldNameAndType(col);
LindenType type = fieldNameAndType.getValue();
col = fieldNameAndType.getKey();
LindenSortType sortType = LindenSortType.findByValue(type.getValue());
sortField = new LindenSortField().setName(col).setType(sortType).setReverse(true);
}
if (ctx.ASC() != null) {
sortField.setReverse(false);
} else if (ctx.DESC() != null) {
sortField.setReverse(true);
}
valProperty.put(ctx, sortField);
}
Aggregations