cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eev...@apache.org
Subject svn commit: r1164692 - in /cassandra/trunk/drivers/java: src/org/apache/cassandra/cql/jdbc/ test/org/apache/cassandra/cql/
Date Fri, 02 Sep 2011 20:26:41 GMT
Author: eevans
Date: Fri Sep  2 20:26:39 2011
New Revision: 1164692

URL: http://svn.apache.org/viewvc?rev=1164692&view=rev
Log:
convert drivers (and tests) to o.a.c.cql.term

Patch by eevans; reviewed by Rick Shaw for CASSANDRA-2936

Modified:
    cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CResultSet.java
    cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraPreparedStatement.java
    cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/ColumnDecoder.java
    cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/TypedColumn.java
    cassandra/trunk/drivers/java/test/org/apache/cassandra/cql/JdbcDriverTest.java

Modified: cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CResultSet.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CResultSet.java?rev=1164692&r1=1164691&r2=1164692&view=diff
==============================================================================
--- cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CResultSet.java (original)
+++ cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CResultSet.java Fri Sep
 2 20:26:39 2011
@@ -30,7 +30,7 @@ import java.sql.*;
 import java.sql.Date;
 import java.util.*;
 
-import org.apache.cassandra.db.marshal.CounterColumnType;
+import org.apache.cassandra.cql.term.CounterColumnTerm;
 import org.apache.cassandra.thrift.Column;
 import org.apache.cassandra.thrift.CqlResult;
 import org.apache.cassandra.thrift.CqlRow;
@@ -999,7 +999,7 @@ public class CResultSet extends Abstract
         public boolean isAutoIncrement(int column) throws SQLException
         {
             checkIndex(column);
-            return values.get(column - 1).getValueType() instanceof CounterColumnType; //
todo: check Value is correct.
+            return values.get(column - 1).getValueType() instanceof CounterColumnTerm; //
todo: check Value is correct.
         }
 
         public boolean isCaseSensitive(int column) throws SQLException

Modified: cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraPreparedStatement.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraPreparedStatement.java?rev=1164692&r1=1164691&r2=1164692&view=diff
==============================================================================
--- cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraPreparedStatement.java
(original)
+++ cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraPreparedStatement.java
Fri Sep  2 20:26:39 2011
@@ -26,7 +26,7 @@ import static org.apache.cassandra.cql.j
 import static org.apache.cassandra.cql.jdbc.Utils.NO_COMPARATOR;
 import static org.apache.cassandra.cql.jdbc.Utils.NO_VALIDATOR;
 
-import org.apache.cassandra.db.marshal.*;
+import org.apache.cassandra.cql.term.AbstractTerm;
 
 import java.io.InputStream;
 import java.io.Reader;
@@ -88,7 +88,7 @@ public class CassandraPreparedStatement 
     }
 
     // null type means just call param.toString() and quote it (default for keys).
-    private static String applySimpleBindings(String q, AbstractType type, ParameterIterator
params) throws SQLException
+    private static String applySimpleBindings(String q, AbstractTerm type, ParameterIterator
params) throws SQLException
     {
         assert type != null;
         // we need to keep track of whether or not we are between quotes and ignore any question
marks within them
@@ -125,7 +125,7 @@ public class CassandraPreparedStatement 
         return sb.toString();
     }
 
-    private static String applyDualBindings(String q, AbstractType ltype, AbstractType rtype,
ParameterIterator params) throws SQLException
+    private static String applyDualBindings(String q, AbstractTerm ltype, AbstractTerm rtype,
ParameterIterator params) throws SQLException
     {
         StringBuffer sb = new StringBuffer();
         boolean between = false;
@@ -144,7 +144,7 @@ public class CassandraPreparedStatement 
                 try
                 {
                     Object param = params.nextParam();
-                    AbstractType type = left ? ltype : rtype;
+                    AbstractTerm type = left ? ltype : rtype;
                     String stringParam = makeCqlString(type.toString(param));
                     if (type.needsQuotes())
                         stringParam = "'" + stringParam + "'";
@@ -191,12 +191,12 @@ public class CassandraPreparedStatement 
 
         ParameterIterator params = new ParameterIterator();
         String left = cql.substring(0, pivot);
-        AbstractType leftType = connection.decoder.getComparator(keyspace, columnFamily);
+        AbstractTerm leftType = connection.decoder.getComparator(keyspace, columnFamily);
         if (leftType == null) throw new SQLDataException(String.format(NO_COMPARATOR, keyspace,
columnFamily));
         left = applySimpleBindings(left, leftType, params);
 
         String right = cql.substring(pivot);
-        AbstractType keyVald = connection.decoder.getKeyValidator(keyspace, columnFamily);
+        AbstractTerm keyVald = connection.decoder.getKeyValidator(keyspace, columnFamily);
         if (keyVald == null) throw new SQLDataException(String.format(NO_VALIDATOR, keyspace,
columnFamily));
         right = applySimpleBindings(right, keyVald, params);
         return left + right;
@@ -211,12 +211,12 @@ public class CassandraPreparedStatement 
 
         ParameterIterator params = new ParameterIterator();
         String left = cql.substring(0, pivot);
-        AbstractType leftType = connection.decoder.getComparator(keyspace, columnFamily);
+        AbstractTerm leftType = connection.decoder.getComparator(keyspace, columnFamily);
         if (leftType == null) throw new SQLDataException(String.format(NO_COMPARATOR, keyspace,
columnFamily));
         left = applySimpleBindings(left, leftType, params);
 
         String right = cql.substring(pivot);
-        AbstractType keyVald = connection.decoder.getKeyValidator(keyspace, columnFamily);
+        AbstractTerm keyVald = connection.decoder.getKeyValidator(keyspace, columnFamily);
         if (keyVald == null) throw new SQLDataException(String.format(NO_VALIDATOR, keyspace,
columnFamily));
         right = applySimpleBindings(right, keyVald, params);
         return left + right;
@@ -233,15 +233,15 @@ public class CassandraPreparedStatement 
 
         ParameterIterator params = new ParameterIterator();
         String left = cql.substring(0, pivot);
-        AbstractType leftComp = connection.decoder.getComparator(keyspace, columnFamily);
+        AbstractTerm leftComp = connection.decoder.getComparator(keyspace, columnFamily);
         if (leftComp == null) throw new SQLDataException(String.format(NO_COMPARATOR, keyspace,
columnFamily));
 
-        AbstractType leftVald = connection.decoder.getComparator(keyspace, columnFamily);
+        AbstractTerm leftVald = connection.decoder.getComparator(keyspace, columnFamily);
         if (leftVald == null) throw new SQLDataException(String.format(NO_VALIDATOR, keyspace,
columnFamily));
         left = applyDualBindings(left, leftComp, leftVald, params);
 
         String right = cql.substring(pivot);
-        AbstractType keyVald = connection.decoder.getKeyValidator(keyspace, columnFamily);
+        AbstractTerm keyVald = connection.decoder.getKeyValidator(keyspace, columnFamily);
         if (keyVald == null) throw new SQLDataException(String.format(NO_VALIDATOR, keyspace,
columnFamily));
         right = applySimpleBindings(right, keyVald, params);
         return left + right;

Modified: cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/ColumnDecoder.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/ColumnDecoder.java?rev=1164692&r1=1164691&r2=1164692&view=diff
==============================================================================
--- cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/ColumnDecoder.java (original)
+++ cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/ColumnDecoder.java Fri
Sep  2 20:26:39 2011
@@ -20,12 +20,9 @@ package org.apache.cassandra.cql.jdbc;
  * 
  */
 
-
-import org.apache.cassandra.config.CFMetaData;
-import org.apache.cassandra.config.ColumnDefinition;
-import org.apache.cassandra.config.ConfigurationException;
-import org.apache.cassandra.db.marshal.AbstractType;
-import org.apache.cassandra.db.marshal.AsciiType;
+import org.apache.cassandra.cql.term.AbstractTerm;
+import org.apache.cassandra.cql.term.AsciiTerm;
+import org.apache.cassandra.cql.term.TypesMap;
 import org.apache.cassandra.thrift.*;
 import org.apache.cassandra.utils.ByteBufferUtil;
 
@@ -34,6 +31,7 @@ import org.apache.cassandra.utils.ByteBu
 
 import java.nio.ByteBuffer;
 import java.nio.charset.CharacterCodingException;
+import java.sql.SQLNonTransientException;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -43,9 +41,30 @@ import java.util.Map;
  */
 class ColumnDecoder
 {
+    public final static ByteBuffer DEFAULT_KEY_NAME = ByteBufferUtil.bytes("KEY");
 //    private static final Logger logger = LoggerFactory.getLogger(ColumnDecoder.class);
 
-    private final Map<String, CFMetaData> metadata = new HashMap<String, CFMetaData>();
+    private class CFamMeta
+    {
+        String comparator;
+        String defaultValidator;
+        ByteBuffer keyAlias;
+        String keyValidator;
+        Map<ByteBuffer, String> columnMeta = new HashMap<ByteBuffer, String>();
+        
+        private CFamMeta(CfDef cf)
+        {
+            comparator = cf.getComparator_type();
+            defaultValidator = cf.getDefault_validation_class();
+            keyAlias = cf.key_alias;
+            keyValidator = cf.getKey_validation_class();
+            
+            for (ColumnDef colDef : cf.getColumn_metadata())
+                columnMeta.put(colDef.name, colDef.getValidation_class());
+        }
+    }
+
+    private final Map<String, CFamMeta> metadata = new HashMap<String, CFamMeta>();
 
     /**
      * is specific per set of keyspace definitions.
@@ -53,72 +72,63 @@ class ColumnDecoder
     public ColumnDecoder(List<KsDef> defs)
     {
         for (KsDef ks : defs)
-        {
             for (CfDef cf : ks.getCf_defs())
-            {
-                try
-                {
-                    metadata.put(String.format("%s.%s", ks.getName(), cf.getName()), CFMetaData.fromThrift(cf));
-                }
-                catch (InvalidRequestException e)
-                {
-                    throw new RuntimeException(e);
-                }
-                catch (ConfigurationException e)
-                {
-                    throw new RuntimeException(e);
-                }
-            }
-        }
+                metadata.put(String.format("%s.%s", ks.getName(), cf.getName()), new CFamMeta(cf));
     }
 
-    AbstractType<?> getComparator(String keyspace, String columnFamily)
+    AbstractTerm<?> getComparator(String keyspace, String columnFamily)
     {
-        CFMetaData md = metadata.get(String.format("%s.%s", keyspace, columnFamily));
-        return (md == null) ? null : md.comparator;
+        CFamMeta cf = metadata.get(String.format("%s.%s", keyspace, columnFamily));
+        AbstractTerm<?> type = (cf != null) ? TypesMap.getTermForComparator(cf.comparator)
: null;
+        return (type == null) ? null : type;
     }
 
-    AbstractType<?> getNameType(String keyspace, String columnFamily, ByteBuffer name)
+    AbstractTerm<?> getNameType(String keyspace, String columnFamily, ByteBuffer name)
     {
-        CFMetaData md = metadata.get(String.format("%s.%s", keyspace, columnFamily));
+        CFamMeta cf = metadata.get(String.format("%s.%s", keyspace, columnFamily));
         try
         {
-            if (ByteBufferUtil.string(name).equalsIgnoreCase(ByteBufferUtil.string(md.getKeyName())))
-                return AsciiType.instance;
+            if (ByteBufferUtil.string(name).equalsIgnoreCase(ByteBufferUtil.string(cf.keyAlias)))
+                return AsciiTerm.instance;
         }
         catch (CharacterCodingException e)
         {
             // not be the key name
         }
-        return md.comparator;
+        return TypesMap.getTermForComparator(cf.comparator);
     }
 
-    AbstractType<?> getValueType(String keyspace, String columnFamily, ByteBuffer name)
+    AbstractTerm<?> getValueType(String keyspace, String columnFamily, ByteBuffer name)
     {
-        CFMetaData md = metadata.get(String.format("%s.%s", keyspace, columnFamily));
+        CFamMeta cf = metadata.get(String.format("%s.%s", keyspace, columnFamily));
+        if (cf == null)
+            return null;
+        
         try
         {
-            if (ByteBufferUtil.string(name).equalsIgnoreCase(ByteBufferUtil.string(md.getKeyName())))
-                return md.getKeyValidator();
+            if (ByteBufferUtil.string(name).equalsIgnoreCase(ByteBufferUtil.string(cf.keyAlias)))
+                return TypesMap.getTermForComparator(cf.keyValidator);
         }
         catch (CharacterCodingException e)
         {
             // not be the key name
         }
-        ColumnDefinition cd = md.getColumnDefinition(name);
-        return cd == null ? md.getDefaultValidator() : cd.getValidator();
+        
+        AbstractTerm<?> type = TypesMap.getTermForComparator(cf.columnMeta.get(name));
+        return (type != null) ? type : TypesMap.getTermForComparator(cf.defaultValidator);
     }
 
-    public AbstractType<?> getKeyValidator(String keyspace, String columnFamily)
+    public AbstractTerm<?> getKeyValidator(String keyspace, String columnFamily)
     {
-        CFMetaData md = metadata.get(String.format("%s.%s", keyspace, columnFamily));
-        return (md == null) ? null : md.getKeyValidator();
+        CFamMeta cf = metadata.get(String.format("%s.%s", keyspace, columnFamily));
+        AbstractTerm<?> type = (cf != null) ? TypesMap.getTermForComparator(cf.keyValidator)
: null;
+        return (type == null) ? null : type;
     }
 
     /** uses the AbstractType to map a column name to a string. */
     public String colNameAsString(String keyspace, String columnFamily, ByteBuffer name)
     {
-        AbstractType<?> comparator = getNameType(keyspace, columnFamily, name);
+        AbstractTerm<?> comparator = getNameType(keyspace, columnFamily, name);
         return comparator.getString(name);
     }
 
@@ -130,13 +140,19 @@ class ColumnDecoder
                                getValueType(keyspace, columnFamily, column.name));
     }
 
-    /** constructs a typed column to hold the key */
-    public TypedColumn makeKeyColumn(String keyspace, String columnFamily, byte[] key)
-    {
-        CFMetaData md = metadata.get(String.format("%s.%s", keyspace, columnFamily));
-        Column column = new Column(md.getKeyName()).setValue(key).setTimestamp(-1);
+    /** constructs a typed column to hold the key
+     * @throws SQLNonTransientException */
+    public TypedColumn makeKeyColumn(String keyspace, String columnFamily, byte[] key) throws
SQLNonTransientException
+    {
+        CFamMeta cf = metadata.get(String.format("%s.%s", keyspace, columnFamily));
+        if (cf == null)
+            throw new SQLNonTransientException(String.format("could not find decoder metadata
for: %s.%s",
+                                                                       keyspace,
+                                                                       columnFamily));
+
+        Column column = new Column(cf.keyAlias).setValue(key).setTimestamp(-1);
         return new TypedColumn(column,
-                               getNameType(keyspace, columnFamily, md.getKeyName()),
-                               getValueType(keyspace, columnFamily, md.getKeyName()));
+                               getNameType(keyspace, columnFamily, (cf.keyAlias != null)
? cf.keyAlias : DEFAULT_KEY_NAME),
+                               getValueType(keyspace, columnFamily, (cf.keyAlias != null)
? cf.keyAlias : DEFAULT_KEY_NAME));
     }
 }

