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

ColumnFamilyOutputFormat only writes one column (per key)

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Fix Version/s: 0.7.0 rc 2
    • Component/s: None
    • Labels:
      None

      Description

      From mailing list http://thread.gmane.org/gmane.comp.db.cassandra.user/10385

      ColumnFamilyOutputFormat will only write out one column
      per key.

      Alex Burkoff also reported this nearly two months ago, but nobody ever
      replied...
      http://article.gmane.org/gmane.comp.db.cassandra.user/9325

      has anyone any ideas?
      should it be possible to write multiple columns out?

      This is very easy to reproduce. Use the contrib/wordcount example, with
      OUTPUT_REDUCER=cassandra and in WordCount.java add at line 132

      > results.add(getMutation(key, sum));
      > + results.add(getMutation(new Text("doubled"), sum*2));

      Only the last mutation for any key seems to be written.

        Activity

        Hide
        michaelsembwever mck added a comment -

        The problem was the list of mutations inside the Map<ByteBuffer, Map<String, List<Mutation>>> that is sent to batch_mutate(..) isn't appended to, instead it was overridden.

        This patch allows subsequent mutations (under the same columnFamily and key) to be appended to the existing list.

        Show
        michaelsembwever mck added a comment - The problem was the list of mutations inside the Map<ByteBuffer, Map<String, List<Mutation>>> that is sent to batch_mutate(..) isn't appended to, instead it was overridden. This patch allows subsequent mutations (under the same columnFamily and key) to be appended to the existing list.
        Hide
        jbellis Jonathan Ellis added a comment -

        Thanks for the fix! Committed w/ minor change to emphasize that subBatch is only created once.

        Show
        jbellis Jonathan Ellis added a comment - Thanks for the fix! Committed w/ minor change to emphasize that subBatch is only created once.
        Hide
        karthick Karthick Sankarachary added a comment -

        +1 on the patch.

        Show
        karthick Karthick Sankarachary added a comment - +1 on the patch.
        Hide
        hudson Hudson added a comment -

        Integrated in Cassandra-0.7 #70 (See https://hudson.apache.org/hudson/job/Cassandra-0.7/70/)

        Show
        hudson Hudson added a comment - Integrated in Cassandra-0.7 #70 (See https://hudson.apache.org/hudson/job/Cassandra-0.7/70/ )

          People

          • Assignee:
            michaelsembwever mck
            Reporter:
            michaelsembwever mck
            Reviewer:
            Jonathan Ellis
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development