From 90604df3761146cf458c7a10e2f4bb7fb4e59999 Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Wed, 4 Feb 2015 14:19:42 +0100 Subject: [PATCH] cql3: Move method definition to the source file --- cql3/column_identifier.cc | 20 ++++++++++++++++++++ cql3/column_identifier.hh | 20 +------------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/cql3/column_identifier.cc b/cql3/column_identifier.cc index 0e36985f51..f501681e85 100644 --- a/cql3/column_identifier.cc +++ b/cql3/column_identifier.cc @@ -6,6 +6,26 @@ namespace cql3 { +::shared_ptr prepare_column_identifier(schema_ptr s) { +#if 0 + AbstractType comparator = cfm.comparator.asAbstractType(); + if (cfm.getIsDense() || comparator instanceof CompositeType || comparator instanceof UTF8Type) + return new ColumnIdentifier(text, true); + + // We have a Thrift-created table with a non-text comparator. We need to parse column names with the comparator + // to get the correct ByteBuffer representation. However, this doesn't apply to key aliases, so we need to + // make a special check for those and treat them normally. See CASSANDRA-8178. + ByteBuffer bufferName = ByteBufferUtil.bytes(text); + for (ColumnDefinition def : cfm.partitionKeyColumns()) + { + if (def.name.bytes.equals(bufferName)) + return new ColumnIdentifier(text, true); + } + return new ColumnIdentifier(comparator.fromString(rawText), text); +#endif + throw std::runtime_error("not implemented"); +} + std::ostream& operator<<(std::ostream& out, const column_identifier::raw& id) { return out << id._text; } diff --git a/cql3/column_identifier.hh b/cql3/column_identifier.hh index 4f50182330..6b976afb43 100644 --- a/cql3/column_identifier.hh +++ b/cql3/column_identifier.hh @@ -156,25 +156,7 @@ public: return prepare_column_identifier(s); } - ::shared_ptr prepare_column_identifier(schema_ptr s) { -#if 0 - AbstractType comparator = cfm.comparator.asAbstractType(); - if (cfm.getIsDense() || comparator instanceof CompositeType || comparator instanceof UTF8Type) - return new ColumnIdentifier(text, true); - - // We have a Thrift-created table with a non-text comparator. We need to parse column names with the comparator - // to get the correct ByteBuffer representation. However, this doesn't apply to key aliases, so we need to - // make a special check for those and treat them normally. See CASSANDRA-8178. - ByteBuffer bufferName = ByteBufferUtil.bytes(text); - for (ColumnDefinition def : cfm.partitionKeyColumns()) - { - if (def.name.bytes.equals(bufferName)) - return new ColumnIdentifier(text, true); - } - return new ColumnIdentifier(comparator.fromString(rawText), text); -#endif - throw std::runtime_error("not implemented"); - } + ::shared_ptr prepare_column_identifier(schema_ptr s); virtual bool processes_selection() const override { return false;