Package org.apache.hadoop.hive.metastore.model

Examples of org.apache.hadoop.hive.metastore.model.MTable


     String colName = mStatsObj.getColName();

     LOG.info("Updating table level column statistics for db=" + dbName + " tableName=" + tableName
       + " colName=" + colName);

     MTable mTable = getMTable(mStatsObj.getDbName(), mStatsObj.getTableName());
     boolean foundCol = false;

     if (mTable == null) {
        throw new
          NoSuchObjectException("Table " + tableName +
          " for which stats gathering is requested doesn't exist.");
      }

      MStorageDescriptor mSDS = mTable.getSd();
      List<MFieldSchema> colList = mSDS.getCD().getCols();

      for(MFieldSchema mCol:colList) {
        if (mCol.getName().equals(mStatsObj.getColName().trim())) {
          foundCol = true;
View Full Code Here


    String colName = mStatsObj.getColName();

    LOG.info("Updating partition level column statistics for db=" + dbName + " tableName=" +
      tableName + " partName=" + partName + " colName=" + colName);

    MTable mTable = getMTable(mStatsObj.getDbName(), mStatsObj.getTableName());
    boolean foundCol = false;

    if (mTable == null) {
      throw new
        NoSuchObjectException("Table " + tableName +
View Full Code Here

    }

    try {
      openTransaction();
      MTableColumnStatistics mStatsObj = null;
      MTable mTable = getMTable(dbName.trim(), tableName.trim());
      boolean foundCol = false;

      if (mTable == null) {
        throw new NoSuchObjectException("Table " + tableName +
        " for which stats is requested doesn't exist.");
      }

      MStorageDescriptor mSDS = mTable.getSd();
      List<MFieldSchema> colList = mSDS.getCD().getCols();

      for(MFieldSchema mCol:colList) {
        if (mCol.getName().equals(colName.trim())) {
          foundCol = true;
View Full Code Here

        " get_partition_column_statistics is null");
    }

    try {
      openTransaction();
      MTable mTable = getMTable(dbName.trim(), tableName.trim());
      boolean foundCol = false;

      if (mTable == null) {
        throw new NoSuchObjectException("Table "  + tableName +
          " for which stats is requested doesn't exist.");
View Full Code Here

      throw new InvalidInputException("Table name is null.");
    }

    try {
      openTransaction();
      MTable mTable = getMTable(dbName, tableName);
      MPartitionColumnStatistics mStatsObj;
      List<MPartitionColumnStatistics> mStatsObjColl;

      if (mTable == null) {
        throw new
View Full Code Here

      throw new InvalidInputException("Table name is null.");
    }

    try {
      openTransaction();
      MTable mTable = getMTable(dbName, tableName);
      MTableColumnStatistics mStatsObj;
        List<MTableColumnStatistics> mStatsObjColl;

      if (mTable == null) {
        throw new
View Full Code Here

    boolean commited = false;
    try {
      openTransaction();
      dbName = dbName.toLowerCase().trim();
      tableName = tableName.toLowerCase().trim();
      MTable mtbl = getMTable(dbName, tableName);
      if (mtbl == null) {
        commited = commitTransaction();
        return null;
      }
      // Change the query to use part_vals instead of the name which is
      // redundant
      String name = Warehouse.makePartName(convertToFieldSchemas(mtbl
          .getPartitionKeys()), part_vals);
      Query query = pm.newQuery(MPartition.class,
          "table.tableName == t1 && table.database.name == t2 && partitionName == t3");
      query.declareParameters("java.lang.String t1, java.lang.String t2, java.lang.String t3");
      query.setUnique(true);
View Full Code Here

  private MPartition convertToMPart(Partition part)
      throws InvalidObjectException, MetaException {
    if (part == null) {
      return null;
    }
    MTable mt = getMTable(part.getDbName(), part.getTableName());
    if (mt == null) {
      throw new InvalidObjectException(
          "Partition doesn't have a valid table or database name");
    }
    return new MPartition(Warehouse.makePartName(convertToFieldSchemas(mt
        .getPartitionKeys()), part.getValues()), mt, part.getValues(), part
        .getCreateTime(), part.getLastAccessTime(),
        convertToMStorageDescriptor(part.getSd()), part.getParameters());
  }
View Full Code Here

      openTransaction();
      List<MPartition> mparts = listMPartitions(dbName, tblName, maxParts);
      List<Partition> parts = new ArrayList<Partition>(mparts.size());
      if (mparts != null && mparts.size()>0) {
        for (MPartition mpart : mparts) {
          MTable mtbl = mpart.getTable();
          Partition part = convertToPart(mpart);
          parts.add(part);

          if ("TRUE".equalsIgnoreCase(mtbl.getParameters().get("PARTITION_LEVEL_PRIVILEGE"))) {
            String partName = Warehouse.makePartName(this.convertToFieldSchemas(mtbl
                .getPartitionKeys()), part.getValues());
            PrincipalPrivilegeSet partAuth = this.getPartitionPrivilegeSet(dbName,
                tblName, partName, userName, groupNames);
            part.setPrivileges(partAuth);
          }
View Full Code Here

        commitTransaction();
        throw new NoSuchObjectException("partition values="
            + partVals.toString());
      }
      Partition part = null;
      MTable mtbl = mpart.getTable();
      part = convertToPart(mpart);
      if ("TRUE".equalsIgnoreCase(mtbl.getParameters().get("PARTITION_LEVEL_PRIVILEGE"))) {
        String partName = Warehouse.makePartName(this.convertToFieldSchemas(mtbl
            .getPartitionKeys()), partVals);
        PrincipalPrivilegeSet partAuth = this.getPartitionPrivilegeSet(dbName,
            tblName, partName, user_name, group_names);
        part.setPrivileges(partAuth);
      }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.metastore.model.MTable

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.