Skip to content
This repository was archived by the owner on Mar 15, 2022. It is now read-only.

Commit bdf166f

Browse files
committed
Update to c2hadoop
1 parent 4b75710 commit bdf166f

File tree

2 files changed

+43
-45
lines changed

2 files changed

+43
-45
lines changed

samples/c2hadoop/c2h.ohsh

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# copy the table movie_sessions_tab in Oracle Database schema MOVIEDEMO
2-
# to Hive schema MOVIEDEMO
3-
4-
create hive table hive_moviedemo:movie_sessions_tab from oracle table moviedemo:movie_sessions_tab using stage;
5-
6-
# Verify the results of the load by comparing with the number of rows
7-
# in the database table
8-
%sql select count(*) from movie_sessions_tab;
9-
%hive_moviedemo select count(*) from movie_sessions_tab;
10-
11-
# Append additional rows to the table
12-
load hive table hive_moviedemo:movie_sessions_tab from oracle table moviedemo:movie_sessions_tab using stage where "(cust_id = 1446522)";
13-
14-
# Verify the results again - you will have four more rows
15-
%hive_moviedemo select count(*) from movie_sessions_tab;
16-
1+
# copy the table movie_sessions_tab in Oracle Database schema MOVIEDEMO
2+
# to Hive schema MOVIEDEMO
3+
4+
create hive table hive_moviedemo:movie_sessions_tab from oracle table moviedemo:movie_sessions_tab;
5+
6+
# Verify the results of the load by comparing with the number of rows
7+
# in the database table
8+
%sql select count(*) from movie_sessions_tab;
9+
%hive_moviedemo select count(*) from movie_sessions_tab;
10+
11+
# Append additional rows to the table
12+
load hive table hive_moviedemo:movie_sessions_tab from oracle table moviedemo:movie_sessions_tab where "(cust_id = 1446522)";
13+
14+
# Verify the results again - you will have four more rows
15+
%hive_moviedemo select count(*) from movie_sessions_tab;
16+
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
1-
# Create a hive resource for hive database MOVIEDEMO
2-
create hive resource hive_moviedemo database="MOVIEDEMO"
3-
4-
# Create a SQL resource for Oracle Database user MOVIEDEMO
5-
create sqlplus resource sql user="MOVIEDEMO" \
6-
connectid="bigdatalite.localdomain:1521/orcl"
7-
8-
# Create a JDBC resource to connect to Oracle Database
9-
create oracle jdbc resource moviedemo user="MOVIEDEMO" \
10-
connectid="bigdatalite.localdomain:1521/orcl"
11-
12-
# Create directories for staging data pump files and log files
13-
# Ignore the error if the directory already exists
14-
%bash0 mkdir /home/oracle/src/samples/c2hadoop/dmpfiles
15-
%bash0 mkdir /home/oracle/src/samples/c2hadoop/logs
16-
17-
# Create database directories for these directories
18-
19-
# Temporary database directory for staging data pump files
20-
%sql create or replace directory C2H_DP_DIR as \
21-
'/home/oracle/src/samples/c2hadoop/dmpfiles';
22-
23-
# Database directory for log files
24-
%sql create or replace directory C2H_DP_DIR as \
25-
'/home/oracle/src/samples/c2hadoop/dmpfiles';
26-
27-
# set OHSH resources for database directories
28-
set locationdirectory C2H_DP_DIR
29-
set defaultdirectory C2H_LOG_DIR
1+
# Create a hive resource for hive database MOVIEDEMO
2+
create hive resource hive_moviedemo connectionurl="jdbc:hive2:///moviedemo";
3+
4+
# Create a SQL resource for Oracle Database user MOVIEDEMO
5+
create sqlplus resource sql connectid="bigdatalite.localdomain:1521/orcl";
6+
7+
# Create a JDBC resource to connect to Oracle Database
8+
create oracle jdbc resource moviedemo connectid="bigdatalite.localdomain:1521/orcl";
9+
10+
# Create directories for staging data pump files and log files
11+
# Ignore the error if the directory already exists
12+
%bash0 mkdir /home/oracle/src/samples/c2hadoop/dmpfiles
13+
%bash0 mkdir /home/oracle/src/samples/c2hadoop/logs
14+
15+
# Create database directories for these directories
16+
17+
# Temporary database directory for staging data pump files
18+
%sql create or replace directory C2H_DP_DIR as \
19+
'/home/oracle/src/samples/c2hadoop/dmpfiles';
20+
21+
# Database directory for log files
22+
%sql create or replace directory C2H_LOG_DIR as \
23+
'/home/oracle/src/samples/c2hadoop/logs';
24+
25+
# set OHSH resources for database directories
26+
set locationdirectory C2H_DP_DIR
27+
set defaultdirectory C2H_LOG_DIR

0 commit comments

Comments
 (0)