<?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 from one table to another</title>
		<link>http://www.datastax.com/support-forums/topic/loading-data-from-one-table-to-another</link>
		<description>Software, Support, and Training for Apache Cassandra</description>
		<language>en-US</language>
		<pubDate>Wed, 22 May 2013 23:39:30 +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-from-one-table-to-another" rel="self" type="application/rss+xml" />

		<item>
			<title>awenclaw on "loading data from one table to another"</title>
			<link>http://www.datastax.com/support-forums/topic/loading-data-from-one-table-to-another#post-2876</link>
			<pubDate>Tue, 10 Jul 2012 16:21:03 +0000</pubDate>
			<dc:creator>awenclaw</dc:creator>
			<guid isPermaLink="false">2876@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;I eliminate possibility that select distinct is causing problems.&#60;br /&#62;
When I execute :&#60;br /&#62;
insert overwrite ....&#60;br /&#62;
select ....&#60;br /&#62;
UNION ALL&#60;br /&#62;
select...&#60;br /&#62;
and after that count number of rows inserted to table I get 1987 rows.&#60;/p&#62;
&#60;p&#62;When I execute:&#60;br /&#62;
select count(*) from (&#60;br /&#62;
select ...&#60;br /&#62;
UNION ALL&#60;br /&#62;
select... )&#60;br /&#62;
I get 2000 rows. So there is something wrong with using UNION ALL with insert overwrite (or there is something wrong with me...)&#60;/p&#62;
&#60;p&#62;Did anybody had similar problems or know the solution?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>awenclaw on "loading data from one table to another"</title>
			<link>http://www.datastax.com/support-forums/topic/loading-data-from-one-table-to-another#post-2828</link>
			<pubDate>Mon, 09 Jul 2012 17:53:52 +0000</pubDate>
			<dc:creator>awenclaw</dc:creator>
			<guid isPermaLink="false">2828@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Hi!&#60;br /&#62;
I have simple problem but I have no idea what's happening. I'm trying to load table s_kontrachenci from table przelewy_zrodlo using hive. I'm useing such query:&#60;/p&#62;
&#60;p&#62;insert owerwrite table s_kontrachenci&#60;br /&#62;
select distinct kontrachenci.klucz, kontrachenci.nazwa, kontrachenci.typ from (&#60;br /&#62;
 select&#60;br /&#62;
  concat('key_', nazwa_zleceniodawcy) AS klucz,&#60;br /&#62;
  nazwa_zleceniodawcy AS nazwa,&#60;br /&#62;
  case when substr(nr_rach_zleceniodawcy, 1, 1) &#38;lt; 5 then 'WEW' else 'ZEW' AS typ&#60;br /&#62;
 from przelewy_zrodlo&#60;br /&#62;
 UNION ALL&#60;br /&#62;
 select&#60;br /&#62;
  concat('key_', nazwa_zleceniodawcy) AS klucz,&#60;br /&#62;
  nazwa_zleceniodawcy AS nazwa,&#60;br /&#62;
  case when substr(nr_rach_zleceniodawcy, 1, 1) &#38;lt; 5 then 'WEW' else 'ZEW' AS typ&#60;br /&#62;
 from przelewy_zrodlo&#60;br /&#62;
) kontrachenci;&#60;/p&#62;
&#60;p&#62;After I load data to table s_kontrachenci I execute query:&#60;/p&#62;
&#60;p&#62;select count(*) from s_kontrachenci;&#60;/p&#62;
&#60;p&#62;and I get result 1987 rows.&#60;/p&#62;
&#60;p&#62;But when I execute such query:&#60;/p&#62;
&#60;p&#62;select count(*) from (&#60;br /&#62;
select distinct kontrachenci.klucz, kontrachenci.nazwa, kontrachenci.typ from (&#60;br /&#62;
 select&#60;br /&#62;
  concat('key_', nazwa_zleceniodawcy) AS klucz,&#60;br /&#62;
  nazwa_zleceniodawcy AS nazwa,&#60;br /&#62;
  case when substr(nr_rach_zleceniodawcy, 1, 1) &#38;lt; 5 then 'WEW' else 'ZEW' AS typ&#60;br /&#62;
 from przelewy_zrodlo&#60;br /&#62;
 UNION ALL&#60;br /&#62;
 select&#60;br /&#62;
  concat('key_', nazwa_zleceniodawcy) AS klucz,&#60;br /&#62;
  nazwa_zleceniodawcy AS nazwa,&#60;br /&#62;
  case when substr(nr_rach_zleceniodawcy, 1, 1) &#38;lt; 5 then 'WEW' else 'ZEW' AS typ&#60;br /&#62;
 from przelewy_zrodlo&#60;br /&#62;
) kontrachenci&#60;br /&#62;
) kontr;&#60;/p&#62;
&#60;p&#62;I get 1991 rows. And now I'm very confused because in my opinion both queries should return same number of rows. Any ideas why number of rows are diffrent for those queries?&#60;/p&#62;
&#60;p&#62;I should add information that i use such structure:&#60;br /&#62;
select distinct ... from (&#60;br /&#62;
select ... from ...&#60;br /&#62;
UNION ALL&#60;br /&#62;
select ... from) ...;&#60;br /&#62;
Because there is no UNION in hive and in my opinion this should work as UNION.&#60;/p&#62;
&#60;p&#62;Any help would be appreciate!&#60;br /&#62;
Thanks in advance!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
