Migrating Hive Transaction table to another cloud platform - hadoop

I'm trying to migrate my Hive Transaction table to another cloud platform. As a POC work I copied a partition directory to another location and created a new hive transaction table with the same schema pointing to the copied location. Then I executed the following command to add the partition to meta store.
ALTER TABLE <table name> ADD PARTITION (date_time='2020-03-06',bin='95');
SHOW PARTITIONS <table name>
RESULT => date_time=2020-03-06/bin=95
But when I execute a select query I'm getting empty results. Any steps that I'm missing here?
Thank you very much in advance.

Related

hive/impala metadata refresh

Does REFRESH table command refresh the metadata in Impala when a partition location is changed in Hive?
I am changing the Hive table partition location using
ALTER TABLE db.table partition(key=value1, key2=value2) set location='path'
After that, I am running REFRESH db.table in Impala which is not updating metadata. If I run INVALIDATE METADATA it is working.
There is Impala JIRA-4364 open for that. However its been in product backlog since 2017, so currently INVALIDATE METADATA is the only workaround.
UPDATE: This has been fixed in Impala 4.0 (see same JIRA link above).
Please make sure you perform msck repair after loading into the Hive partition instance.
Afterwards, you can invalidate the metadata for the DB in which the table resides in Impala shell/UI

Update JDBC Database table using storage handler and Hive

I have read that using Hive JDBC storage handler
(https://github.com/qubole/Hive-JDBC-Storage-Handler),
the external table in Hive can be created on different databases (MySQL, Oracle, DB2) and users can read from and write to JDBC databases using Hive using this handler.
My question is in the update .
If we use hive.14 where Hive update/delete is supported and use storage handler to point an external table to a JDBC database table, will it allow us to update the database table as well when we fire the update query from Hive end?
You can not update an external table in hive.
In hive only transcational tables support ACID properties. By default transactions are configured to be off. So to create transaction tables you need to add 'TBLPROPERTIES ('transactional'='true')' in your create statement.
There are many limitations to it. One of which is you cannot make external tables to be an ACID table because external tables are beyond the control of hive compactor.
To read more on this click here

How to get DBLink name in ODI KM

I'm using Oracle Data Integration and i need to integrate in an IKM a source DBLink.
I have a simple mapping between one source table and one target table. The source table is on another database so I need to use a DBLink.
I have created the DBLink in the topology and associated to the source Data Server.
I tried to "catch" the DBLink name using <%=odiRef.getInfo("SRC_DSERV_NAME")%> but i get the target instance instead of source DBLink(instance).
Any suggestions?
In the meantime I've found the solution: <#=odiRef.getObjectName("R","<%=odiRef.getSrcTablesList("", "[TABLE_NAME]", "", "")%>","D")#>.

create database in hive with multiple locations having sentry enable

I am creating a database in hive with multiple location for example
CREATE DATABASE sample1 location 'hdfs://nameservice1:8020/db/dev/abc','hdfs://nameservice1:8020/db/dev/def','hdfs://nameservice1:8020/db/dev/ghi'
but i am getting error while doing this. Can anyone help in this kind of creating a database with multiple locations is allowed ? Is there any alternate solution for this.
PS: My cluster is sentry enabled
Which error? If that is
User xx does not have privileges for CREATETABLE
then look at
http://community.cloudera.com/t5/Batch-SQL-Apache-Hive/quot-User-does-not-have-privileges-for-CREATETABLE-quot-Error/td-p/21044
You may have to omit LOCATION, and upload file directly to a hive warehouse location of that hive schema. I can't think of a better workaround.

How to access SampleAppLite.rpd's table in sql developer(toad)?

I have SampleApplite.rpd as repository sample from obiee11g, in that repository, there is some table , for example :samp_targets_f.
I want to check data inside those table, so in toad i log in as sys, but i couldn't find tables belong to sampleapplite.rpd
I try it in my localhost for practice, so i open that repository offline.
How to access those table from toad?could i try to log in in other schema?
Thanks
The table are actually XML files in the BI server file system: BI_EE_HOME/sample/SampleAppFiles/data

Resources