Results 1 to 3 of 3

Thread: Error in inserting partitioned table with composite primary key from multiple partitioned stored procedure

  1. #1
    New Member
    Join Date
    Sep 2013
    Posts
    2

    Unhappy Error in inserting partitioned table with composite primary key from multiple partitioned stored procedure

    While following hello world in tutorial I made few changes in create table. Table has composite primary key with two columns (one is partition column). Rest of the tutorial has same code for procedures and DDL.

    create table dictionary (
    word varchar(50),
    meaning varchar(50),
    language varchar(50) not null,
    primary key(word, language)
    );
    partition table dictionary on column language;

    CREATE PROCEDURE FROM CLASS Insert;
    CREATE PROCEDURE FROM CLASS Select;

    PARTITION PROCEDURE Insert ON TABLE dictionary COLUMN language;
    PARTITION PROCEDURE Select ON TABLE dictionary COLUMN language;

    While inserting following data
    client.callProcedure("Insert", "One", "1", "English");
    client.callProcedure("Insert", "One", "1", "Roman");
    I get fllowing error:

    Exception in thread "main" org.voltdb.client.ProcCallException: VOLTDB ERROR: CONSTRAINT VIOLATION
    Mispartitioned tuple in single-partition insert statement.
    Constraint Type PARTITIONING, Table CatalogId DICTIONARY
    header size: 37
    status code: -128 column count: 3
    cols (WORD:STRING), (MEANING:STRING), (LANGUAGE:STRING),
    rows -
    One,1,Roman

    How to correct this partition? Is it like with this composite primary key which includes partition column will not work as multi partitioned table and need to be replicated table?

  2. #2
    Super Moderator
    Join Date
    Dec 2011
    Posts
    72
    Hi,

    The PARTITION PROCEDURE command has an optional PARAMETER option which defaults to 0. If "language" is not the first parameter to your stored procedure, then the default is incorrect. You probably need to set this more explicitly:

    PARTITION PROCEDURE Insert ON TABLE dictionary COLUMN language PARAMETER 2; // assuming language is the 3rd parameter

    There is more about this on the PARTITION PROCEDURE reference page:
    http://voltdb.com/docs/UsingVoltDB/d...titionproc.php

    Best regards,
    Ben

  3. #3
    New Member
    Join Date
    Sep 2013
    Posts
    2
    Hi Ben,

    Thanks a lot.


    Quote Originally Posted by bballard View Post
    Hi,

    The PARTITION PROCEDURE command has an optional PARAMETER option which defaults to 0. If "language" is not the first parameter to your stored procedure, then the default is incorrect. You probably need to set this more explicitly:

    PARTITION PROCEDURE Insert ON TABLE dictionary COLUMN language PARAMETER 2; // assuming language is the 3rd parameter

    There is more about this on the PARTITION PROCEDURE reference page:
    http://voltdb.com/docs/UsingVoltDB/d...titionproc.php

    Best regards,
    Ben

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •