[2/6] git commit: Fix pig tests.

2014-08-07 Thread brandonwilliams
Fix pig tests.

Patch by Alex Liu, reviewed by brandonwilliams for CASSANDRA-7570


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

Branch: refs/heads/cassandra-2.1
Commit: 6fdcd3b616b262c0a5c266e765046a57602be1b8
Parents: 3970c65
Author: Brandon Williams 
Authored: Thu Aug 7 11:54:34 2014 -0500
Committer: Brandon Williams 
Committed: Thu Aug 7 11:54:34 2014 -0500

--
 .../cassandra/pig/CqlTableDataTypeTest.java | 39 ++---
 .../org/apache/cassandra/pig/CqlTableTest.java  | 61 
 .../cassandra/pig/ThriftColumnFamilyTest.java   | 14 -
 3 files changed, 28 insertions(+), 86 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6fdcd3b6/test/pig/org/apache/cassandra/pig/CqlTableDataTypeTest.java
--
diff --git a/test/pig/org/apache/cassandra/pig/CqlTableDataTypeTest.java 
b/test/pig/org/apache/cassandra/pig/CqlTableDataTypeTest.java
index 1819c61..bbd5a87 100644
--- a/test/pig/org/apache/cassandra/pig/CqlTableDataTypeTest.java
+++ b/test/pig/org/apache/cassandra/pig/CqlTableDataTypeTest.java
@@ -217,22 +217,14 @@ public class CqlTableDataTypeTest extends PigTestBase
 }
 
 @Test
-public void testCqlStorageRegularType()
-throws AuthenticationException, AuthorizationException, 
InvalidRequestException, UnavailableException, TimedOutException, TException, 
NotFoundException, SchemaDisagreementException, IOException
-{
-cqlTableTest("rows = LOAD 'cql://cql3ks/cqltable?" + defaultParameters 
+ "' USING CqlStorage();");
-counterTableTest("cc_rows = LOAD 'cql://cql3ks/countertable?" + 
defaultParameters + "' USING CqlStorage();");
-}
-
-@Test
 public void testCqlNativeStorageRegularType()
 throws AuthenticationException, AuthorizationException, 
InvalidRequestException, UnavailableException, TimedOutException, TException, 
NotFoundException, SchemaDisagreementException, IOException
 {
 //input_cql=select * from cqltable where token(key) > ? and token(key) 
<= ?
-cqlTableTest("rows = LOAD 'cql://cql3ks/cqltable?" + defaultParameters 
+ nativeParameters + 
"&input_cql=select%20*%20from%20cqltable%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F'
 USING CqlStorage();");
+cqlTableTest("rows = LOAD 'cql://cql3ks/cqltable?" + defaultParameters 
+ nativeParameters + 
"&input_cql=select%20*%20from%20cqltable%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F'
 USING CqlNativeStorage();");
 
 //input_cql=select * from countertable where token(key) > ? and 
token(key) <= ?
-counterTableTest("cc_rows = LOAD 'cql://cql3ks/countertable?" + 
defaultParameters + nativeParameters + 
"&input_cql=select%20*%20from%20countertable%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F'
 USING CqlStorage();");
+counterTableTest("cc_rows = LOAD 'cql://cql3ks/countertable?" + 
defaultParameters + nativeParameters + 
"&input_cql=select%20*%20from%20countertable%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F'
 USING CqlNativeStorage();");
 }
 
 private void cqlTableTest(String initialQuery) throws IOException
@@ -296,18 +288,11 @@ public class CqlTableDataTypeTest extends PigTestBase
 }
 
 @Test
-public void testCqlStorageSetType()
-throws AuthenticationException, AuthorizationException, 
InvalidRequestException, UnavailableException, TimedOutException, TException, 
NotFoundException, SchemaDisagreementException, IOException
-{
-settableTest("set_rows = LOAD 'cql://cql3ks/settable?" + 
defaultParameters + "' USING CqlStorage();");
-}
-
-@Test
 public void testCqlNativeStorageSetType()
 throws AuthenticationException, AuthorizationException, 
InvalidRequestException, UnavailableException, TimedOutException, TException, 
NotFoundException, SchemaDisagreementException, IOException
 {
 //input_cql=select * from settable where token(key) > ? and token(key) 
<= ?
-settableTest("set_rows = LOAD 'cql://cql3ks/settable?" + 
defaultParameters + nativeParameters + 
"&input_cql=select%20*%20from%20settable%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F'
 USING CqlStorage();");
+settableTest("set_rows = LOAD 'cql://cql3ks/settable?" + 
defaultParameters + nativeParameters + 
"&input_cql=select%20*%20from%20settable%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F'
 USING CqlNativeStorage();");
 }
 
 private void settableTest(String initialQuery) throws IOException
@@ -370,18 +355,11 @@ publi

[2/6] git commit: Fix pig tests.

2014-05-15 Thread brandonwilliams
Fix pig tests.

Patch by Alex Liu, reviewed by brandonwilliams for CASSANDRA-6877


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

Branch: refs/heads/cassandra-2.1
Commit: b927f790af0d20fe8d2453d50ecce25bb6c6e4d0
Parents: 2092da0
Author: Brandon Williams 
Authored: Wed May 14 14:32:45 2014 -0500
Committer: Brandon Williams 
Committed: Wed May 14 14:32:45 2014 -0500

--
 test/pig/org/apache/cassandra/pig/CqlTableTest.java | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b927f790/test/pig/org/apache/cassandra/pig/CqlTableTest.java
--
diff --git a/test/pig/org/apache/cassandra/pig/CqlTableTest.java 
b/test/pig/org/apache/cassandra/pig/CqlTableTest.java
index 3bbc3d1..15d49f2 100644
--- a/test/pig/org/apache/cassandra/pig/CqlTableTest.java
+++ b/test/pig/org/apache/cassandra/pig/CqlTableTest.java
@@ -177,18 +177,18 @@ public class CqlTableTest extends PigTestBase
 pig.registerQuery("STORE recs INTO 'cql://cql3ks/collectiontable?" + 
defaultParameters + "&output_query=update+cql3ks.collectiontable+set+n+%3D+%3F' 
USING CqlStorage();");
 pig.executeBatch();
 
-//(book2,((key2, value2),(m,mm),(n,nn)))
-//(book3,((key3, value3),(m,mm),(n,nn)))
-//(book4,((key4, value4),(m,mm),(n,nn)))
-//(book1,((key1, value1),(m,mm),(n,nn)))
+//(book2,((m,mm),(n,nn)))
+//(book3,((m,mm),(n,nn)))
+//(book4,((m,mm),(n,nn)))
+//(book1,((m,mm),(n,nn)))
 pig.registerQuery("result= LOAD 'cql://cql3ks/collectiontable?" + 
defaultParameters + "' USING CqlStorage();");
 Iterator it = pig.openIterator("result");
 while (it.hasNext()) {
 Tuple t = it.next();
 Tuple t1 = (Tuple) t.get(1);
-Assert.assertEquals(t1.size(), 3);
-Tuple element1 = (Tuple) t1.get(1);
-Tuple element2 = (Tuple) t1.get(2);
+Assert.assertEquals(t1.size(), 2);
+Tuple element1 = (Tuple) t1.get(0);
+Tuple element2 = (Tuple) t1.get(1);
 Assert.assertEquals(element1.get(0), "m");
 Assert.assertEquals(element1.get(1), "mm");
 Assert.assertEquals(element2.get(0), "n");