Package com.alibaba.wasp.plan.parser

Examples of com.alibaba.wasp.plan.parser.UnsupportedException


      } else if (type == DataType.INT64) {
        return Bytes.toBytes(number.longValue());
      }
      return Bytes.toBytes((BigDecimal) number);
    } else if (number instanceof BigInteger) {
      throw new UnsupportedException(" BigInteger " + number + " Unsupported");
    } else if (number instanceof Byte) {
      return Bytes.toBytes((Byte) number);
    } else if (number instanceof Double) {
      double value = number.doubleValue();
      if (type == DataType.FLOAT) {
        return Bytes.toBytes((float) value);
      } else if (type == DataType.DOUBLE) {
        return Bytes.toBytes(value);
      } else if (type == DataType.INT32) {
        int iv = (int) value;
        return Bytes.toBytes(iv);
      } else if (type == DataType.INT64) {
        long lv = (long) value;
        return Bytes.toBytes(lv);
      }
    } else if (number instanceof Float) {
      float value = number.floatValue();
      if (type == DataType.FLOAT) {
        return Bytes.toBytes(value);
      } else if (type == DataType.DOUBLE) {
        return Bytes.toBytes((float) value);
      } else if (type == DataType.INT32) {
        int iv = (int) value;
        return Bytes.toBytes(iv);
      } else if (type == DataType.INT64) {
        long lv = (long) value;
        return Bytes.toBytes(lv);
      }
    } else if (number instanceof Integer) {
      int value = number.intValue();
      if (type == DataType.INT32) {
        return Bytes.toBytes((Integer) value);
      } else if (type == DataType.INT64) {
        return Bytes.toBytes((long) value);
      } else if (type == DataType.FLOAT) {
        float fv = (float) value;
        return Bytes.toBytes(fv);
      } else if (type == DataType.DOUBLE) {
        double fv = (double) value;
        return Bytes.toBytes(fv);
      }
    } else if (number instanceof Long) {
      long value = number.longValue();
      if (type == DataType.INT32) {
        return Bytes.toBytes((int) value);
      } else if (type == DataType.INT64) {
        return Bytes.toBytes(value);
      } else if (type == DataType.FLOAT) {
        float fv = (float) value;
        return Bytes.toBytes(fv);
      } else if (type == DataType.DOUBLE) {
        double fv = (double) value;
        return Bytes.toBytes(fv);
      }
    } else if (number instanceof Short) {
      return Bytes.toBytes((Short) number);
    }
    throw new UnsupportedException("Unknown Number:" + number + " Type:" + type
        + " Unsupported ");
  }
View Full Code Here


    String methodName = expr.getMethodName();
    if (methodName.equalsIgnoreCase("NOW")) { // Date Function 'NOW()'
      if (type == DataType.DATETIME) { // Type must be DATETIME
        return Bytes.toBytes(EnvironmentEdgeManager.currentTimeMillis());
      } else {
        throw new UnsupportedException(" DataType " + type + " not support " + " Function "
            + methodName);
      }
    } else {
      throw new UnsupportedException(" Functions " + methodName + " Unsupported");
    }
  }
View Full Code Here

      isDDL = false;
    } else if (stmt instanceof SQLDeleteStatement) {
      // This is a Delete SQL
      isDDL = false;
    } else {
      throw new UnsupportedException("Unsupported SQLStatement " + SQLUtils.toSQLString(stmt));
    }
    if(isDDL) {
      return SQLType.DDL;
    } else if (isDQL) {
      return SQLType.DQL;
View Full Code Here

          ranges.put(value.getFieldName(), value);
        } else {
          value.resetValue(binaryOpExpr.getRight(), operator);
        }
      } else {
        throw new UnsupportedException("where clause '" + where + " has '"
            + operator + "' , current this is Unsupported");
      }
    } else {
      throw new UnsupportedException("where clause '" + where + "' Unsupported");
    }
  }
View Full Code Here

            parseByte(index, isDesc, right, rangeCondition.getFieldName(), rangeCondition.getRightOperator())));
      } else {
        pair.setSecond(prefixKey.length == 0 ? HConstants.EMPTY_END_ROW : Bytes.add(prefixKey, FConstants.DATA_ROW_SEP_QUERY));
      }
    } catch (ParseException e) {
      throw new UnsupportedException(e.getMessage(), e);
    }
    // if desc the startkey and stop key will be swap
    if (isDesc) {
      return Pair.newPair(pair.getSecond(), pair.getFirst());
    }
View Full Code Here

TOP

Related Classes of com.alibaba.wasp.plan.parser.UnsupportedException

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.