smiklosovic commented on code in PR #3562:
URL: https://github.com/apache/cassandra/pull/3562#discussion_r1917088261
##########
src/java/org/apache/cassandra/db/marshal/AbstractType.java:
##########
@@ -525,6 +547,16 @@ public <V> boolean isNull(V buffer, ValueAccessor<V>
accessor)
return getSerializer().isNull(buffer, accessor);
}
+ public boolean isNumber()
+ {
+ return this instanceof org.apache.cassandra.db.marshal.NumberType;
+ }
+
+ public boolean isString()
+ {
+ return this instanceof org.apache.cassandra.db.marshal.StringType;
Review Comment:
This is not so easy. I think you need to take into account also cases when a
type is so called _reversed_. (see ReversedType). That is a special type used
in a case if you have e.g. reverse ordering on a clustering column. You need to
`unwrap`, basically something like this:
````
public boolean isNumber()
{
return unwrap() instanceof
org.apache.cassandra.db.marshal.NumberType;
}
public boolean isString()
{
return unwrap() instanceof
org.apache.cassandra.db.marshal.StringType;
}
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]