title: how to create hbase table with multiple columns family on HDP hortonworks?
body: <p>i'm pretty new with HDP and i want to create an hbase table with multiple columns, and load data from an an csv file as below</p>
  
  <p><a href="http://i.stack.imgur.com/9F9E3.png" rel="nofollow">csv file</a></p>
  
  <p>as u can see, i have per example column family "informations personnelles" that contains multiples columns such as "nom" "prenom" and so on.</p>
  
  <p>so my questions is:
   - how to create table hbase with java api on hdp sandbox?
   - how to load data from my csv file?</p>
  
  <p>ps: i tried to create table but i dont know how to run it on sandbox? where to put my java class? do i need to configure something?</p>
  
  <p>here is my code</p>
  
  <pre><code>    import java.io.IOException;
  
  import org.apache.hadoop.hbase.HBaseConfiguration;
  import org.apache.hadoop.hbase.HColumnDescriptor;
  import org.apache.hadoop.hbase.HTableDescriptor;
  import org.apache.hadoop.hbase.client.HBaseAdmin;
  import org.apache.hadoop.hbase.TableName;
  
  import org.apache.hadoop.conf.Configuration;
  
  public class CreateTable {
  
     public static void main(String[] args) throws IOException {
  
        // Instantiating configuration class
        Configuration con = HBaseConfiguration.create();
          con.set("hbase.zookeeper.property.clientPort", "2181");
          con.set("hbase.zookeeper.quorum", "hortonworks.hbase.vm");
          con.set("zookeeper.znode.parent", "/hbase-unsecure");
          System.out.println("HBase is running!");
  
        // Instantiating HbaseAdmin class
        HBaseAdmin admin = new HBaseAdmin(con);
  
        // Instantiating table descriptor class
        HTableDescriptor tableDescriptor = new
        TableDescriptor(TableName.valueOf("competence"));
  
        // Adding column families to table descriptor
        tableDescriptor.addFamily(new HColumnDescriptor("Infos_collaborateur"));
        tableDescriptor.addFamily(new HColumnDescriptor("Infos_Rh"));
        tableDescriptor.addFamily(new HColumnDescriptor("Savoir_faire"));
        tableDescriptor.addFamily(new HColumnDescriptor("Savoir_etre"));
        tableDescriptor.addFamily(new HColumnDescriptor("Langues"));
        tableDescriptor.addFamily(new HColumnDescriptor("Java:Developpement/Librairies/API/Frameworks/CMS"));
        tableDescriptor.addFamily(new HColumnDescriptor("PHP/Frameworks"));
        tableDescriptor.addFamily(new HColumnDescriptor("Techno_Web/Frameworks"));
        tableDescriptor.addFamily(new HColumnDescriptor("Autres"));
        tableDescriptor.addFamily(new HColumnDescriptor("ERP:Language/Outils"));
        tableDescriptor.addFamily(new HColumnDescriptor("Mobile:natif"));
        tableDescriptor.addFamily(new HColumnDescriptor("Mobile:Cross"));
        tableDescriptor.addFamily(new HColumnDescriptor("Infographie/creas"));
        tableDescriptor.addFamily(new HColumnDescriptor("Outils_de_developpement/Software"));
        tableDescriptor.addFamily(new HColumnDescriptor("Analytics"));
        tableDescriptor.addFamily(new HColumnDescriptor("Outils_Microsoft"));
        tableDescriptor.addFamily(new HColumnDescriptor("Developpements/Librairies"));
        tableDescriptor.addFamily(new HColumnDescriptor("BaseDeDonnees/FluxDeDonnees"));
        tableDescriptor.addFamily(new HColumnDescriptor("Windows:SystemeDexploitation/serveur"));
        tableDescriptor.addFamily(new HColumnDescriptor("AutresOS"));
        tableDescriptor.addFamily(new HColumnDescriptor("Plateforms"));
        tableDescriptor.addFamily(new HColumnDescriptor("Serveur_web_parametrage"));
        tableDescriptor.addFamily(new HColumnDescriptor("Serveur_Application_parametrage"));
        tableDescriptor.addFamily(new HColumnDescriptor("Integration/fonctionnel"));
        tableDescriptor.addFamily(new HColumnDescriptor("Outils_de_conception/de_gestion_projet"));
        tableDescriptor.addFamily(new HColumnDescriptor("AMOA"));
        tableDescriptor.addFamily(new HColumnDescriptor("Experience"));   
        tableDescriptor.addFamily(new HColumnDescriptor("Interventions"));            
  
        // Execute the table through admin
        admin.createTable(tableDescriptor);
        System.out.println(" Table created ");
     }
  }
  </code></pre>
  
  <p>thanks an advance</p>