Package org.hivedb

Examples of org.hivedb.HiveRuntimeException


    JdbcTemplate t = getJdbcTemplate();
    ArrayList<PartitionDimension> results =
      (ArrayList<PartitionDimension>) t.query("SELECT * FROM partition_dimension_metadata", new PartitionDimensionRowMapper());

    if (results.size() == 0)
      throw new HiveRuntimeException("No PartitionDimension found.");
    else if (results.size() > 1)
      throw new HiveRuntimeException(String.format("Found %s PartitionDImensions, there can be only one.", results.size()));
    PartitionDimension dimension = results.get(0);
    return dimension;
  }
View Full Code Here


      "UPDATE partition_dimension_metadata set name=?,index_uri=?,db_type=? where id=?",
      new int[]{Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.INTEGER});
    int rows = j.update(creatorFactory
      .newPreparedStatementCreator(parameters));
    if (rows != 1)
      throw new HiveRuntimeException("Unable to update Partition Dimension for id: " + partitionDimension.getId());
    // dependencies
    for (Resource r : partitionDimension.getResources())
      new ResourceDao(getDataSource()).update(r);
  }
View Full Code Here

    PreparedStatementCreatorFactory creatorFactory = new PreparedStatementCreatorFactory(
      "DELETE from partition_dimension_metadata where id=?",
      new int[]{Types.INTEGER});
    int rows = j.update(creatorFactory.newPreparedStatementCreator(parameters));
    if (rows != 1)
      throw new HiveRuntimeException("Unable to delete Partition Dimension for id: " + partitionDimension.getId());
  }
View Full Code Here

                  new RuntimeException(e);
                }
              else if (instance instanceof PropertyAccessor)
                  ((PropertyAccessor)instance).set(propertyName, value);
              else
                throw new HiveRuntimeException(String.format("No way to inoke setter of class %s, property %s", instance.getClass(), propertyName));
            }

            public Method getRealSetter() {
              try {
                return clazz.getMethod(makeSetterName(propertyName), new Class[] {method.getReturnType()});
View Full Code Here

          + ex.getMessage());
    } catch (RuntimeException re) {
      String url = (getJdbcTemplate().getDataSource() instanceof HiveBasicDataSource)
        ? ((HiveBasicDataSource) getJdbcTemplate().getDataSource()).getUrl()
        : ((HiveBasicDataSource) ((LazyConnectionDataSourceProxy) getJdbcTemplate().getDataSource()).getTargetDataSource()).getUrl();
      throw new HiveRuntimeException(String.format("Error connecting to the hive database %s", url), re);
    }
    return result;
  }
View Full Code Here

    case Types.TIMESTAMP:
      return TIMESTAMP;
    case Types.VARCHAR:
      return VARCHAR;
    }
    throw new HiveRuntimeException("No known JDBC type: " + jdbcType, null);
  }
View Full Code Here

      return Types.TIMESTAMP;
    if (TINYINT.equals(upperDbString))
      return Types.TINYINT;
    if (VARCHAR.equals(upperDbString))
      return Types.VARCHAR;
    throw new HiveRuntimeException("No known JDBC type: " + upperDbString);
  }
View Full Code Here

      return Types.DATE;
    if (classType.equals(Timestamp.class))
      return Types.TIMESTAMP;
    if (classType.equals(char.class) || classType.equals(Character.class))
      return Types.CHAR;
    throw new HiveRuntimeException("No known database type for class "
        + classType.getCanonicalName(), null);
  }
View Full Code Here

      return Date.class;
    if (jdbcType.equals(Types.TIMESTAMP))
      return Timestamp.class;
    if (jdbcType.equals(Types.CHAR))
      return Character.class;
    throw new HiveRuntimeException("No known database type for class " + jdbcType);
  }
View Full Code Here

      preparedStatement.setString(index, value.toString());
    else if (classType.equals(boolean.class)
        || classType.equals(Boolean.class))
      preparedStatement.setBoolean(index, (Boolean) value);
    else
      throw new HiveRuntimeException("No known database type for class "
          + classType.getCanonicalName(), null);
  }
View Full Code Here

TOP

Related Classes of org.hivedb.HiveRuntimeException

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.