private void splitOn(String... columnNames){
  List<Column> columns=sortedOriginal.columns(columnNames);
  int byteSize=getByteSize(columns);
  byte[] currentKey=null;
  String currentStringKey=null;
  TemporaryView view;
  Selection selection=new BitmapBackedSelection();
  for (int row=0; row < sortedOriginal.rowCount(); row++) {
    ByteBuffer byteBuffer=ByteBuffer.allocate(byteSize);
    String newStringKey="";
    for (int col=0; col < columnNames.length; col++) {
      if (col > 0) {
        newStringKey=newStringKey + SPLIT_STRING;
      }
      Column c=sortedOriginal.column(columnNames[col]);
      String groupKey=sortedOriginal.get(sortedOriginal.columnIndex(c),row);
      newStringKey=newStringKey + groupKey;
      byteBuffer.put(c.asBytes(row));
    }
    byte[] newKey=byteBuffer.array();
    if (row == 0) {
      currentKey=newKey;
      currentStringKey=newStringKey;
    }
    if (!Arrays.equals(newKey,currentKey)) {
      currentKey=newKey;
      view=new TemporaryView(sortedOriginal,selection);
      view.setName(currentStringKey);
      currentStringKey=newStringKey;
      addViewToSubTables(view);
      selection=new BitmapBackedSelection();
      selection.add(row);
    }
 else {
      selection.add(row);
    }
  }
  if (!selection.isEmpty()) {
    view=new TemporaryView(sortedOriginal,selection);
    view.setName(currentStringKey);
    addViewToSubTables(view);
  }
}

private void splitOn ( String ... columnNames ) { List < Column > columns = sortedOriginal . columns ( columnNames ) ; int byteSize = getByteSize ( columns ) ; byte [ ] currentKey = null ; String currentStringKey = null ; TemporaryView view ; Selection selection = new BitmapBackedSelection ( ) ; for ( int row = 0 ; row < sortedOriginal . rowCount ( ) ; row ++ ) { ByteBuffer byteBuffer = ByteBuffer . allocate ( byteSize ) ; String newStringKey = "" ; for ( int col = 0 ; col < columnNames . length ; col ++ ) { if ( col > 0 ) { newStringKey = newStringKey + SPLIT_STRING ; } Column c = sortedOriginal . column ( columnNames [ col ] ) ; String groupKey = sortedOriginal . get ( sortedOriginal . columnIndex ( c ) , row ) ; newStringKey = newStringKey + groupKey ; byteBuffer . put ( c . asBytes ( row ) ) ; } byte [ ] newKey = byteBuffer . array ( ) ; if ( row == 0 ) { currentKey = newKey ; currentStringKey = newStringKey ; } if ( ! Arrays . equals ( newKey , currentKey ) ) { currentKey = newKey ; view = new TemporaryView ( sortedOriginal , selection ) ; view . setName ( currentStringKey ) ; currentStringKey = newStringKey ; addViewToSubTables ( view ) ; selection = new BitmapBackedSelection ( ) ; selection . add ( row ) ; } else { selection . add ( row ) ; } } if ( ! selection . isEmpty ( ) ) { view = new TemporaryView ( sortedOriginal , selection ) ; view . setName ( currentStringKey ) ; addViewToSubTables ( view ) ; } }
splits the sortedoriginal table into sub - tables , grouping on the columns whose names are given in splitcolumnnames
