<?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: Storing Counters in Hive</title>
		<link>http://www.datastax.com/support-forums/topic/storing-counters-in-hive</link>
		<description>Software, Support, and Training for Apache Cassandra</description>
		<language>en-US</language>
		<pubDate>Tue, 21 May 2013 10:27:51 +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/storing-counters-in-hive" rel="self" type="application/rss+xml" />

		<item>
			<title>Anonymous on "Storing Counters in Hive"</title>
			<link>http://www.datastax.com/support-forums/topic/storing-counters-in-hive#post-1393</link>
			<pubDate>Tue, 20 Mar 2012 00:06:57 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1393@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;I am trying to store Counters CF from cassandra to Hive. Below is the CREATE TABLE syntax in Hive:&#60;/p&#62;
&#60;p&#62;DROP TABLE IF EXISTS Counters;&#60;br /&#62;
create external table Counters(row_key string, column_name string, value string)&#60;br /&#62;
STORED BY 'org.apache.hadoop.hive.cassandra.CassandraStorageHandler'&#60;br /&#62;
WITH SERDEPROPERTIES (&#34;cassandra.columns.mapping&#34; = &#34;:key,:column,:value&#34;,&#60;br /&#62;
  &#34;cassandra.ks.name&#34; = &#34;BAMSchema&#34;,&#60;br /&#62;
  &#34;cassandra.ks.repfactor&#34; = &#34;1&#34;,&#60;br /&#62;
  &#34;cassandra.ks.strategy&#34; = &#34;org.apache.cassandra.locator.SimpleStrategy&#34;,&#60;br /&#62;
  &#34;cassandra.cf.name&#34; = &#34;Counters&#34; ,&#60;br /&#62;
  &#34;cassandra.host&#34; = &#34;127.0.0.1&#34; ,&#60;br /&#62;
  &#34;cassandra.port&#34; = &#34;9160&#34;,&#60;br /&#62;
  &#34;cassandra.partitioner&#34; = &#34;org.apache.cassandra.dht.RandomPartitioner&#34;)&#60;br /&#62;
TBLPROPERTIES (&#60;br /&#62;
  &#34;cassandra.input.split.size&#34; = &#34;64000&#34;,&#60;br /&#62;
  &#34;cassandra.range.size&#34; = &#34;1000&#34;,&#60;br /&#62;
  &#34;cassandra.slice.predicate.size&#34; = &#34;1000&#34;); &#60;/p&#62;
&#60;p&#62;and Counter CF is defined as :&#60;/p&#62;
&#60;p&#62;create column family Counters&#60;br /&#62;
        with comparator = UTF8Type&#60;br /&#62;
        and default_validation_class=CounterColumnType&#60;br /&#62;
      and replicate_on_write=true;&#60;/p&#62;
&#60;p&#62;I am not able to import the Counter value in Hive. I am getting other row_key and column_name properly.&#60;/p&#62;
&#60;p&#62;Below is the output from Hive:&#60;/p&#62;
&#60;p&#62;hive&#38;gt; select * from Counters;&#60;br /&#62;
OK&#60;br /&#62;
213_debit_1326690000	1-sess_count	d&#60;br /&#62;
213_debit_1326690000	1-total_db_time&#60;br /&#62;
213_debit_1326690000	1-total_exec_time&#60;br /&#62;
213_debit_1326690000	1-txn_count&#60;br /&#62;
213_debit_1326690000	2-sess_count&#60;br /&#62;
213_debit_1326690000	2-total_db_time&#60;br /&#62;
213_debit_1326690000	2-total_exec_time&#60;br /&#62;
213_debit_1326690000	2-txn_count&#60;br /&#62;
Time taken: 0.263 seconds&#60;/p&#62;
&#60;p&#62;Below is output from Cassandra:&#60;/p&#62;
&#60;p&#62;[default@BAMSchema] list Counters;&#60;br /&#62;
Using default limit of 100&#60;br /&#62;
-------------------&#60;br /&#62;
RowKey: 213_debit_1326690000&#60;br /&#62;
=&#38;gt; (counter=1-sess_count, value=100)&#60;br /&#62;
=&#38;gt; (counter=1-total_db_time, value=20)&#60;br /&#62;
=&#38;gt; (counter=1-total_exec_time, value=30)&#60;br /&#62;
=&#38;gt; (counter=1-txn_count, value=1)&#60;br /&#62;
=&#38;gt; (counter=2-sess_count, value=30)&#60;br /&#62;
=&#38;gt; (counter=2-total_db_time, value=30)&#60;br /&#62;
=&#38;gt; (counter=2-total_exec_time, value=30)&#60;br /&#62;
=&#38;gt; (counter=2-txn_count, value=1)&#60;/p&#62;
&#60;p&#62;As you can see that &#34;d&#34; junk letter is getting added in Hive when import happens from Cassandra to Hive. Wondering what am I missing.&#60;/p&#62;
&#60;p&#62;Thanks for your help!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
