Netflix / astyanax

Cassandra Java Client
Apache License 2.0
1.04k stars 355 forks source link

Feature request - provide a method to determine the column types in a dynamic column family #245

Open mohammedguller opened 11 years ago

mohammedguller commented 11 years ago

Hi - It would be great if a method could be added to the ColumnList interface that would allow one to determine the type of a column (useful when reading data from a dynamic column family). There is already a method called getColumnNames(), which allows one to determine dynamically created columns. However, in order to read the actual values, one has to also know the data types. That is where a method that looks something like this would help:

getColumnType(C columnName)

Thanks, Mohammed

elandau commented 11 years ago

Are you using mostly CQL or thrift? For CQL this information is actually returned in the response and can be extracted. I will likely add this functionality anyway since I'll need it for a new cassandra admin tool that I'm working on. If using thrift this would require an additional call to cassandra in order to get the column metadata. The response could be cached and stored on the first call to getColumnType but we'll need to put a TTL so that any changes to the column metadata would be picked up by the clients.

mohammedguller commented 11 years ago

I am using only CQL. Glad to hear that you were already thinking of adding this functionality. I think that a lot of people will find this functionality useful.

Any idea when you might be able to start implementing this functionality?

Thanks.

elandau commented 11 years ago

I'll try to get this in by the end of next week.

mohammedguller commented 11 years ago

Fantastic! Thank you very much.

mohammedguller commented 11 years ago

Hi - I was wondering if you got chance to work on this new feature? Thanks.

ghost commented 11 years ago

:+1: