Skip to content

Instantly share code, notes, and snippets.

@achintya-kumar
Created June 19, 2022 02:49
Show Gist options
  • Save achintya-kumar/711927a9abb85ec9ddc36dce7b592eb1 to your computer and use it in GitHub Desktop.
Save achintya-kumar/711927a9abb85ec9ddc36dce7b592eb1 to your computer and use it in GitHub Desktop.
New HBase table in Scala using TableDescriptorBuilder
val tableDescriptorBuilder = TableDescriptorBuilder
.newBuilder(TableName.valueOf(HBASE_TABLE_NAME))
.setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(HBASE_COLUMN_FAMILY.getBytes).build())
.build()
logger.info("Adding column family to the HBase Table")
hBaseAdmin.createTable(tableDescriptorBuilder)
logger.info("HBase Table Successfully Created")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment