def migrate_resource_table(conn, table):
 resource_table = conn.table(table)
 resource_filter = "QualifierFilter(=, 'regexstring:m_\\d{19}\\+[\\w-\\._]*\\+[\\w-\\._!]')"
 gen = resource_table.scan(filter=resource_filter)
 for (row, data) in gen:
  columns = []
  updated_columns = dict()
  column_prefix = 'f:'
  for (column, value) in data.items():
   if column.startswith('f:m_'):
    columns.append(column)
    parts = column[2:].split('+', 2)
    parts.extend(parts.pop(2).split('!'))
    column = hbase_utils.prepare_key(*parts)
    updated_columns[(column_prefix + column)] = value
  resource_table.put(row, updated_columns)
  resource_table.delete(row, columns)

def migrate_resource_table ( conn , table ) : resource_table = conn . table ( table ) resource_filter = "QualifierFilter(=, 'regexstring:m_\\d{19}\\+[\\w-\\._]*\\+[\\w-\\._!]')" gen = resource_table . scan ( filter = resource_filter ) for ( row , data ) in gen : columns = [ ] updated_columns = dict ( ) column_prefix = 'f:' for ( column , value ) in data . items ( ) : if column . startswith ( 'f:m_' ) : columns . append ( column ) parts = column [ 2 : ] . split ( '+' , 2 ) parts . extend ( parts . pop ( 2 ) . split ( '!' ) ) column = hbase_utils . prepare_key ( * parts ) updated_columns [ ( column_prefix + column ) ] = value resource_table . put ( row , updated_columns ) resource_table . delete ( row , columns )
migrate table resource in hbase .