示例#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());
 }