connectionUtils/src/main/java/com/ge/research/semtk/resultSet/Table.java
public void toSubTable(String[] colNames) throws Exception {
		for (String colName : colNames) {
			if (!this.hasColumn(colName)) {
				throw new Exception("Column doesn't exist in table: " + colName);
			}
		}
		for(String existingColName : this.columnNames){
			if(!Arrays.asList(colNames).contains(existingColName)){
				this.removeColumn(existingColName);
			}
		}
	}
/**
	 * Remove all columns except the given ones
	 */
Remove all columns except the given ones
Remove all columns except the given ones
public void toSubTable(String[] colNames) throws Exception {
		for (String colName : colNames) {
			if (!this.hasColumn(colName)) {
				throw new Exception("Column doesn't exist in table: " + colName);
			}
		}
		for(String existingColName : this.columnNames){
			if(!Arrays.asList(colNames).contains(existingColName)){
				this.removeColumn(existingColName);
			}
		}
	}
public void toSubTable ( String [ ] colNames ) throws Exception { for ( String colName : colNames ) { if ( ! this . hasColumn ( colName ) ) { throw new Exception ( "Column doesn't exist in table: " + colName ) ; } } for ( String existingColName : this . columnNames ) { if ( ! Arrays . asList ( colNames ) . contains ( existingColName ) ) { this . removeColumn ( existingColName ) ; } } }
Remove all columns except the given ones
Remove all columns except the given ones