<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>DataStax Support Forums &#187; Topic: Empty key illegal? Seeing InvalidRequestException on multiget_slice.</title>
		<link>http://www.datastax.com/support-forums/topic/empty-key-illegal-seeing-invalidrequestexception-on-multiget_slice</link>
		<description>Software, Support, and Training for Apache Cassandra</description>
		<language>en-US</language>
		<pubDate>Wed, 19 Jun 2013 05:49:47 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.3</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.datastax.com/support-forums/search.php</link>
		</textInput>
		<atom:link href="http://www.datastax.com/support-forums/rss/topic/empty-key-illegal-seeing-invalidrequestexception-on-multiget_slice" rel="self" type="application/rss+xml" />

		<item>
			<title>khahn on "Empty key illegal? Seeing InvalidRequestException on multiget_slice."</title>
			<link>http://www.datastax.com/support-forums/topic/empty-key-illegal-seeing-invalidrequestexception-on-multiget_slice#post-1360</link>
			<pubDate>Tue, 13 Mar 2012 00:08:33 +0000</pubDate>
			<dc:creator>khahn</dc:creator>
			<guid isPermaLink="false">1360@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Sorry you had a hard time finding the information you needed in the docs. The About Columns section of the documentation on &#60;a href=&#34;http://www.datastax.com/docs/1.0/ddl/column_family&#34; rel=&#34;nofollow&#34;&#62;http://www.datastax.com/docs/1.0/ddl/column_family&#60;/a&#62; says that each row is uniquely identified by its row key, similar to a primary key in a relational table. We need to make it clear that empty row keys are not allowed (any array of bytes will not do). Thanks for letting us know.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Empty key illegal? Seeing InvalidRequestException on multiget_slice."</title>
			<link>http://www.datastax.com/support-forums/topic/empty-key-illegal-seeing-invalidrequestexception-on-multiget_slice#post-1359</link>
			<pubDate>Mon, 12 Mar 2012 21:30:29 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1359@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Ok. Is this communicated in documentation somewhere? I hit the issue because this particular app is driven by the keys from a non-nullable string primary key field from a SQL database table in my system. I assumed that no additional validation would be necessary in my application layer, which I've since fixed.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jbellis on "Empty key illegal? Seeing InvalidRequestException on multiget_slice."</title>
			<link>http://www.datastax.com/support-forums/topic/empty-key-illegal-seeing-invalidrequestexception-on-multiget_slice#post-1357</link>
			<pubDate>Mon, 12 Mar 2012 20:00:46 +0000</pubDate>
			<dc:creator>jbellis</dc:creator>
			<guid isPermaLink="false">1357@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Empty column values are allowed, but not empty row keys (or column names).
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Empty key illegal? Seeing InvalidRequestException on multiget_slice."</title>
			<link>http://www.datastax.com/support-forums/topic/empty-key-illegal-seeing-invalidrequestexception-on-multiget_slice#post-1356</link>
			<pubDate>Mon, 12 Mar 2012 19:56:17 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1356@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Ok, it makes more sense now. So Cassandra internally depends on the fact that in each cluster there must exist a token which is comparatively less than the tokens of all allowable keys, and for the provided ordered partitioners it uses plain representations of the keys as token values, so the minimum possible key has to be disallowed.&#60;/p&#62;
&#60;p&#62;From an external point of view this was definitely not obvious. I would not equate it to supporting null primary keys in a database. If I create a table in my SQL database with a non-nullable primary key string field, I can still create a record with an empty string primary key. The documentation (and source) for the BytesType validator also suggest that any arbitrary ByteBuffer is supported, including an empty (non-null) one.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>tjake on "Empty key illegal? Seeing InvalidRequestException on multiget_slice."</title>
			<link>http://www.datastax.com/support-forums/topic/empty-key-illegal-seeing-invalidrequestexception-on-multiget_slice#post-1354</link>
			<pubDate>Mon, 12 Mar 2012 18:57:01 +0000</pubDate>
			<dc:creator>tjake</dc:creator>
			<guid isPermaLink="false">1354@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Internally partitioners have a concept of a MINIMUM token, in the case of a Byte ordered partitioner we use &#34;&#34; as the minimum token so it is reserved.  I guess for RP we technically could support &#34;&#34; but I would equate it to supporting null primary keys in a database which is probably a bad idea, since many apps don't ever want to have a primary key == &#34;&#34;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Empty key illegal? Seeing InvalidRequestException on multiget_slice."</title>
			<link>http://www.datastax.com/support-forums/topic/empty-key-illegal-seeing-invalidrequestexception-on-multiget_slice#post-1353</link>
			<pubDate>Mon, 12 Mar 2012 18:49:25 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1353@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;This doesn't quite make sense to me. Key + partitioner should resolve to a token which identifies where in the ring the row lives. So is there a limitation that partitioners don't have to be able to resolve tokens for empty keys? The RandomPartitioner just returns an MD5 hash of the key. Certainly it could return the MD5 hash for an empty byte string (d41d8cd98f00b204e9800998ecf8427e). Or am I missing something?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>tjake on "Empty key illegal? Seeing InvalidRequestException on multiget_slice."</title>
			<link>http://www.datastax.com/support-forums/topic/empty-key-illegal-seeing-invalidrequestexception-on-multiget_slice#post-1352</link>
			<pubDate>Mon, 12 Mar 2012 16:16:46 +0000</pubDate>
			<dc:creator>tjake</dc:creator>
			<guid isPermaLink="false">1352@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Yes it is intended Keys are used to identify where in the ring the row lives.  So a null or empty key makes no sense.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Empty key illegal? Seeing InvalidRequestException on multiget_slice."</title>
			<link>http://www.datastax.com/support-forums/topic/empty-key-illegal-seeing-invalidrequestexception-on-multiget_slice#post-1350</link>
			<pubDate>Mon, 12 Mar 2012 14:45:55 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1350@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;My Java app using raw thrift is getting an InvalidRequestException when calling multiget_slice with one row key being an empty ByteBuffer. I see code in org.apache.cassandra.thrift.ThriftValidation in the validateKey method which throws InvalidRequestException if the key is empty, so it seems this is the intended behavior. Is this indeed intended? Everywhere I have found discussing row keys states that any array of bytes will do. Is there documentation somewhere stating that empty keys are invalid? (I've fixed my app to disallow empty keys at the app level but I'm still curious.)
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
