RE: Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE

2016-08-07 Thread Markovitz, Dudu
o: Marcin Tustin Cc: user Subject: Re: Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE The source table is a partitioned external table and the target table is also external but not partitioned. A straight create table as .. from external table won't work hi

RE: Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE

2016-08-07 Thread Markovitz, Dudu
-partitioned table from partitioned table using CREATE TABLE .. LIKE Yes, but a create table unpartitioned as select * from partitioned will create an unpartitioned table with all the data in partitioned table. It won't lose the partition column, but nowhere do I see a need for that column to be re

Re: Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE

2016-08-07 Thread Mich Talebzadeh
The source table is a partitioned external table and the target table is also external but not partitioned. A straight create table as .. from external table won't work hive> CREATE EXTERNAL TABLE sales5 AS SELECT * FROM SALES; FAILED: SemanticException [Error 10070]: CREATE-TABLE-AS-SELECT canno

Re: Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE

2016-08-07 Thread Marcin Tustin
Yes, but a create table unpartitioned as select * from partitioned will create an unpartitioned table with all the data in partitioned table. It won't lose the partition column, but nowhere do I see a need for that column to be removed. On Sun, Aug 7, 2016 at 9:25 AM, Mich Talebzadeh wrote: > Hi

Re: Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE

2016-08-07 Thread Mich Talebzadeh
Hi Marcin, The thread owner question was "Hi I've a scenario where I need to create a table from partitioned table but my destination table should not be partitioned. I won't be knowing the schema so I cannot create manually the destination table. By the way both tables are external tables." Th

Re: Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE

2016-08-07 Thread Marcin Tustin
gt; > > Dudu > > > > *From:* Marcin Tustin [mailto:mtus...@handybook.com] > *Sent:* Sunday, August 07, 2016 3:17 PM > *To:* user@hive.apache.org > *Subject:* Re: Crate Non-partitioned table from partitioned table using > CREATE TABLE .. LIKE > > > > Will CR

RE: Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE

2016-08-07 Thread Markovitz, Dudu
It won’t help him since ‘*’ represent all columns including the partition columns which he wants to exclude. Dudu From: Marcin Tustin [mailto:mtus...@handybook.com] Sent: Sunday, August 07, 2016 3:17 PM To: user@hive.apache.org Subject: Re: Crate Non-partitioned table from partitioned table

Re: Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE

2016-08-07 Thread Marcin Tustin
Will CREATE TABLE sales5 AS SELECT * FROM SALES; not work for you? On Thu, Aug 4, 2016 at 5:05 PM, Nagabhushanam Bheemisetty < nbheemise...@gmail.com> wrote: > Hi I've a scenario where I need to create a table from partitioned table > but my destination table should not be partitioned. I won't be

Re: Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE

2016-08-06 Thread Nagabhushanam Bheemisetty
gt; > > Dudu > > > > > > > > *From:* Nagabhushanam Bheemisetty [mailto:nbheemise...@gmail.com] > *Sent:* Friday, August 05, 2016 12:05 AM > *To:* user@hive.apache.org > *Subject:* Crate Non-partitioned table from partitioned table using > CREATE TABLE .. LIKE

RE: Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE

2016-08-06 Thread Markovitz, Dudu
: Friday, August 05, 2016 12:05 AM To: user@hive.apache.org Subject: Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE Hi I've a scenario where I need to create a table from partitioned table but my destination table should not be partitioned. I won't be k

Re: Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE

2016-08-04 Thread Mich Talebzadeh
Ok Does it matter whether the table you create is accessible to Hive? You can read your hive table in Spark assuming you know the table name // Read hive table. This one is partitioned scala> val s = HiveContext.table("oraclehadoop.sales") s: org.apache.spark.sql.DataFrame = [prod_id: bigint, cu

Re: Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE

2016-08-04 Thread Nagabhushanam Bheemisetty
Yes you are correct that is just meta copy and I need only that but without partition:( On Thu, Aug 4, 2016 at 5:15 PM Mich Talebzadeh wrote: > yes but that essentially copies the metadata and leaves the partition > there with no data. it is just an image copy. won't help this case > > Dr Mich T

Re: Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE

2016-08-04 Thread Mich Talebzadeh
yes but that essentially copies the metadata and leaves the partition there with no data. it is just an image copy. won't help this case Dr Mich Talebzadeh LinkedIn * https://www.linkedin.com/profile/view?id=AAEWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw

Re: Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE

2016-08-04 Thread Nagabhushanam Bheemisetty
Well you can create using like. CREATE EXTERNAL TABLE sales5 LIKE sales; On Thu, Aug 4, 2016 at 5:06 PM Mich Talebzadeh wrote: > Which process creates the master table in Hive as an external table? There > must be a process that creates the master table as external table? Hive > knows about

Re: Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE

2016-08-04 Thread Mich Talebzadeh
Which process creates the master table in Hive as an external table? There must be a process that creates the master table as external table? Hive knows about the schema of that table. It is in Hive metastore. You cannot create an external table with CREATE EXTERNAL TABLE AS ... hive> CREATE EXT

Re: Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE

2016-08-04 Thread Nagabhushanam Bheemisetty
I only get the table names that I need to ingest. So I don't know the master table schema upfront. Yes the new table based on master table which is partitioned but new table should not be partitioned and should not have partition column. On Thu, Aug 4, 2016 at 4:54 PM Mich Talebzadeh wrote: > D

Re: Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE

2016-08-04 Thread Mich Talebzadeh
Do you know the existing table schema? The new table schema will be based on that table without partitioning? Dr Mich Talebzadeh LinkedIn * https://www.linkedin.com/profile/view?id=AAEWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw

Crate Non-partitioned table from partitioned table using CREATE TABLE .. LIKE

2016-08-04 Thread Nagabhushanam Bheemisetty
Hi I've a scenario where I need to create a table from partitioned table but my destination table should not be partitioned. I won't be knowing the schema so I cannot create manually the destination table. By the way both tables are external tables.