You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Hokam Singh Chauhan <ho...@gmail.com> on 2017/12/09 12:02:06 UTC

JDBC to hive batch use case in spark

Hi,
I have an use case in which I wants to read data from a jdbc source(Oracle)
table and write it to hive table on periodic basis. I tried this using the
SQL context to read from Oracle and Hive context to write the data in hive.
The data read parts works fine but when I ran the save call on hive context
to write data, it throws the exception and it says the table or view does
not exists even though the table is precreated in hive.

Please help if anyone tried such scenario.

Thanks

Re: JDBC to hive batch use case in spark

Posted by ayan guha <gu...@gmail.com>.
Please enable hive support onnspark session,  if using spark2. If you are
on spark1, use hiveContext instead of sqlContext.

On Sun, 10 Dec 2017 at 12:20 am, 张万新 <ke...@gmail.com> wrote:

> If you don't mind, I think it will help if you post your code
>
> Hokam Singh Chauhan <ho...@gmail.com>于2017年12月9日周六 下午8:02写道:
>
>> Hi,
>> I have an use case in which I wants to read data from a jdbc
>> source(Oracle) table and write it to hive table on periodic basis. I tried
>> this using the SQL context to read from Oracle and Hive context to write
>> the data in hive. The data read parts works fine but when I ran the save
>> call on hive context to write data, it throws the exception and it says the
>> table or view does not exists even though the table is precreated in hive.
>>
>> Please help if anyone tried such scenario.
>>
>> Thanks
>>
> --
Best Regards,
Ayan Guha

Re: JDBC to hive batch use case in spark

Posted by 张万新 <ke...@gmail.com>.
If you don't mind, I think it will help if you post your code

Hokam Singh Chauhan <ho...@gmail.com>于2017年12月9日周六 下午8:02写道:

> Hi,
> I have an use case in which I wants to read data from a jdbc
> source(Oracle) table and write it to hive table on periodic basis. I tried
> this using the SQL context to read from Oracle and Hive context to write
> the data in hive. The data read parts works fine but when I ran the save
> call on hive context to write data, it throws the exception and it says the
> table or view does not exists even though the table is precreated in hive.
>
> Please help if anyone tried such scenario.
>
> Thanks
>