You need to provide a value for the deptno partition key. You can't insert into a partitioned table without providing a value for the partition column. You can either give it a static value: insert into table emp_parquet partition (deptno = 'x') select empno, ename from emp
or you can set it dynamically based on a value in emp (if such a value exists) insert into table emp_parquet partition (deptno) select empno, ename, deptno from emp; Alan. On Wed, May 29, 2019 at 9:16 PM Raviprasad T <raviprasa...@gmail.com> wrote: > Is it possible to Insert only specific columns in Hive ( Partitioned > tables ) ? > > For Non partitioned tables, it is working as below. > > insert into emp (empno,sal) select empno,sal from emp_hist.; --- This > is working ( emp_hist table is having empno,ename,sal,job_desc columns, > I am able to insert only empno and sal columns ) > > ---------- Forwarded message --------- > From: Raviprasad T <raviprasa...@gmail.com> > Date: Mon, May 27, 2019 at 11:00 PM > Subject: Hive Insert and Select only specific columns ( not all columns ) > - Partitioned table > To: <user@hive.apache.org> > > > *emp ( Hive emp table, Non partitioned table )* > > empo > ename > sal > deptno > > > *emp_parquet* ( Hive emp_parquet table Partitioned by deptno ) > > empo > ename > sal > Partition by deptno > > I am having two tables emp ( text file format ) and emp_parquet ( > Parquet file format ) > > Both are have same columns and emp_parquet is the partitioned table. > > I want to select only *specific column* ( Not all columns ) from emp > table and insert into emp_parquet ( partitioned table )table. > > *insert into table emp_parquet partition by (deptno) select empno, ename > from emp;* > > Please note : I want to insert only empno, ename and NOT sal column > in emp_parquet table. ( Partitioned table ). > I have tried with Non partitioned table, it was working fine > > Regards > Ravi > > > > > -- > ---------------------------------------------- > Regards, > RAVI PRASAD. T > > > -- > ---------------------------------------------- > Regards, > RAVI PRASAD. T > > > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> > Virus-free. > www.avg.com > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> > <#m_6521893363656032594_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >