public static Object partitionValueFromInvocation(Table catTable, VoltTable table) throws Exception {
        if (catTable.getIsreplicated()) {
            throw new Exception("Target table for LoadSinglepartitionTable is replicated.");
        }

        // check the number of columns
        int colCount = catTable.getColumns().size();
        if (table.getColumnCount() != colCount) {
            throw new Exception("Input table has the wrong number of columns for bulk insert.");
        }

        // note there's no type checking

        // get the partitioning info from the catalog
        Column pCol = catTable.getPartitioncolumn();
        int pIndex = pCol.getIndex();

        // make sure the table has one row and move to it
        table.resetRowPosition();
        boolean hasRow = table.advanceRow();
        if (!hasRow) {
            // table has no rows, so it can partition any which way
            return 0;
        }

        // get the value from the first row of the table at the partition key
        Object pvalue = table.get(pIndex, table.getColumnType(pIndex));
        return pvalue;
    }
public static Object partitionValueFromInvocation ( Table catTable , VoltTable table ) throws Exception { if ( catTable . getIsreplicated ( ) ) { throw new Exception ( "Target table for LoadSinglepartitionTable is replicated." ) ; } int colCount = catTable . getColumns ( ) . size ( ) ; if ( table . getColumnCount ( ) != colCount ) { throw new Exception ( "Input table has the wrong number of columns for bulk insert." ) ; } Column pCol = catTable . getPartitioncolumn ( ) ; int pIndex = pCol . getIndex ( ) ; table . resetRowPosition ( ) ; boolean hasRow = table . advanceRow ( ) ; if ( ! hasRow ) { return 0 ; } Object pvalue = table . get ( pIndex , table . getColumnType ( pIndex ) ) ; return pvalue ; }
Note: I (JHH) can't figure out what uses this code. It may be dead.

Called by the client interface to partition this invocation based on parameters.

@param tables The set of active tables in the catalog.
@param spi The stored procedure invocation object
@return An object suitable for hashing to a partition with The Hashinator
@throws Exception thown on error with a descriptive message