BQLCompilerAnalyzer.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:linden 作者:
@Override
public void exitAggregation_spec(BQLParser.Aggregation_specContext ctx) {
  String col = unescapeColumnName(ctx.column_name());
  Map.Entry<String, LindenType> fieldNameAndType = getFieldNameAndType(col);
  LindenType type = fieldNameAndType.getValue();
  if (type != LindenType.INTEGER && type != LindenType.LONG && type != LindenType.DOUBLE) {
    throw new ParseCancellationException(new SemanticException(ctx.column_name(),
                                                               "Aggregation doesn't support the type of the field \""
                                                               + col + "\"."));
  }
  col = fieldNameAndType.getKey();

  Aggregation aggregation = new Aggregation();
  aggregation.setField(col);
  aggregation.setType(type);
  for (BQLParser.Bucket_specContext specContext : ctx.bucket_spec()) {
    Bucket bucket = (Bucket) valProperty.get(specContext);
    if (bucket != null) {
      aggregation.addToBuckets(bucket);
    }
  }
  facetRequest.addToAggregations(aggregation);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号