예제 #1
0
파일: RexUtil.java 프로젝트: kunlqt/optiq
 protected RexNode register(RexNode expr) {
   final String key = expr.toString();
   final RexNode previous = mapDigestToExpr.put(key, expr);
   if (!allowDups && (previous != null)) {
     throw new SubExprExistsException(expr);
   }
   return expr;
 }
예제 #2
0
파일: RexUtil.java 프로젝트: kunlqt/optiq
 /**
  * Creates a key for {@link RexNode} which is the same as another key of another RexNode only if
  * the two have both the same type and textual representation. For example, "10" integer and "10"
  * bigint result in different keys.
  */
 public static String makeKey(RexNode expr) {
   String type = expr.getType().getFullTypeString();
   String separator = ";";
   String node = expr.toString();
   StringBuilder keyBuilder =
       new StringBuilder(type.length() + separator.length() + node.length());
   keyBuilder.append(type).append(separator).append(node);
   return keyBuilder.toString();
 }
예제 #3
0
파일: RexUtil.java 프로젝트: kunlqt/optiq
 protected RexNode lookup(RexNode expr) {
   return mapDigestToExpr.get(expr.toString());
 }