cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject git commit: Fix IllegalArgumentException in CqlStorage
Date Fri, 23 May 2014 16:02:29 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 465a09c46 -> dfcb73426


Fix IllegalArgumentException in CqlStorage

patch by slebresne; reviewed by driftx for CASSANDRA-7287


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/dfcb7342
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/dfcb7342
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/dfcb7342

Branch: refs/heads/cassandra-2.1
Commit: dfcb73426c9e87b0e4c263d0739d6856c3119c05
Parents: 465a09c
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Fri May 23 18:01:58 2014 +0200
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Fri May 23 18:01:58 2014 +0200

----------------------------------------------------------------------
 CHANGES.txt                                              |  1 +
 .../cassandra/hadoop/pig/AbstractCassandraStorage.java   | 11 +++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/dfcb7342/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 6c26d84..108c859 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -23,6 +23,7 @@
  * Fix potential ClassCastException in HintedHandoffManager (CASSANDRA-7284)
  * Use prepared statements internally (CASSANDRA-6975)
  * Fix broken paging state with prepared statement (CASSANDRA-7120)
+ * Fix IllegalArgumentException in CqlStorage (CASSANDRA-7287)
 Merged from 2.0:
  * Always reallocate buffers in HSHA (CASSANDRA-6285)
  * (Hadoop) support authentication in CqlRecordReader (CASSANDRA-7221)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/dfcb7342/src/java/org/apache/cassandra/hadoop/pig/AbstractCassandraStorage.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/hadoop/pig/AbstractCassandraStorage.java b/src/java/org/apache/cassandra/hadoop/pig/AbstractCassandraStorage.java
index 9e3abcf..9737d67 100644
--- a/src/java/org/apache/cassandra/hadoop/pig/AbstractCassandraStorage.java
+++ b/src/java/org/apache/cassandra/hadoop/pig/AbstractCassandraStorage.java
@@ -788,8 +788,15 @@ public abstract class AbstractCassandraStorage extends LoadFunc implements
Store
     {
         if (validator instanceof DecimalType || validator instanceof InetAddressType)
             return validator.getString(value);
-        else
-            return validator.compose(value);
+
+        if (validator instanceof CollectionType)
+        {
+            // For CollectionType, the compose() method assumes the v3 protocol format of
collection, which
+            // is not correct here since we query using the CQL-over-thrift interface which
use the pre-v3 format
+            return ((CollectionSerializer)validator.getSerializer()).deserializeForNativeProtocol(value,
1);
+        }
+
+        return validator.compose(value);
     }
 
     protected static class CfInfo


Mime
View raw message