connectionUtils/src/main/java/com/ge/research/semtk/resultSet/Table.java
public void append(Table other) throws Exception {
		String [] myCols = Arrays.copyOf(this.getColumnNames(), Math.toIntExact(this.getNumColumns()));
		String [] otherCols = Arrays.copyOf(other.getColumnNames(), Math.toIntExact(other.getNumColumns()));
		Arrays.sort(myCols);
		Arrays.sort(otherCols);
		if (! Arrays.equals(myCols, otherCols)) {
			throw new Exception("Can not append tables with different columns.\nExpected: " + String.join(",", myCols) + "\nFound: " + String.join(",", otherCols));
		}
		
		// build   map(myCol) = otherCol
		ArrayList<Integer> map = new ArrayList<Integer>();
		for (int i=0; i < this.getNumColumns(); i++) {
			map.add(i, other.getColumnIndex(this.getColumnNames()[i]));
		}
		
		// loop through other rows
		for (int i=0; i < other.getNumRows(); i++) {
			ArrayList<String> rawRow = other.getRow(i);
			ArrayList<String> newRow = new ArrayList<String>();
			
			// swap column order as defined by map
			for (int j=0; j < other.getNumColumns(); j++) {
				newRow.add(rawRow.get(map.get(j)));
			}
			
			this.addRow(newRow);
		}
		
	}
/**
	 * Join with another table with identical column names
	 * @param other
	 * @throws Exception
	 */
Join with another table with identical column names
@param other
@throws Exception
Join with another table with identical column names @param other @throws Exception
public void append(Table other) throws Exception {
		String [] myCols = Arrays.copyOf(this.getColumnNames(), Math.toIntExact(this.getNumColumns()));
		String [] otherCols = Arrays.copyOf(other.getColumnNames(), Math.toIntExact(other.getNumColumns()));
		Arrays.sort(myCols);
		Arrays.sort(otherCols);
		if (! Arrays.equals(myCols, otherCols)) {
			throw new Exception("Can not append tables with different columns.\nExpected: " + String.join(",", myCols) + "\nFound: " + String.join(",", otherCols));
		}
		ArrayList<Integer> map = new ArrayList<Integer>();
		for (int i=0; i < this.getNumColumns(); i++) {
			map.add(i, other.getColumnIndex(this.getColumnNames()[i]));
		}
		for (int i=0; i < other.getNumRows(); i++) {
			ArrayList<String> rawRow = other.getRow(i);
			ArrayList<String> newRow = new ArrayList<String>();
			for (int j=0; j < other.getNumColumns(); j++) {
				newRow.add(rawRow.get(map.get(j)));
			}
			this.addRow(newRow);
		}
	}
public void append ( Table other ) throws Exception { String [ ] myCols = Arrays . copyOf ( this . getColumnNames ( ) , Math . toIntExact ( this . getNumColumns ( ) ) ) ; String [ ] otherCols = Arrays . copyOf ( other . getColumnNames ( ) , Math . toIntExact ( other . getNumColumns ( ) ) ) ; Arrays . sort ( myCols ) ; Arrays . sort ( otherCols ) ; if ( ! Arrays . equals ( myCols , otherCols ) ) { throw new Exception ( "Can not append tables with different columns.\nExpected: " + String . join ( "," , myCols ) + "\nFound: " + String . join ( "," , otherCols ) ) ; } ArrayList < Integer > map = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < this . getNumColumns ( ) ; i ++ ) { map . add ( i , other . getColumnIndex ( this . getColumnNames ( ) [ i ] ) ) ; } for ( int i = 0 ; i < other . getNumRows ( ) ; i ++ ) { ArrayList < String > rawRow = other . getRow ( i ) ; ArrayList < String > newRow = new ArrayList < String > ( ) ; for ( int j = 0 ; j < other . getNumColumns ( ) ; j ++ ) { newRow . add ( rawRow . get ( map . get ( j ) ) ) ; } this . addRow ( newRow ) ; } }
Join with another table with identical column names
 @param other
 @throws Exception
Join with another table with identical column names @param other @throws Exception
// build   map(myCol) = otherCol // loop through other rows // swap column order as defined by map