ACE Director Alum Daniel Morgan, founder of Morgan's Library, is scheduling
complimentary technical Workshops on Database Security for the first 30
Oracle Database customers located anywhere in North America, EMEA, LATAM, or
APAC that send an email to
asra_us@oracle.com. Request a Workshop for
your organization today.
Purpose
DBMS_HADOOP_INTERNAL is an internal package providing helper functions to DBMS_HADOOP
AUTHID
DEFINER
Dependencies
ALL_HIVE_COLUMNS
DBA_HIVE_TAB_PARTITIONS
EXTERNAL_TAB$
ALL_HIVE_DATABASES
DBA_OBJECTS
HIVEMETADATA
ALL_HIVE_PART_KEY_COLUMNS
DBA_PART_TABLES
HIVETYPESET
ALL_HIVE_TABLES
DBA_TABLES
OBJ$
ALL_HIVE_TAB_PARTITIONS
DBA_XTERNAL_TAB_PARTITIONS
TABPART$
ALL_TAB_PRIVS
DBA_XT_HIVE_TABLES_VALIDATION
USER$
ALL_XT_HIVE_TABLES_VALIDATION
DBMS_ASSERT
USER_HIVE_COLUMNS
ANYDATA
DBMS_HADOOP
USER_HIVE_DATABASES
DBA_DIRECTORIES
DBMS_METADATA
USER_HIVE_PART_KEY_COLUMNS
DBA_HIVE_COLUMNS
DBMS_STANDARD
USER_HIVE_TABLES
DBA_HIVE_DATABASES
DBMS_SYS_ERROR
USER_HIVE_TAB_PARTITIONS
DBA_HIVE_PART_KEY_COLUMNS
DBMS_UTILITY
USER_XT_HIVE_TABLES_VALIDATION
DBA_HIVE_TABLES
DUAL
UTL_RAW
Documented
No
First Available
12.2
Security Model
Owned by SYS with EXECUTE granted to the EXECUTE_CATALOG_ROLE role.
Direct access to this package is prevented by means of an Accessible By clause.
Source
{ORACLE_HOME}/rdbms/admin/dbmshadp1.sql and prvthadoop1.plb
Given a Hive table, this function returns all the partitions that appear in the Hive table, but missing in the corresponding Oracle external table.
We use the function ADDED_PARTNS() to obtain the hashed partitioned names from DBA_HIVE_TAB_PARTITIONS and then find the corresponding original partition specs.
dbms_hadoop_internal.added_hive_partns(
clus_id IN VARCHAR2,
db_name IN VARCHAR2,
tab_name IN VARCHAR2,
partnList IN CLOB,
mdata_compatible IN VARCHAR2)
RETURN CLOB;
Given a Hive table, this function returns all the partitions that appear in the Hive table, but missing in the corresponding Oracle external table
dbms_hadoop_internal.added_partns(
clus_id IN VARCHAR2,
db_name IN VARCHAR2,
tab_name IN VARCHAR2,
et_name IN VARCHAR2,
et_owner IN VARCHAR2,
mdata_compatible IN VARCHAR2)
RETURN CLOB;
Given a Hive table, this function returns all the partitions that appear in the corresponding Oracle external table, but in the given Hive table
dbms_hadoop_internal.dropped_partns(
clus_id IN VARCHAR2,
db_name IN VARCHAR2,
tab_name IN VARCHAR2,
et_name IN VARCHAR2,
et_owner IN VARCHAR2,
mdata_compatible IN VARCHAR2)
RETURN CLOB;
dbms_hadoop_internal.drop_all_partns(
clus_id IN VARCHAR2,
db_name IN VARCHAR2,
tab_name IN VARCHAR2,
et_name IN VARCHAR2,
et_owner IN VARCHAR2,
mdata_compatible IN VARCHAR2)
RETURN CLOB;
getHiveTable() is a pipelined table function that returns the rows back from C external procedures via ODCI to PL/SQL.
The rows sent from C external procedures actually originate from various Hive metastores and fetched via JNI calls made from hotspot JVM.
dbms_hadoop_internal.getHiveTable(
configDir IN VARCHAR2,
debugDir IN VARCHAR2,
clusterName IN VARCHAR2,
dbName IN VARCHAR2,
tblName IN VARCHAR2,
createPartitions IN VARCHAR2,
callType IN NUMBER)
RETURN hiveTypeSet PIPELINED USING HiveMetadata;
dbms_hadoop_internal.get_ddl(
secureConfigDir IN VARCHAR2,
secureDebugDir IN VARCHAR2,
secureClusterId IN VARCHAR2,
secureDbName IN VARCHAR2,
secureHiveTableName IN VARCHAR2,
createPartitions IN VARCHAR2)
RETURN CLOB;
Given a Hive table and its corresponding Oracle external table, this function returns the first incompatibility that is encountered
dbms_hadoop_internal.get_incompatibility(
clus_id IN VARCHAR2,
db_name IN VARCHAR2,
hive_tbl_name IN VARCHAR2,
et_tbl_name IN VARCHAR2,
et_tbl_owner IN VARCHAR2)
RETURN CLOB;
Given a Hive table, this function returns the object number of the Oracle external table, if one is present
dbms_hadoop_internal.get_objno_from_partitioned_et(
cluster_id IN VARCHAR2,
table_name IN VARCHAR2,
XT_tab_name IN VARCHAR2,
xt_tab_owner IN VARCHAR2)
RETURN NUMBER;
Given a Hive table and its corresponding Oracle external table, this function checks whether the external table is metadata-compatible with the Hive table.
Metadata compatibility means (a) every column in the external table must be present in the Hive table (b) the datatype of each external table column must be the same or compatible with the datatype of the hive table column.
(c) The partition keys in the external table must be in the same order as the partition keys in the hive table.
dbms_hadoop_internal.is_metadata_compatible(
clus_id IN VARCHAR2,
db_name IN VARCHAR2,
hive_tbl_name IN VARCHAR2,
et_tbl_name IN VARCHAR2,
et_tbl_owner IN VARCHAR2)
RETURN VARCHAR2;
Check whether the given Oracle table is compatible with the given Hive table. In order to be compatible, both of their columns should match, partition keys should match and all of their datatypes should be compatible.
dbms_hadoop_internal.is_oracle_table_compatible(
clus_id IN VARCHAR2,
db_name IN VARCHAR2,
hive_tbl_name IN VARCHAR2,
hypt_tbl_name IN VARCHAR2,
hypt_tbl_owner IN VARCHAR2)
RETURN VARCHAR2;
Check whether the given Oracle table is an eligible table for merging with a Hive table into a hybrid partitioned table. In order to be eligible, it needs to be an internal LIST partitioned table, and cannot be an external table.
dbms_hadoop_internal.is_oracle_table_eligible(
secureClusterId IN VARCHAR2,
secureHiveTableName IN VARCHAR2,
hypt_name_dqr IN VARCHAR2,
hypt_owner_dqr IN VARCHAR2)
RETURN NUMBER;
Given a Hive table and its corresponding Oracle external table, this function tells whether the external table is partition compatible with the hive table.
If the XT is exactly identical to the Hive table this function will return FALSE - the reason is that the user does not need to call the SYNC API.
dbms_hadoop_internal.is_partition_compatible(
mdata_compatible IN VARCHAR2,
partns_added IN CLOB,
partns_dropped IN CLOB)
RETURN VARCHAR2;