Discussions

Expand all | Collapse all

Table shard and drop a Partition

  • 1.  Table shard and drop a Partition

    Posted 28 days ago
    Dear all,

    We can create a Shard Table as following

    CREATE TABLE customers(
    accountId text,
    name text,
    SHARD KEY (accountId))
    WITH (shard_count = 4);

    Sharding is allowed on the following column type
    • DATE
    • INT
    • TEXT ENCODING DICT
    • TIME
    • TIMESTAMP

    Question: Please let us know if we shard a Table with Date Field (dd-mmm-yy). Please let us know is it anyway possible to drop a Partition based on Date
    Example: 01-Jan-19 Record Count 10 Million, 02-Jan-19 Record Count 12 Million. Drop 01-Jan-19 Partition.

    Regards,
    Sumit
    #Core


  • 2.  RE: Table shard and drop a Partition

    Posted 27 days ago
    Hi @Sumit Srivastava,

    The shard table option is something like a hash partitioning and is intended to distribute the records between those partition on an even manner.
    Because of that, you can't determine if a particular date is on a shard or in another, so there isn't a function to drop a shard right now, and you have to rely on delete function, that's quite fast or a /itas to build a new table without the records not needed.