Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-6420

CassandraStorage should not assume all DataBags are DefaultDataBags

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 1.2.14, 2.0.4
    • None
    • All environments

    • Normal

    Description

      CassandraStorage improperly assumes all DataBags are DefaultDataBags. As a result, natural Pig code can't be used with CassandraStorage. For example:

      B = FOREACH A GENERATE $0, TOBAG(TOTUPLE($1, $2));
      STORE B into 'cassandra://MyKeySpace/MyColumnFamily' using CassandraStorage();

      fails with a complaint that a NonSpillableDataBag can't be converted into a DefaultDataBag.

      Since the CassandraStorage code only calls methods from DataBag, there is no need for this artifical restriction. After applying the attached patch, the above code works fine, making CassandraStorage much easier to use.

      This is my first submission to Cassandra, so I apologize for any incorrect process. Please let me know what I should do differently. In particular, I am a little unclear where I should put the test. I am thinking I should put it in ThriftColumnFamilyTest.java. Is this correct or should it be somewhere else? I'll create a test as soon as I understand.

      Attachments

        1. patch.txt
          2 kB
          Mike Spertus

        Activity

          People

            mps Mike Spertus
            mps Mike Spertus
            Mike Spertus
            Brandon Williams
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified