Skip to content

Commit

Permalink
Merge pull request apache#314 from relops/bogus_types
Browse files Browse the repository at this point in the history
Fix bugs in Cassandra internal type resolution
  • Loading branch information
Zariel committed Mar 4, 2015
2 parents a979e19 + 84a4bd0 commit c6852bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions marshal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
}

Expand Down

0 comments on commit c6852bb

Please sign in to comment.