[
https://issues.apache.org/jira/browse/CASSANDRA-2014?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Patrik Modesto updated CASSANDRA-2014:
--------------------------------------
Description:
ColumnFamilyRecordWriter.java doesn't support Mutation with Deletion without
slice_predicat and super_column to delete whole row. The other way I tried is
to specify SlicePredicate with empty start and finish and I got:
{code}
java.io.IOException: InvalidRequestException(why:Deletion does not yet support
SliceRange predicates.)
at
org.apache.cassandra.hadoop.ColumnFamilyRecordWriter$RangeClient.run(ColumnFamilyRecordWriter.java:355)
{code}
I tryied to patch the ColumnFamilyRecordWriter.java like this:
{code}
--- a/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordWriter.java
+++ b/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordWriter.java
@@ -166,10 +166,17 @@ implements
org.apache.hadoop.mapred.RecordWriter<ByteBuffer,List<org.apache.cass
// deletion
Deletion deletion = new Deletion(amut.deletion.timestamp);
mutation.setDeletion(deletion);
+
org.apache.cassandra.avro.SlicePredicate apred =
amut.deletion.predicate;
- if (amut.deletion.super_column != null)
+ if (apred == null && amut.deletion.super_column == null)
+ {
+ // epmty; delete whole row
+ }
+ else if (amut.deletion.super_column != null)
+ {
// super column
deletion.setSuper_column(copy(amut.deletion.super_column));
+ }
else if (apred.column_names != null)
{
// column names
{code}
but that didn't work as well.
was:
ColumnFamilyRecordWriter.java doesn't support Mutation with Deletion without
slice_predicat and super_column to delete whole row. The other way I tried is
to specify SlicePredicate with empty start and finish and I got:
{{
java.io.IOException: InvalidRequestException(why:Deletion does not yet support
SliceRange predicates.)
at
org.apache.cassandra.hadoop.ColumnFamilyRecordWriter$RangeClient.run(ColumnFamilyRecordWriter.java:355)
}}
I tryied to patch the ColumnFamilyRecordWriter.java like this:
{{
--- a/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordWriter.java
+++ b/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordWriter.java
@@ -166,10 +166,17 @@ implements
org.apache.hadoop.mapred.RecordWriter<ByteBuffer,List<org.apache.cass
// deletion
Deletion deletion = new Deletion(amut.deletion.timestamp);
mutation.setDeletion(deletion);
+
org.apache.cassandra.avro.SlicePredicate apred =
amut.deletion.predicate;
- if (amut.deletion.super_column != null)
+ if (apred == null && amut.deletion.super_column == null)
+ {
+ // epmty; delete whole row
+ }
+ else if (amut.deletion.super_column != null)
+ {
// super column
deletion.setSuper_column(copy(amut.deletion.super_column));
+ }
else if (apred.column_names != null)
{
// column names
}}
but that didn't work as well.
> Can't delete whole row from Hadoop MapReduce
> --------------------------------------------
>
> Key: CASSANDRA-2014
> URL: https://issues.apache.org/jira/browse/CASSANDRA-2014
> Project: Cassandra
> Issue Type: Bug
> Components: Hadoop
> Affects Versions: 0.7.0
> Environment: Debian Linux 2.6.32 amd64
> Reporter: Patrik Modesto
>
> ColumnFamilyRecordWriter.java doesn't support Mutation with Deletion without
> slice_predicat and super_column to delete whole row. The other way I tried is
> to specify SlicePredicate with empty start and finish and I got:
> {code}
> java.io.IOException: InvalidRequestException(why:Deletion does not yet
> support SliceRange predicates.)
> at
> org.apache.cassandra.hadoop.ColumnFamilyRecordWriter$RangeClient.run(ColumnFamilyRecordWriter.java:355)
> {code}
> I tryied to patch the ColumnFamilyRecordWriter.java like this:
> {code}
> --- a/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordWriter.java
> +++ b/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordWriter.java
> @@ -166,10 +166,17 @@ implements
> org.apache.hadoop.mapred.RecordWriter<ByteBuffer,List<org.apache.cass
> // deletion
> Deletion deletion = new Deletion(amut.deletion.timestamp);
> mutation.setDeletion(deletion);
> +
> org.apache.cassandra.avro.SlicePredicate apred =
> amut.deletion.predicate;
> - if (amut.deletion.super_column != null)
> + if (apred == null && amut.deletion.super_column == null)
> + {
> + // epmty; delete whole row
> + }
> + else if (amut.deletion.super_column != null)
> + {
> // super column
> deletion.setSuper_column(copy(amut.deletion.super_column));
> + }
> else if (apred.column_names != null)
> {
> // column names
> {code}
> but that didn't work as well.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.