cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jji...@apache.org
Subject [6/6] cassandra git commit: Merge branch 'cassandra-3.11' into trunk
Date Tue, 29 Aug 2017 22:51:36 GMT
Merge branch 'cassandra-3.11' into trunk


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

Branch: refs/heads/trunk
Commit: e6c2ae1f3b3ab540ac3bf4a3de40fbf1df8e7db8
Parents: 38ae306 771ad53
Author: Jeff Jirsa <jjirsa@apple.com>
Authored: Tue Aug 29 15:51:03 2017 -0700
Committer: Jeff Jirsa <jjirsa@apple.com>
Committed: Tue Aug 29 15:51:16 2017 -0700

----------------------------------------------------------------------
 .../cql3/validation/operations/SelectTest.java  | 44 ++++++++++++++++----
 1 file changed, 36 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e6c2ae1f/test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
index 54f11ff,4cdf087..e22519b
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
@@@ -4755,8 -4746,24 +4755,23 @@@ public class SelectTest extends CQLTest
          execute("INSERT INTO %s (k) VALUES (2);");
          execute("INSERT INTO %s (k, i) VALUES (1, 1) USING TTL 100;");
          execute("INSERT INTO %s (k, i) VALUES (3, 3) USING TTL 100;");
-         assertRows(execute("SELECT k, i, TTL(i) FROM %s "),
-                    row(1, 1, 100), row(2, null, null), row(3, 3, 100));
+         assertRows(execute("SELECT k, i FROM %s "),
+                    row(1, 1),
+                    row(2, null),
+                    row(3, 3));
+ 
+         UntypedResultSet rs = execute("SELECT k, i, ttl(i) AS name_ttl FROM %s");
+         assertEquals("name_ttl", rs.metadata().get(2).name.toString());
+         int i = 0;
+         for (UntypedResultSet.Row row : rs)
+         {
+             if ( i % 2 == 0) // Every odd row has a null i/ttl
+                 assertTrue(row.getInt("name_ttl") >= 90 && row.getInt("name_ttl")
<= 100);
+             else
+                 assertTrue(row.has("name_ttl") == false);
+ 
+             i++;
+         }
 -
      }
  
      @Test
@@@ -4768,12 -4775,24 +4783,25 @@@
          execute("INSERT INTO %s (k, c) VALUES (1, 2) ;");
          execute("INSERT INTO %s (k, c, i) VALUES (1, 3, 3) USING TTL 100;");
          execute("INSERT INTO %s (k, c, i) VALUES (3, 3, 3) USING TTL 100;");
-         assertRows(execute("SELECT k, c, i, TTL(i) FROM %s "),
-                    row(1, 1, 1, 100),
-                    row(1, 2, null, null),
-                    row(1, 3, 3, 100),
-                    row(2, 2, null, null),
-                    row(3, 3, 3, 100));
+         assertRows(execute("SELECT k, c, i FROM %s "),
+                    row(1, 1, 1),
+                    row(1, 2, null),
+                    row(1, 3, 3),
+                    row(2, 2, null),
+                    row(3, 3, 3));
+ 
+         UntypedResultSet rs = execute("SELECT k, c, i, ttl(i) AS name_ttl FROM %s");
+         assertEquals("name_ttl", rs.metadata().get(3).name.toString());
+         int i = 0;
+         for (UntypedResultSet.Row row : rs)
+         {
+             if ( i % 2 == 0) // Every odd row has a null i/ttl
+                 assertTrue(row.getInt("name_ttl") >= 90 && row.getInt("name_ttl")
<= 100);
+             else
+                 assertTrue(row.has("name_ttl") == false);
+ 
+             i++;
+         }
      }
 +
  }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message