<?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: Loading data into cassandra database using hector</title>
		<link>http://www.datastax.com/support-forums/topic/loading-data-into-cassandra-database-using-hector</link>
		<description>Software, Support, and Training for Apache Cassandra</description>
		<language>en-US</language>
		<pubDate>Tue, 21 May 2013 22:45:37 +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/loading-data-into-cassandra-database-using-hector" rel="self" type="application/rss+xml" />

		<item>
			<title>datastaxtesting on "Loading data into cassandra database using hector"</title>
			<link>http://www.datastax.com/support-forums/topic/loading-data-into-cassandra-database-using-hector#post-3739</link>
			<pubDate>Wed, 25 Jul 2012 15:07:54 +0000</pubDate>
			<dc:creator>datastaxtesting</dc:creator>
			<guid isPermaLink="false">3739@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Thanks xedin!!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>xedin on "Loading data into cassandra database using hector"</title>
			<link>http://www.datastax.com/support-forums/topic/loading-data-into-cassandra-database-using-hector#post-3709</link>
			<pubDate>Wed, 25 Jul 2012 09:12:56 +0000</pubDate>
			<dc:creator>xedin</dc:creator>
			<guid isPermaLink="false">3709@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;The idea is, in your while loop instead of pushing data to the C* you can just write it down to the CLI compatible file where every line would be &#34;set &#38;lt;cf&#38;gt;...&#34; instead of doing that manually.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>datastaxtesting on "Loading data into cassandra database using hector"</title>
			<link>http://www.datastax.com/support-forums/topic/loading-data-into-cassandra-database-using-hector#post-3653</link>
			<pubDate>Wed, 25 Jul 2012 01:13:17 +0000</pubDate>
			<dc:creator>datastaxtesting</dc:creator>
			<guid isPermaLink="false">3653@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;I have to put this command &#34;set &#38;lt;cf&#38;gt;[&#38;lt;key&#38;gt;][&#38;lt;column&#38;gt;] = 'value';&#34; 1 million times right?? I wrote the script for injecting data using set but using set 1 million times I am finding difficult. Is there any alternate way to parse csv inside script??
&#60;/p&#62;</description>
		</item>
		<item>
			<title>xedin on "Loading data into cassandra database using hector"</title>
			<link>http://www.datastax.com/support-forums/topic/loading-data-into-cassandra-database-using-hector#post-3643</link>
			<pubDate>Tue, 24 Jul 2012 20:49:19 +0000</pubDate>
			<dc:creator>xedin</dc:creator>
			<guid isPermaLink="false">3643@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;If you ask me if that is difficult, then I would have to tell no, it's not. Because you can check the file selectively and after you have loaded it into cassandra using CLI you can use 'count' command to check the number of inserted rows and do a selective &#34;get&#34; by key to check if all required columns are present. There is no need to check whole dataset by hand, at the last step you can modify your script to parse csv file and do get operations from C*, validate returned values to make sure that all of the data is there.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>datastaxtesting on "Loading data into cassandra database using hector"</title>
			<link>http://www.datastax.com/support-forums/topic/loading-data-into-cassandra-database-using-hector#post-3642</link>
			<pubDate>Tue, 24 Jul 2012 20:43:34 +0000</pubDate>
			<dc:creator>datastaxtesting</dc:creator>
			<guid isPermaLink="false">3642@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;i have 1 million data....using set for 1 million data is very difficult??
&#60;/p&#62;</description>
		</item>
		<item>
			<title>xedin on "Loading data into cassandra database using hector"</title>
			<link>http://www.datastax.com/support-forums/topic/loading-data-into-cassandra-database-using-hector#post-3640</link>
			<pubDate>Tue, 24 Jul 2012 20:11:45 +0000</pubDate>
			<dc:creator>xedin</dc:creator>
			<guid isPermaLink="false">3640@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;I suggest you instead of sending it to the cassandra directly, first write spitted data to the CLI compatible file which would contain commands like &#34;set &#38;lt;cf&#38;gt;[&#38;lt;key&#38;gt;][&#38;lt;column&#38;gt;] = 'value';&#34; and see if file has all the data you want, after that you can insert it into C* using ./bin/cassandra-cli --host &#38;lt;ip&#38;gt; --keyspace &#38;lt;your-ks&#38;gt; &#38;lt; &#38;lt;file-with-cli-formatted-data&#38;gt; and check if C* then would have all of your data using 'list' command.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>datastaxtesting on "Loading data into cassandra database using hector"</title>
			<link>http://www.datastax.com/support-forums/topic/loading-data-into-cassandra-database-using-hector#post-3637</link>
			<pubDate>Tue, 24 Jul 2012 19:41:57 +0000</pubDate>
			<dc:creator>datastaxtesting</dc:creator>
			<guid isPermaLink="false">3637@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;I am trying to load csv file: Its working perfectly fine but I cannot see the full data:&#60;/p&#62;
&#60;p&#62;// Read File&#60;br /&#62;
        String fileLocation = &#34;/usr/local/tomcat/webapps/analytics-project/docs/examples/OSHA-data/Mapping_sheet_long.csv&#34;;&#60;br /&#62;
        BufferedReader reader;&#60;br /&#62;
        reader = new BufferedReader(new InputStreamReader(new FileInputStream(fileLocation)));&#60;br /&#62;
        List&#38;lt;String[]&#38;gt; rows = new ArrayList&#38;lt;String[]&#38;gt;();&#60;br /&#62;
        String line = null;&#60;br /&#62;
        int numRows = 0;&#60;br /&#62;
        while((line = reader.readLine()) != null){&#60;br /&#62;
                numRows = numRows + 1;&#60;br /&#62;
                rows.add(line.split(&#34;,&#34;, -1));&#60;br /&#62;
        }&#60;/p&#62;
&#60;p&#62;        // Insert rows&#60;br /&#62;
        StringSerializer stringSerializer = StringSerializer.get();&#60;br /&#62;
        int count = 0;&#60;br /&#62;
        int len = numRows;&#60;br /&#62;
        while(len-- &#38;gt; 0){&#60;br /&#62;
                String key = rows.get(count)[0];&#60;br /&#62;
                System.out.println(key);&#60;br /&#62;
                Mutator&#38;lt;String&#38;gt; mutator = HFactory.createMutator(myKeyspace, stringSerializer);&#60;br /&#62;
                mutator.addInsertion(key, &#34;oshachemicals&#34;, HFactory.createStringColumn(&#34;chemical_name&#34;, rows.get(count)[1]));&#60;br /&#62;
                mutator.addInsertion(key, &#34;oshachemicals&#34;, HFactory.createStringColumn(&#34;chemical_code&#34;, rows.get(count)[2]));&#60;br /&#62;
                MutationResult mr = mutator.execute();&#60;br /&#62;
                count = count + 1;&#60;br /&#62;
        }&#60;/p&#62;
&#60;p&#62;Dataset is like:&#60;br /&#62;
11111111, lead, 213&#60;br /&#62;
11111112, chromium, P213 ....&#60;/p&#62;
&#60;p&#62;I can see few datas using list command but not all data is available
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
