瀏覽代碼

Merge pull request #314 from relops/bogus_types

Fix bugs in Cassandra internal type resolution
Chris Bannister 10 年之前
父節點
當前提交
90867bbc53
共有 2 個文件被更改,包括 6 次插入5 次删除
  1. 3 3
      helpers.go
  2. 3 2
      marshal_test.go

+ 3 - 3
helpers.go

@@ -82,7 +82,7 @@ func getApacheCassandraType(class string) Type {
 			return TypeFloat
 		case "Int32Type":
 			return TypeInt
-		case "DateType":
+		case "DateType", "TimestampType":
 			return TypeTimestamp
 		case "UUIDType":
 			return TypeUUID
@@ -97,9 +97,9 @@ func getApacheCassandraType(class string) Type {
 		case "MapType":
 			return TypeMap
 		case "ListType":
-			return TypeInet
+			return TypeList
 		case "SetType":
-			return TypeInet
+			return TypeSet
 		}
 	}
 	return TypeCustom

+ 3 - 2
marshal_test.go

@@ -659,14 +659,15 @@ var typeLookupTest = []struct {
 	{"FloatType", TypeFloat},
 	{"Int32Type", TypeInt},
 	{"DateType", TypeTimestamp},
+	{"TimestampType", TypeTimestamp},
 	{"UUIDType", TypeUUID},
 	{"UTF8Type", TypeVarchar},
 	{"IntegerType", TypeVarint},
 	{"TimeUUIDType", TypeTimeUUID},
 	{"InetAddressType", TypeInet},
 	{"MapType", TypeMap},
-	{"ListType", TypeInet},
-	{"SetType", TypeInet},
+	{"ListType", TypeList},
+	{"SetType", TypeSet},
 	{"unknown", TypeCustom},
 }