Skip to main content

 

ThoughtSpot

Change Sharding on a Table

Overview

Explains what the feature is or what its benefits are to the user or customer.

Feature

You can change the sharding on a table or remove it altogether (creating a replicated table) using this procedure. This procedure preserves the data within the table.

This procedure reshards a table. This is also called redistributing or repartitioning. You can use this method to reshard a table without losing its data or metadata. This means that worksheets, answers, and pinboards built on top of the table will continue to work.

You can use these steps to do any of these operations:

  • shard a table that was previously replicated.
  • change a replicated table to a sharded table.
  • change the number of shards to use for a sharded table.

To change the sharding on a table:

  1. Connect to the Database with the ThoughtSpot SQL Command Line (TQL).
  2. Issue the command to change the sharding using this syntax:
    TQL> ALTER TABLE <table>
         [SET DIMENSION | SET FACT 
         [PARTITION BY HASH 
         [(<shards>)]
         [KEY(<column>)]]]
    For example:
    • To make a sharded table into a dimension table (replicated on every node), use:
      ALTER TABLE "products"
         SET DIMENSION;
    • To make a dimension table into a sharded (fact) table or change the number of shards, use:
      ALTER TABLE "sales"
         SET FACT PARTITION BY HASH (96)
         KEY ("productID");
  • Was this article helpful?