Modified: cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/TypedColumn.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/TypedColumn.java?rev=1164692&r1=1164691&r2=1164692&view=diff
==============================================================================
--- cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/TypedColumn.java (original)
+++ cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/TypedColumn.java Fri Sep
 2 20:26:39 2011
@@ -21,7 +21,7 @@ package org.apache.cassandra.cql.jdbc;
  */
 
 
-import org.apache.cassandra.db.marshal.AbstractType;
+import org.apache.cassandra.cql.term.AbstractTerm;
 import org.apache.cassandra.thrift.Column;
 
 
@@ -34,9 +34,9 @@ public class TypedColumn
     // (a good example is byte buffers).
     private final Object value;
     private final String nameString;
-    private final AbstractType<?> nameType, valueType;
+    private final AbstractTerm<?> nameType, valueType;
 
-    public TypedColumn(Column column, AbstractType<?> comparator, AbstractType<?>
validator)
+    public TypedColumn(Column column, AbstractTerm<?> comparator, AbstractTerm<?>
validator)
     {
         rawColumn = column;
         this.value = column.value == null ? null : validator.compose(column.value);
@@ -65,12 +65,12 @@ public class TypedColumn
         return valueType.getString(rawColumn.value);
     }
     
-    public AbstractType getNameType()
+    public AbstractTerm getNameType()
     {
         return nameType;
     }
 
-    public AbstractType getValueType()
+    public AbstractTerm getValueType()
     {
         return valueType;
     }

Modified: cassandra/trunk/drivers/java/test/org/apache/cassandra/cql/JdbcDriverTest.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/drivers/java/test/org/apache/cassandra/cql/JdbcDriverTest.java?rev=1164692&r1=1164691&r2=1164692&view=diff
==============================================================================
--- cassandra/trunk/drivers/java/test/org/apache/cassandra/cql/JdbcDriverTest.java (original)
+++ cassandra/trunk/drivers/java/test/org/apache/cassandra/cql/JdbcDriverTest.java Fri Sep
 2 20:26:39 2011
@@ -31,12 +31,15 @@ import java.util.Iterator;
 import java.util.List;
 
 import org.apache.cassandra.cql.jdbc.CassandraResultSet;
+import org.apache.cassandra.cql.term.AsciiTerm;
+import org.apache.cassandra.cql.term.BytesTerm;
+import org.apache.cassandra.cql.term.IntegerTerm;
+import org.apache.cassandra.cql.term.LongTerm;
+import org.apache.cassandra.cql.term.UTF8Term;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import org.apache.cassandra.db.marshal.*;
-import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.FBUtilities;
 
 import static junit.framework.Assert.assertEquals;
@@ -138,9 +141,9 @@ public class JdbcDriverTest extends Embe
         
         ResultSetMetaData md = rs.getMetaData();
         assert md.getColumnCount() == 3;
-        expectedMetaData(md, 1, BigInteger.class.getName(), "JdbcInteger", "Keyspace1", "1",
Types.BIGINT, IntegerType.class.getSimpleName(), true, false);
-        expectedMetaData(md, 2, BigInteger.class.getName(), "JdbcInteger", "Keyspace1", "2",
Types.BIGINT, IntegerType.class.getSimpleName(), true, false);
-        expectedMetaData(md, 3, String.class.getName(), "JdbcInteger", "Keyspace1", "42",
Types.VARCHAR, UTF8Type.class.getSimpleName(), false, true);
+        expectedMetaData(md, 1, BigInteger.class.getName(), "JdbcInteger", "Keyspace1", "1",
Types.BIGINT, IntegerTerm.class.getSimpleName(), true, false);
+        expectedMetaData(md, 2, BigInteger.class.getName(), "JdbcInteger", "Keyspace1", "2",
Types.BIGINT, IntegerTerm.class.getSimpleName(), true, false);
+        expectedMetaData(md, 3, String.class.getName(), "JdbcInteger", "Keyspace1", "42",
Types.VARCHAR, UTF8Term.class.getSimpleName(), false, true);
         
         rs = stmt.executeQuery("select key, 1, 2, 42 from JdbcInteger where key='" + key
+ "'");
         assert rs.next();
@@ -156,9 +159,9 @@ public class JdbcDriverTest extends Embe
         assert rs.getInt("fortytwo") == 4242L;
         
         md = rs.getMetaData();
-        expectedMetaData(md, 1, String.class.getName(), "JdbcUtf8", "Keyspace1", "a", Types.VARCHAR,
UTF8Type.class.getSimpleName(), false, true);
-        expectedMetaData(md, 2, String.class.getName(), "JdbcUtf8", "Keyspace1", "b", Types.VARCHAR,
UTF8Type.class.getSimpleName(), false, true);
-        expectedMetaData(md, 3, BigInteger.class.getName(), "JdbcUtf8", "Keyspace1", "fortytwo",
Types.BIGINT, IntegerType.class.getSimpleName(), true, false);
+        expectedMetaData(md, 1, String.class.getName(), "JdbcUtf8", "Keyspace1", "a", Types.VARCHAR,
UTF8Term.class.getSimpleName(), false, true);
+        expectedMetaData(md, 2, String.class.getName(), "JdbcUtf8", "Keyspace1", "b", Types.VARCHAR,
UTF8Term.class.getSimpleName(), false, true);
+        expectedMetaData(md, 3, BigInteger.class.getName(), "JdbcUtf8", "Keyspace1", "fortytwo",
Types.BIGINT, IntegerTerm.class.getSimpleName(), true, false);
     }
         
     @Test
@@ -174,11 +177,11 @@ public class JdbcDriverTest extends Embe
         
         ResultSetMetaData md = rs.getMetaData();
         assert md.getColumnCount() == 2;
-        expectedMetaData(md, 1, Long.class.getName(), "JdbcLong", "Keyspace1", "1", Types.INTEGER,
LongType.class.getSimpleName(), true, false);
-        expectedMetaData(md, 2, Long.class.getName(), "JdbcLong", "Keyspace1", "2", Types.INTEGER,
LongType.class.getSimpleName(), true, false);
+        expectedMetaData(md, 1, Long.class.getName(), "JdbcLong", "Keyspace1", "1", Types.INTEGER,
LongTerm.class.getSimpleName(), true, false);
+        expectedMetaData(md, 2, Long.class.getName(), "JdbcLong", "Keyspace1", "2", Types.INTEGER,
LongTerm.class.getSimpleName(), true, false);
         
         for (int i = 0; i < md.getColumnCount(); i++)
-            expectedMetaData(md, i + 1, Long.class.getName(), Types.INTEGER, LongType.class.getSimpleName(),
true, false);
+            expectedMetaData(md, i + 1, Long.class.getName(), Types.INTEGER, LongTerm.class.getSimpleName(),
true, false);
     }
 
     @Test
@@ -200,12 +203,12 @@ public class JdbcDriverTest extends Embe
         
         ResultSetMetaData md = rs0.getMetaData();
         assert md.getColumnCount() == 2;
-        expectedMetaData(md, 1, String.class.getName(), "JdbcAscii", "Keyspace1", "a", Types.VARCHAR,
AsciiType.class.getSimpleName(), false, true);
-        expectedMetaData(md, 2, String.class.getName(), "JdbcAscii", "Keyspace1", "b", Types.VARCHAR,
AsciiType.class.getSimpleName(), false, true);
+        expectedMetaData(md, 1, String.class.getName(), "JdbcAscii", "Keyspace1", "a", Types.VARCHAR,
AsciiTerm.class.getSimpleName(), false, true);
+        expectedMetaData(md, 2, String.class.getName(), "JdbcAscii", "Keyspace1", "b", Types.VARCHAR,
AsciiTerm.class.getSimpleName(), false, true);
         md = rs1.getMetaData();
         assert md.getColumnCount() == 2;
-        expectedMetaData(md, 1, String.class.getName(), "JdbcUtf8", "Keyspace1", "a", Types.VARCHAR,
UTF8Type.class.getSimpleName(), false, true);
-        expectedMetaData(md, 2, String.class.getName(), "JdbcUtf8", "Keyspace1", "b", Types.VARCHAR,
UTF8Type.class.getSimpleName(), false, true);
+        expectedMetaData(md, 1, String.class.getName(), "JdbcUtf8", "Keyspace1", "a", Types.VARCHAR,
UTF8Term.class.getSimpleName(), false, true);
+        expectedMetaData(md, 2, String.class.getName(), "JdbcUtf8", "Keyspace1", "b", Types.VARCHAR,
UTF8Term.class.getSimpleName(), false, true);
 
         for (int i = 0; i < 2; i++)
         {
@@ -213,14 +216,14 @@ public class JdbcDriverTest extends Embe
                              i + 1,
                              String.class.getName(),
                              Types.VARCHAR,
-                             AsciiType.class.getSimpleName(),
+                             AsciiTerm.class.getSimpleName(),
                              false,
                              true);
             expectedMetaData(rs1.getMetaData(),
                              i + 1,
                              String.class.getName(),
                              Types.VARCHAR,
-                             UTF8Type.class.getSimpleName(),
+                             UTF8Term.class.getSimpleName(),
                              false,
                              true);
 
@@ -253,11 +256,11 @@ public class JdbcDriverTest extends Embe
         assert Arrays.equals(bb, rs.getBytes(FBUtilities.bytesToHex(b)));
         ResultSetMetaData md = rs.getMetaData();
         assert md.getColumnCount() == 2;
-        expectedMetaData(md, 1, ByteBuffer.class.getName(), "JdbcBytes", "Keyspace1", FBUtilities.bytesToHex(a),
Types.BINARY, BytesType.class.getSimpleName(), false, false);
-        expectedMetaData(md, 2, ByteBuffer.class.getName(), "JdbcBytes", "Keyspace1", FBUtilities.bytesToHex(b),
Types.BINARY, BytesType.class.getSimpleName(), false, false);
+        expectedMetaData(md, 1, ByteBuffer.class.getName(), "JdbcBytes", "Keyspace1", FBUtilities.bytesToHex(a),
Types.BINARY, BytesTerm.class.getSimpleName(), false, false);
+        expectedMetaData(md, 2, ByteBuffer.class.getName(), "JdbcBytes", "Keyspace1", FBUtilities.bytesToHex(b),
Types.BINARY, BytesTerm.class.getSimpleName(), false, false);
         
         for (int i = 0; i < md.getColumnCount(); i++)
-            expectedMetaData(md, i + 1, ByteBuffer.class.getName(), Types.BINARY, BytesType.class.getSimpleName(),
false, false);
+            expectedMetaData(md, i + 1, ByteBuffer.class.getName(), Types.BINARY, BytesTerm.class.getSimpleName(),
false, false);
     }
 
     @Test



Mime
View raw message