Package org.apache.hadoop.hive.ql.optimizer.optiq

Examples of org.apache.hadoop.hive.ql.optimizer.optiq.OptiqSemanticException


              colInfo.getIsVirtualCol(), colInfo.isHiddenVirtualCol());
          inputColsProcessed.put(colInfo, oColInfo);
        }
        if (ensureUniqueCols) {
          if (!output.putWithCheck(tmp[0], tmp[1], null, oColInfo)) {
            throw new OptiqSemanticException("Cannot add column to RR: " + tmp[0] + "." + tmp[1]
                + " => " + oColInfo + " due to duplication, see previous warnings");
          }
        } else {
          output.put(tmp[0], tmp[1], oColInfo);
        }
View Full Code Here


    }
    ImmutableMap<Integer, RexNode> inputRefToCallMap = inputRefToCallMapBldr.build();

    if ((obChild.getRowType().getFieldCount() - inputRefToCallMap.size()) != resultSchema.size()) {
      LOG.error(generateInvalidSchemaMessage(obChild, resultSchema, inputRefToCallMap.size()));
      throw new OptiqSemanticException("Result Schema didn't match Optimized Op Tree Schema");
    }
    // This removes order-by only expressions from the projections.
    HiveProjectRel replacementProjectRel = HiveProjectRel.create(obChild.getChild(), obChild
        .getChildExps().subList(0, resultSchema.size()), obChild.getRowType().getFieldNames()
        .subList(0, resultSchema.size()));
View Full Code Here

    // (limit)?(OB)?(ProjectRelBase)....
    List<RexNode> rootChildExps = originalProjRel.getChildExps();
    if (resultSchema.size() != rootChildExps.size()) {
      // Safeguard against potential issues in CBO RowResolver construction. Disable CBO for now.
      LOG.error(generateInvalidSchemaMessage(originalProjRel, resultSchema, 0));
      throw new OptiqSemanticException("Result Schema didn't match Optimized Op Tree Schema");
    }

    List<String> newSelAliases = new ArrayList<String>();
    String colAlias;
    for (int i = 0; i < rootChildExps.size(); i++) {
View Full Code Here

    RelOptCluster cluster = child.getCluster();

    // 1 Ensure columnNames are unique - OPTIQ-411
    if (fieldNames != null && !Util.isDistinct(fieldNames)) {
      String msg = "Select list contains multiple expressions with the same name." + fieldNames;
      throw new OptiqSemanticException(msg);
    }
    RelDataType rowType = RexUtil.createStructType(cluster.getTypeFactory(), exps, fieldNames);
    return create(cluster, child, exps, rowType, Collections.<RelCollation> emptyList());
  }
View Full Code Here

    if (hiveUdfName != null && hiveUdfName.trim().equals("<=>")) {
      // We can create Optiq IS_DISTINCT_FROM operator for this. But since our
      // join reordering algo cant handle this anyway there is no advantage of
      // this.
      // So, bail out for now.
      throw new OptiqSemanticException("<=> is not yet supported for cbo.");
    }
    SqlOperator optiqOp = hiveToOptiq.get(hiveUdfName);
    if (optiqOp == null) {
      OptiqUDFInfo uInf = getUDFInfo(hiveUdfName, optiqArgTypes, optiqRetType);
      optiqOp = new SqlFunction(uInf.udfName, SqlKind.OTHER_FUNCTION, uInf.returnTypeInference,
View Full Code Here

  }

  public static RelDataType convert(UnionTypeInfo unionType, RelDataTypeFactory dtFactory)
    throws OptiqSemanticException{
    // Union type is not supported in Optiq.
    throw new OptiqSemanticException("Union type is not supported");
  }
View Full Code Here

      // regular case of accessing nested field in a column
      return cluster.getRexBuilder().makeFieldAccess(rexNode, fieldDesc.getFieldName(), true);
    } else {
      // This may happen for schema-less tables, where columns are dynamically
      // supplied by serdes.
      throw new OptiqSemanticException("Unexpected rexnode : "
          + rexNode.getClass().getCanonicalName());
    }
  }
View Full Code Here

        // type in AST causes
        // the plan generation to fail after CBO, probably due to some residual
        // state in SA/QB.
        // For now, we will not run CBO in the presence of invalid decimal
        // literals.
        throw new OptiqSemanticException("Expression " + literal.getExprString()
            + " is not a valid decimal");
        // TODO: return createNullLiteral(literal);
      }
      BigDecimal bd = (BigDecimal) value;
      BigInteger unscaled = bd.unscaledValue();
View Full Code Here

          throw new SemanticException(generateErrorMessage(tabref,
              "Schema of both sides of union should match. " + leftalias
                  + " does not have the field " + field));
        }
        if (!lInfo.getInternalName().equals(rInfo.getInternalName())) {
          throw new OptiqSemanticException(generateErrorMessage(tabref,
              "Schema of both sides of union should match: field " + field + ":"
                  + " appears on the left side of the UNION at column position: "
                  + getPositionFromInternalName(lInfo.getInternalName())
                  + ", and on the right side of the UNION at column position: "
                  + getPositionFromInternalName(rInfo.getInternalName())
                  + ". Column positions should match for a UNION"));
        }
        // try widening coversion, otherwise fail union
        TypeInfo commonTypeInfo = FunctionRegistry.getCommonClassForUnionAll(lInfo.getType(),
            rInfo.getType());
        if (commonTypeInfo == null) {
          throw new OptiqSemanticException(generateErrorMessage(tabref,
              "Schema of both sides of union should match: Column " + field + " is of type "
                  + lInfo.getType().getTypeName() + " on first table and type "
                  + rInfo.getType().getTypeName() + " on second table"));
        }
      }
View Full Code Here

      if (joinParseTree.getToken().getType() == HiveParser.TOK_UNIQUEJOIN) {
        String msg = String.format("UNIQUE JOIN is currently not supported in CBO,"
            + " turn off cbo to use UNIQUE JOIN.");
        LOG.debug(msg);
        throw new OptiqSemanticException(msg);
      }

      // 1. Determine Join Type
      // TODO: What about TOK_CROSSJOIN, TOK_MAPJOIN
      switch (joinParseTree.getToken().getType()) {
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.ql.optimizer.optiq.OptiqSemanticException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.