Cassandra
  1. Cassandra
  2. CASSANDRA-6083

Pig requires explicit cast from int to long to save to Cassandra

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Cannot Reproduce
    • Fix Version/s: None
    • Component/s: Hadoop
    • Labels:
      None

      Description

      Since version 1.2.10, I have to manually cast any int values in Pig to long in order to store them into bigint Cassandra columns. I did not have to perform this cast in previous versions of Cassandra.

        Activity

        Hide
        Alex Liu added a comment -

        It works for cassandra-1.2 as the following testing

         CREATE TABLE test1 (a int PRIMARY KEY, b bigint);
         CREATE TABLE moredata1 (x int PRIMARY KEY, y int);
         INSERT INTO test1 (a,b) VALUES (1,1);
         INSERT INTO test1 (a,b) VALUES (2,2);
         INSERT INTO test1 (a,b) VALUES (3,3);
         INSERT INTO moredata1 (x, y) VALUES (4,4);
         INSERT INTO moredata1 (x, y) VALUES (5,5);
         INSERT INTO moredata1 (x, y) VALUES (6,6);
        
        
        moretestvalues= LOAD 'cql://cql3ks/moredata1' USING CqlStorage();");
        insertformat= FOREACH moretestvalues GENERATE TOTUPLE(TOTUPLE('a',x)),TOTUPLE(y);
        STORE insertformat INTO 'cql://cql3ks/test1?output_query=UPDATE+cql3ks.test1+set+b+%3D+%3F' USING CqlStorage();
        result= LOAD 'cql://cql3ks/test1' USING CqlStorage();");
        dump result;
        
        
        Show
        Alex Liu added a comment - It works for cassandra-1.2 as the following testing CREATE TABLE test1 (a int PRIMARY KEY, b bigint); CREATE TABLE moredata1 (x int PRIMARY KEY, y int ); INSERT INTO test1 (a,b) VALUES (1,1); INSERT INTO test1 (a,b) VALUES (2,2); INSERT INTO test1 (a,b) VALUES (3,3); INSERT INTO moredata1 (x, y) VALUES (4,4); INSERT INTO moredata1 (x, y) VALUES (5,5); INSERT INTO moredata1 (x, y) VALUES (6,6); moretestvalues= LOAD 'cql: //cql3ks/moredata1' USING CqlStorage();"); insertformat= FOREACH moretestvalues GENERATE TOTUPLE(TOTUPLE('a',x)),TOTUPLE(y); STORE insertformat INTO 'cql: //cql3ks/test1?output_query=UPDATE+cql3ks.test1+set+b+%3D+%3F' USING CqlStorage(); result= LOAD 'cql: //cql3ks/test1' USING CqlStorage();"); dump result;
        Hide
        Chad Johnston added a comment -

        I ran into the issue when loading a file from disk and saving it into Cassandra. I'll put together a reproducible case.

        There's a small chance that this was fixed with the changes for https://issues.apache.org/jira/browse/CASSANDRA-6102.

        I'll generate my test case against 1.2.10 and see if it's still an issue in 1.2.11.

        Show
        Chad Johnston added a comment - I ran into the issue when loading a file from disk and saving it into Cassandra. I'll put together a reproducible case. There's a small chance that this was fixed with the changes for https://issues.apache.org/jira/browse/CASSANDRA-6102 . I'll generate my test case against 1.2.10 and see if it's still an issue in 1.2.11.
        Hide
        Chad Johnston added a comment -

        I am unable to reproduce this in 1.2.10 or 1.2.11. I don't know what I ran into before, but I can't make it happen again.

        Show
        Chad Johnston added a comment - I am unable to reproduce this in 1.2.10 or 1.2.11. I don't know what I ran into before, but I can't make it happen again.

          People

          • Assignee:
            Alex Liu
            Reporter:
            Chad Johnston
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development