You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2011/04/10 15:39:12 UTC

svn commit: r1090798 - in /cassandra/trunk: doc/cql/CQL.textile src/java/org/apache/cassandra/cql/Cql.g src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java test/system/test_cql.py

Author: jbellis
Date: Sun Apr 10 13:39:11 2011
New Revision: 1090798

URL: http://svn.apache.org/viewvc?rev=1090798&view=rev
Log:
add 'int' as sql alias for 'bigint'
patch by jbellis

Modified:
    cassandra/trunk/doc/cql/CQL.textile
    cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g
    cassandra/trunk/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java
    cassandra/trunk/test/system/test_cql.py

Modified: cassandra/trunk/doc/cql/CQL.textile
URL: http://svn.apache.org/viewvc/cassandra/trunk/doc/cql/CQL.textile?rev=1090798&r1=1090797&r2=1090798&view=diff
==============================================================================
--- cassandra/trunk/doc/cql/CQL.textile (original)
+++ cassandra/trunk/doc/cql/CQL.textile Sun Apr 10 13:39:11 2011
@@ -207,6 +207,7 @@ It is possible to assign columns a type 
 |varchar|UTF8 encoded string|
 |uuid|Type 1, or type 4 UUID|
 |varint|Arbitrary-precision integer|
+|int|8-byte long (same as bigint)|
 |bigint|8-byte long|
 
 _Note: In addition to the recognized types listed above, it is also possible to supply a string containing the name of a class (a sub-class of @AbstractType@), either fully qualified, or relative to the @org.apache.cassandra.db.marshal@ package._
@@ -288,6 +289,7 @@ How column name/value terms are interpre
 |uuid|The string @now@, to represent a type-1 (time-based) UUID with a date-time component based on the current time|
 |uuid|Numeric value representing milliseconds since epoch|
 |uuid|An "iso8601 timestamp":http://en.wikipedia.org/wiki/8601|
+|int|Integer value capable of fitting in 8 bytes (same as bigint)|
 |bigint|Integer value capable of fitting in 8 bytes|
 |varint|Integer value of arbitrary size|
 |bytea|Hex-encoded strings (converted directly to the corresponding bytes)|

Modified: cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g?rev=1090798&r1=1090797&r2=1090798&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g Sun Apr 10 13:39:11 2011
@@ -342,7 +342,7 @@ dropColumnFamilyStatement returns [Strin
     ;
 
 comparatorType
-    : 'bytea' | 'ascii' | 'text' | 'varchar' | 'varint' | 'bigint' | 'uuid'
+    : 'bytea' | 'ascii' | 'text' | 'varchar' | 'int' | 'varint' | 'bigint' | 'uuid'
     ;
 
 term returns [Term item]

Modified: cassandra/trunk/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java?rev=1090798&r1=1090797&r2=1090798&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java Sun Apr 10 13:39:11 2011
@@ -68,8 +68,10 @@ public class CreateColumnFamilyStatement
         comparators.put("text", "UTF8Type");
         comparators.put("varchar", "UTF8Type");
         comparators.put("varint", "IntegerType");
+        comparators.put("int", "LongType");
         comparators.put("bigint", "LongType");
         comparators.put("uuid", "UUIDType");
+
         keywords.add(KW_COMPARATOR);
         keywords.add(KW_COMMENT);
         keywords.add(KW_ROWCACHESIZE);

Modified: cassandra/trunk/test/system/test_cql.py
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/system/test_cql.py?rev=1090798&r1=1090797&r2=1090798&view=diff
==============================================================================
--- cassandra/trunk/test/system/test_cql.py (original)
+++ cassandra/trunk/test/system/test_cql.py Sun Apr 10 13:39:11 2011
@@ -68,7 +68,7 @@ def load_sample(dbconn):
             WITH comparator = ascii AND default_validation = uuid;
     """)
     dbconn.execute("""
-        CREATE COLUMNFAMILY IndexedA (KEY text PRIMARY KEY, birthdate bigint)
+        CREATE COLUMNFAMILY IndexedA (KEY text PRIMARY KEY, birthdate int)
             WITH comparator = ascii AND default_validation = ascii;
     """)
     dbconn.execute("CREATE INDEX ON IndexedA (birthdate)")