This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA
53
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
Note
After these settings have been made then the Hadoop Services will need to be restarted to take effect. Prepare SAP HANA
In SAP HANA SPS09 , Hadoop Map Reduce Integration is an optional addon feature, not included as part of the base installation. First you need to download the add-on from the SAP Software Download Center (Figure 55): https://support.sap.com/software.html. SAP SOFTWARE DOWNLOAD CENTER SEARCH RESl1TS IN SN> SOffiVAAE DOWNLOAD CENTER
HAN& HAQQQPCON!BOllfB I 9
t'..tll:~flal'
C (4 HAI!!AHA{)()QfiOJ 809
l · Zoo
P~t "
Figure 55 SAP Service Market Pl ace Download Center
Download and extract the ZIP file on your local machine. The delivery unit then needs to be imported into SAP HANA.
Go the SAP HANA application Lifecyle Management tool. Under the Products/Delivery Units menu import the delivery unit (Figure 56) (http:/ l
54
J
3
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
Figure 56 Import Delivery Unit
&' HAllA AJ)pll(.auon trrecycte uanagement HOME
PROOUCTS
PrOducts
+
[E] [E] [Ei] [5) [E) [E] (E:i) [Ei] (E) [E] [E] [Ei] [§] (5] [Ei]
[E] [E] [Ei] [E] [Ei]
TRANSPORT
Delivery Untts
Create
R Sa-.re
SETIINGS
MANAGE SYSTEIA
Packages
tii Oetete 0,
! 1moon y
HANA_HAOOOP_CnR (sap.com)
~
Expon
Details N3me 1-«ANA._HAOOOP_Clt.R
HANA,.IDE_CORE (n o.eom) HANA..STUOIOJID8 tsao.coml
~Mor
HANA_ TA_CONFIG (sap com)
Oescriphon
Hadoop Controller
s ap.com
Version
SAP Sul)port Info
1.9 .1
HANA,.TEST_TOOlS(sap.eom) HANA_UI_I>ITEGRATION_OONTENl
HAW.._UI_ItlT~GAATION_SVC (sap. HANA..XS_BASE (sao com)
HANA..)(S_OBUll.S(sap.com)
Dependencies Outgoing Oependenci&s
HANA,.XS_EOOOR (sap.COm)
Status
Incoming Oeptndendes
Delivery Unit
HANA,.XS_IOE ($30 com) HANA,.XS_Liol (sap.eom) HCO_OEMOCONTENT (U~.tom)
No data
HCO_OEI.IOCONTEr.rT_NEXT(sapciO HCO_WU (..p.eom) HOC_.ADIJlN ($ap,eom)
Assigned Packages
HOC_IOE_OORE (sap.com) HOC.J(S_8ASE (sap.com) HOC_XS_u.t (sap.oom)
I < Assign I
SAPOEVS_I
tl
[5] SAPOEVS_IOT (develoot-rs.sap.com
,.v. ""' . . .,,
1=1...
X
lkiaSSIOA
Cl\tct for Unassigned
Orional L-anguage
Name
Original language
s.ap.hanaJh3dOOP.OOt\tfOIItr
••
J
Figure 57 SAP HANA Hadoop Delivery Unit Installed
55
3
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
Create a Remote Data Source
Now with SAP HANA and Hadoop prepared, the next step is to create a Remote Data Source. This will enable SAP HANA to communicate with the Hadoop cluster. In order for this to work you need to ensure that both the following Hadoop services are running:
» WebHDFS: Used for accessing the HDFS (e.g., reading and writing files on the Hadoop cluster)
» WebHCAT:
Used for accessing Hadoop metadata and executing and monitoring MapReduce jobs
Run the following SQL: DROP REMOTE SOURCE Hadoop_SOURC E_CDH CASCADE ; CREATE REMOTE SOURCE Hadoop_SOURCE_CDH ADAPTER "hadoop " CONF IGURATI ON ' webhd fs_url =http : //
Note WebHDFS is typically running on the Hadoop NameNode on PORT 50070; WebHCAT typically uses port 50111 on the node specified in the Hive configuration.
After running the SQL the Remote Source should appear in the list (Figure 58).
I
3
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
3
1D SAP KANA Administration File Edit
NMVig, te:
Projt
Window HeJp Qurd: A<
f!l': · E!J II · 1!1 ~ ' 1!1. HOB (HOEVOt)
~
8 '!0 "
QJ. Catalog
in HADOOP BKMR.s.ql
g! I I~
SAP HANA Admini~ttation Console
IB SAP HANA Developm ent
C 'H08 • SQL Console 1 ~
0
HOB (HDEVOl) 5U0.90.BSOO
----......, IO SQl
a.. cont tnt
DROP REKITE SOURCE HAOOOP_ SOURCE_COH CASCADE ;
, Qt Provisioning Smart Data Acc6s "' ~ Remote Sources
5f
CAfAT£ REfo'I)Te SOURCE HADOOP SOURCE CDH
ADAPTER ..h adoop"
-
-
CONfiGURAriOH 'webhdfs_url • http: //
CL HAOOOP_SOURCE_COH ll. HAOOOP_SOURCE.H2
WITH CREDENTIAl TYPE 'PASSWORD'
USING 'use:r•hdfs;pass-f,rd•hdfs';
a. HIV£1
fl. IMPAtAl fl. SPAIUO.
~ · ~cunty
itJ
HOB (sYSTEM)
D
Proptttit1 $:3 0 £rrotlog
Property
"' Session Auto Commit Clie:nt Oistllibution holation l evel Single Fetch for Rtsult
On On A.e:ad Committed Off
"' Systtm
;ctb<:sap://52.10!JJ....5.l20:3001S:HO£V01
Writable
Smartlnsttt
7 : 23 '
Figure 58 Hadoop Remote Sources
3.2
Execute a Simple MapReduce Job (File Read)
SAP HANA has incorporated a very simple Map Reduce job in the Hadoop Controller that allows you to r ead a delimited file stored on the HDFS and display the results in SAP HANA. Create Comma- Delimited Test Files on HDFS
Initially make a few comma-delimited sample files containing the items listed in Table 3.
57
0
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
Code
Description
Total Integer
Value Decimal
aaa
Row A
30
23.56
bbb
Row B
20
11
I
3
Table 3 Comma-Delimited Sample Files
Execute the following statements on the Hadoop NameNode to create two files with example data (file01.csv and file02.csv): echo "aaa . Row A. 30 . 23 . 56 " SimpleF il e/fileOl . csv echo "bbb , Row B, 20 , 11 . 00 " SimpleFile/file02 . csv
sudo hdfs dfs -put
/user/admi n/
sudo hd fs dfs -put
/ us er/admin /
Alternatively you could create the files using HUE. As you can see in Figure 59, once execution has been completed FILE01.csv and FILE02.csv should exist in the HDFS directory /user/admin/ SimpleFile. A
f-1 1Ue
Out:ry Ed1tors
v
Metntore Manager Workflows v
•
•
1!3 File Browser
0 Action$ "'
ft Home
user I admm
SimpleFi le
,. Name
Show
x Mo ~to trash
v
• H1story
-'
Size
..
..
J
Cl
file01.csv
21 1>,1105
Cl
file02.csv
21 1>,1105
45
User
Pennisslons
Oate
admin
drwxr·xr·x
July 09. 2015 06 36 AM
1001
adm1n
drwxr-xr-x
July 09 2015 06 51 AM
rool
admin
-t'l.'-f· · (-
July 09 2015 06 36 AM
1001
admin
. (W..(• .(-
July 09. 2015 06 51 AM
admin
• of 2 rtems
Group
e Trash
Page
Figure 59 Simple Files in HDFS
Double click on FILE01.csv to make its contents visible (Figure 60).
58
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
tC Ue
it
Query Ed1tors v
Metastore Manager
Workflows v
•
a C:C v
1!.1 File Browser ACTIONS
* Home
I user I admrn
SrmpleFrle
file01 .csv
P•ge
IVrewas Dlnary , EOrt trle
.!. oownroad
l:i View file IotabOn
Z Rerresh INFO
l ast modified
July 9 2015
User
root G roup
Fi gure 6o File Contents in HDFS
Create and Execute a SAP HANA Virtual Function
Now in SAP HANA let's create a virtual function, using the Hadoop Remote Source to read the file(s) (Listing 11). CREATE virtual FU NC T ION HOEVOl . HOFS_FI LE_REAO() RETURNS TABLE ( " code " VARCHAR(255), " description " VARCHAR(255 ), " total_INT" integer . " va l ue_OEC " decimal( l 0 . 2l l CONFIGURATION ' enable_remote_caching - true ; cache_va l idity- 3600 ; hdfs_ 1 o c a t i o n• Ius e rIa d mi nISi mp 1 e Fi 1 e ' AT Ha doop_SOURCE_COH ; listi ng
11
SOL to Create a Virtual Function
The function will now appear under the HDEV01 schema (Figure 61).
59
J
3
f)~
3
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
t1:;
SAP HANA A
fde f.d•t
t:faviga1e frojtd
~ndow
I
~ (~ SAP HANA Administration Consote
f.o Systems E3
0
fBl · ( !ill il · lm iS CJ ~
• !h. HOB (HOE\'01)
@I
c:J
IEJ SAP HANA Development
S •HOB • SQl Console 1 &3 1"1 HAOOOP BK MR.sql
HOB (HDEVOl) S2.!0.90.13SOO
"' . . Catalog
b Public Synonyms
0: HANA_XS.BAS£ "' _: HOEVOl Do
a. (olumn VitwS
~ &j.
EPMModtfs.
~ Qj, EPM Quf.()' Sources "' fii, Functions
['j} HOFS_fi.U!AO t> Sij. lndexes
ito Proceduns & Stqutnces C~o Qt. Synonyms t> Sit- Tables ~ &t Triggers ~ &to Views ~
Do
p.
;a iOT
.., PSA > .0:: SAPJ
- sYS
p. ~ SYSTEM
.l. t~t
_.'l UIS
A> Wn!
t1
!::felp
..description'" , • ,
successfully
ne:ce,.~ t: ed
c:J Properties &3
0
l
tOr
in 329 •s 464 J.lS (ser ver processing time: 67 ms 534 ps) • Rows Affect ed:
Lo~
@~
Proputy
Value
"' Session Auto Comm it Cli~nt Distribution bolation t~l Single frlch fOt Resutt
On On Read Committ~d
f:1
Off
"' System Smart ln~rt
Fi gure 61 Virtual Function Appears in HDEV01 Schema
Next execute the SAP HANA SQL to launch the Simple Map reduce task using the following statement: SELECT * from HDEVO l . HD FS_FILE_READ()
The results shown in Figure 62 should appear.
60
e
3
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
~ SAP HANA Administrarion Console • C:\Wi:ndows\syste:ml2\SQl Con~ 1 System H08 Host S2.10.90.US lnstan<~ 00 ConnKted U~ HOEVOlSystem Us.gr. Cus.. c
file fdit f!!Mgate f rojKt
~ndow
Quici:.Acces ~ Systems
!:1
0
!:i! U · o r.Ei s ~
®·
• 1l. HOB (HOEVOl) a. Cat•log
S IIWSAP HANA.AdministrationConsole IEJ SAPHANAO~tlopment =
C •HOB • SQL Console 1 S3: M HAOOOP BK MR.sql
HOB (HDEVOl)
a
4
~ Iii- Pvbi!C Synonyms • ,a! HANA)(S_BASE
SQl
...
code
~ EPMMoclc:ls
... EPM Qut.ry Sources
bbb
G Function5
0
52.10.90~3500
~ Rtsull
SELECT • f ....
,G HOE\'01 ... Column View$
4
@) ~
Jjelp
HOMt.HO•s.•ne_•oool
description
tot41jNT value;_OEC
Row A
30
23.56
RowS
20
11
lj
HOFS_ALE._R£AD liio lndetts .-. Procedures 1iit> S«!uencts
Q> Syl'lonyms Qt. Tables
.
iit Tri99"'
W VitwS -& lOT ~ 4 SAP_HANA_AOMIN ;(; SAP_HANA_IlEMO J,: SAP_HANA_EPM.NEXT ~ SAP.HANA..TEST all SAP.HANA_TEST.OEMO
.I SAP.REST_API Jl SAP)CS. LM
successfully execut~ in 6se IllS 41 J.lS (ser n r prc>cusing ti«e: 344 ms 497 JlS) Fe-tched 2 r
0
,I SAP,.XS..LM..PE
Propettln &3 0 Error log
Property
~ ~ svs
4
• ,a! SYSTEM
On On
Auto Commit
• .a! ttst ~
Value
Sess•on
.: urs
• ,G YnLE 4
Clitnt Distribution lsolation levd Single fete h for R~lt System
;dbc::sap-J /Sl.10.90.•. .5.220:3001S:HO£Wl
Read Committed Off Writable
] ,1 .
Smart lnsert
Fi g ure 62 Results of Simple Remote Fu nction
In Hadoop you can see that a MapReduce task was executed by the SUCCEDDED label that appears (Figure 63). t4l
ue
•
..
Query EditOrs v
•
•
e~
Job Browser
Usemame j3t..rch for us.emame
logs
Melutofe Man.er Wofttflows v
10
Text Seartt1 for text
N ame
1435991080510_0061 TempletonCon1rolledob
Status
Ustr
Maps
Rtduon
Queue root hdfs
Pri ority
Ouratio
20s
N/A
Fi g ure 63 Hadoop Job Browser
61
Developing and Execut ing Hadoop MapReduce Tasks from SAP HANA
3.3
Build and Execute a Custom Map Reduce Job (Document Scan)
In SAP HANA, version SPS09 and onwards, it is possible to write and deploy a custom Hadoop MapReduce job on a Hadoop cluster directly from SAP HANA. As a brief overview, the custom Java MapReduce is prepared in SAP HANA studio, activated and stored in SAP HANA as a packaged MapReduce Jar file. A virtual function is then created, linked to the MapReduce job and attached to the Hadoop Remote Source. When a se 1ect statement is executed against the virtual function then : 1 The packaged MapReduce Jar file is sent to Hadoop (via WebHDFS Service) along with an XMLjob instruction file. 2. The MapReducejob is executed in Hadoop (via WebHCAT Service), and
the results of the job are stored in a temporary directory on the HDFS, under /sap/hana/mapred/<SID>!
3. While the Map Reduce job is running, SAP HANA is continuously monitoring the job using WebHCAT Service. 4. When the job is complete, SAP HANA returns the results in the HDFS I sap/hana/mapred!<SID>/
Initially make two sample files containing a list of names. These files will be used as input for the custom Map Reduce job. The custom MapReduce job will be a slightly more advanced version of the typical word count example. First, create two files and their contents:
» file01 : Jack Jill Bill Betty Betty Betty » file02: Jack Jill Harry Hillary Tess Tony Jack Jill
62
I
3
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
J
3
The execute the following statements on the Hadoop NameNode: echo "Jack Jill Bil l Betty Betty Bet ty " 1 sudo hdfs dfs - put - f / user/ adm i n/input/fileOl echo · J ac k Jill Harry Hi ll ary Tess To ny Jack Ji ll" 1 s udo hdfs df s - put -f - /user/adm i n/ i nput/f i l e02
Alternatively you could create the files using HUE. Once done, the FILE01 and FILE02 should exist in the HDFS directory /user/admin!input (Figure 64) .
~
File Browser
Search foe file name
ft Home
O Actons..,
I user I adm1n
input
v
• H1story
"
Size
~ Name
•
x Mo-.etotr3sh
1
•
Group
actmm
drwxr-xr-x
July~.
20t5 07 12 AM
1001
admin
drwxr-xr-x
July~.
20t 5 08 38AM
.(v.1..f-f-
July~.
20t 5 08.36 AM
July~ .
20t5 08 38 AM
fil eOt
33 bytes
root
adnun
D
m ao~
45 bytes
rool
odmm
• of 2 items
Figure 64 Sample
Dote
admin
D
Show 45
Penni55ions
9 Trash
Page
File~
The contents of FILE01 should then be visible (Figure 65). Create a Custom Java Project
Now we will create a custom Java project. Create a new Java project in SAP HANA Studio Developer perspective (Figure 66) by right-clicking anywhere in the PROJECT tab, then selecting NEW • PROJECT.
Developing and Executing Hadoop MapReduce Tasks from SAP HANA
it Que
t1 1Ue
l!l1
•
•
e ,;;-{;]
F e Browser
ACTIONS
it Home
user
admm
mput fil e02
of 1
P>9<
~
.c
,.
..c
JVIewas bOiary
r! VI<w ... lOCation
C Rerresn. INFO
modified
l~.st
J"' 9. l01S
User
'""'
Group
Figure 65 Sample File Contents
II§ SAP HAm OtYtolopme!lt • SAP HANA Slud10 file (dit tt~e s.... frcjo
10 ....... ~
-
~ · 0 · ~ 10' ·
13
'1ll"-···
j, s,....
...
. t!tlp
¢0v !<
. .
"'""'" Copy
Copy Quhhed N4Mt
-·
~ Ptstt
P.steSpec:..L.
RtnHne...
t.
,_..._
I
~
~
N~
...
H.AH6. Ocwlopmtnt
= c
Go into
,
IS W
=c
t '4
,...,.
gt I 4C SAP HANA Adtnitliie,.l.oOI'I C~lc
Q\lo
Cf H.doop&:.mplei (HOB (HDMil. 'HO£Wl.t
X
.
· ~ ¢ ·
F lllt•Shift•W •
-·
Ctri•V
-
O.ltlti.H4 l tblt
.J
"litll
Ctrf•C
Pr~t...
....
FCIIdtr
XS J~tScfliiC filt XSOOJUfilt
~ J• v•Scripc SoloWct ne ~
"
()Qmplc:•••
~ Oct'ltr-
CtrJ.N
[q)olt,••
Rdrt111
FS
Clo1oeProjc<1 CkneUnrtltted Proj«b Vtli.s.tt O.StbltJSlint
Profile As
"""''"' ·~.,
RtStort fwn lo
j
Lot off from W HANA System
r ..m Compare with
--<
Ccl'lftgurt
.. - . . .. .
Figure 66 Create New Java Project
jho!)tltt
~
e
C
RHourc.
G.t. (tl.it~gt Mtn.gtr ~
T • IC -' ~
til
~-
c
iJ
Surch ~tml>!
.
Ch• f19tiD:
-
3
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
Choose JAVA PROJECT from the list (Figure 67). I
~(~ New
S..lect • wiurd
i @l ~
=
r
Create a Java project
Wizards.:
type filter text " (Cp Java
~
~ Annotation
~
~ Class
(J Enum (i lllterface ~ Java Project
;I? Java Project from Existing Ant Buildfile ~ Java Working Sot
!If Package 53 Source Folder ~
tal> Java Run/Debug
.
~ ~ JU nit
-
®
< Back
I
Next>
I
Fmish
I
C.ancet
I
Figure 67 Cho ose Java Project
Name the project "javaMR_DocScan" and ensure you choose JAVASE-1!.7 in the dropdown menu next to the USE AN EXECUTION ENVIRONMENT JRE radio button. This will ensure that the Java project aligns with the Hadoop cluster version we are working with (Figure 68). Now, under JAVAMR_DocSCAN in the PROJECTS tab, you should see a folder called SRC. Right-click on this folder and select NEw • PACKAGE. Create a package called "org.hana.hadoop.mapred.sample" for the Java code (Figure 69).
I
3
Developing and Execut ing Hadoop Map Reduce Tasks from SAP HANA
ICi New Java Proje
'" =
a Java ProjKt
Create a Java project in the workspace or in an external ! ocation.
Project name: javaMR_OocScan [1) Use d~autt location Lo,.toon
Co\Apps\GBAMHB\HANA_WS_91BK2\j•v•MR..DocSc•n
Browse ...
JRE o Use an execution environment JRE: ..J
~I
IJavaSE-1.7
Use a project specrfic JRE:
com.sap.tdt.sapjvm.jre.win32.x86_64_81.0.0
{: Use d!fautt JRE (currently 'com.sap.ide.sapjvm.jre.win32.x86_64_81.0.0')
Configure JRf5.
Project layout Use project folder as root for sources and class files. t.O Create separat e folders for sources and class files
Configure default...
Working stts
0
Add project to worlcing sets
Select...
The default compiler compliance level for the current workspace is 1.8. The new project will use a project specific compiler compliance lev~l of 1.7.
L__<_B:..:•..:.ck'--..JL_:..: Next::.::..:>_....JI (..__F:..:in:..:is:..:h_..JI
_C.:.:•:..:"'.:.:•:..:'_....J
Ll
Figure 68 Project Name
66
3
3
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
lil:i J.va • SAP HANA Studio fil~
f.d"it
Source Retaqor f!!Mgate Sejrch etoj«t
·n ·
& ~ · ~ · o · (!I
~ltldow
Run
•
!:!tip
· <::> <::> ·
•
QuickAcceu
tl
Pacbge Explor~ t3
" 4
9
~
~ I ~ SAP HANA Administration Cons.ole ~ SAP HANA OevelopmMt ~
v c::::~ 1:1
<=>
0
g: outli ... t3
.
f,J javaMR_OocS<.tn
. ;.._
New GolntC)
' Ill • Ill
Open in New Window
Ql
Ope.n Type H1e.rarchy Show In
F4
Alt•Shift•W •
{ij (opy
(trl•(
!lil
Copy Quahfu:d Name
0
Ptstt
(tri •V
X
Ocktc
Otld.t
Bu~d
Path
'
Source
Alt•Shift•S •
Rdactor
Alt•Shift+T •
.......
Import...
<8'
Refresh
Export••• FS
...
Assign Working Sd:s" .
Profile As Debug As
Run As
0
Tum Comp.!lrewith
· L;
An outhne is not avatlable
~ Java Project
r3 !If
ProjKt... Pbckilgt
~ ( las.s (1 Interface (1 Enum
re
Annotation
es
Source Folder
~
hva Working Set
0
Folder
. 0
u
file
....
Untitltd Text File
rt:
JUnit TtstC.ISt
r3
b-•m~e:...
r3
Othtr...
~..
Res•ore from lo
Ctrt+N
Problems
~
0 c~ 2 waming~het~
'
Oe-cb at1
Rtsourcc
Otscrip6on
.. .
Validate
~ •
'
P.tth
W~rning.s (2 itt:ms)
[
"'
Fi gure 69 Create Package
The Java project should now be created (Figure 70). ~ Package Explorer ~
0
~
v ~ c:J
~ HadoopExamples (HOB (HOEVOI, 'HOE'IOI.Hadoop Examples')(
., fJ javaMR_Ooc'Scan 4
c:: rel="nofollow">
Hfdoopf.xample:s !HOB •HOEVOt HOE'VOl.Hodoopbamp!e$'1]
0
src '~
~ ~
org.hana.hadoop.mapred.sample JR£ Syst<m Library (JavaSf.l.7)
Fi gure 70 Package Created
Add External Hadoop Jar Files to Project
Before the custom MapReduce code can be written several Hadoop Jar files need to be added to the project.
LO<.rtion
Developing and Execut ing Hadoop Map Reduce Tasks from SAP HANA
The relevant Jar files can be copied from your Hadoop cluster to your local machine. Alternatively you can download from the Hadoop distributor's website. In this example the Jar files needed were downloaded from http :// search.maven.org/. Download hadoop-common and hadoop-mapreduce-client-core using the following links: http://search.maven .org/remotecontent?filepath=org/apache/hadoop/ hadoop-common/2.6.0/hadoop-common-2. 6.0.jar http://search.maven.org/remotecontent?filepath=org/apache/hadoop/ hadoop-mapreduce-client-core/2.6.0/hadoop-mapreduce-client-core2.6.0.jar In the PROJECT EXPLO RER tab add a new folder called "lib" and add the downloaded Jar files to this folder. The project should now look similar to Figure 71. ~ Package Explorer £3
~
d
~
v
c::)
~
"! HadoopElcampl•s (HOB (HDEWI, HDEWI.HadoopExamplos1) f£:J javaMR_OocScan • " src
e, org.hana.hadoop.maprt
21, JRE Syst•m libra')' (JavaSE-1.7)
• ~ lib
t!J hadoop-common-2.6.0.jar ~
hadoop•mapreduce·client•core•2.6.0.jar
Fi gure 71 Hadoop Jar Files
Next add the Jars to the build path. Select the downloaded Jar files, rightclick, then choose BUILD PATH • Aoo TO BUILD PATH (Figure 72).
68
I
3
3
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
Edit SoUtcc
File
Refodor
Navi91tc
Proj«t
ScOlrch
· t~> e · · ~ · O ·
[3 ·
-
·-
1m Java • SAP HANA Studio
1\un
. .
~ .
1!1
Win dow
H
<::> ·
-
.
~ J ~ SAP HANA Administration Consol~
Qu1d:.Acct1s ~
F~
Padcage b:plorer l:t
v
~
= EJ SAP HANA Oevdopmtftt 0
1:1
(OJ . . . . .
1:1
g:: Outi. ~
&3
~ 0
1:1
~ HadoopExamplts [HOB (HOEVOl. 'HDEVOl.Hadoopb.amples))
4
ffJ javaMR_OocSun ~
f1J src 16 JRESystun l ibrarylh'-·aSE·l.7)
4
~ lib
~
An .outline is not avaJ~bl e.
I
~hadoop·common·2.6.0.jar ~
h•doop·mtprtcluct·clitn
New
'
Op~n
F3
Show In
Alt•Shift•W •
t!) Copy 1\,l Copy Qualifitcl Name
Ctri•C
~ Paste
Ctft•V
X
Oel~t:
Oelde Build Path
...
.u .,_<>
'
Rdactor
I
:l Add to Build Path
Alt•Shift•T •
Import...
&port... R.efr~h
FS
Assign Worting Sets...
c.
Validotc
... ..
Profile As
'
Debug As 1\un As
Team Com~rt with
R.t:placc Wrth
~~
Res.ourct
m> i-
'"
The proj ect should now appear as shown in Figure 73. Package Explorer !:!
8
~
"' =
El
~ HadoopExamples (HOB (HOEVOl, HDEVOl.HadoopExamples')(
• fJ:J jav~MR_OocScan • 0 src e, org.hana.hadoop.maprr:d.sampfe ~ ~
JRE System library (JavaSE-1.7(
• 5I\ Referenced libraries ~ t>
•
9 S
hadoop-common-1.6DJar · C:\Apps\GBAMHB'HANA_WS. hadoop· mapreduce·client· core· l.6.0.jar • C:\Apps\GBAMt
~ lib
II!) hadoop-common-1.6D.jar a!!) hadoop· mapreduce· d ient· core· 2.6.0.jar
Figure 73 Project Ready to Use
....
-
= 1:1
--
l ocation
)
Figure 72 Add Jars to Build Path
1:
v
Oe
. :
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
Create Document Scan Java MapReduce
Now let's create the five class files shown in Table 4. These will contain all the code needed for the custom MapReduce logic: Class
Purpose
customKey
Custom key, containing filename and word
customOut
Custom output, containing word count and word length
SimpleDocumentScanApp
Main excutable of Map/Reduce (not used by SAP HANA; used for manual execution on Hadoop if necessary for testing)
SimpleDocumentScanMapper
Collects the words per document
SimpleDocumentScanReducer
Summarizes the words used
Table 4 Classes Containing Map Redu ce Logic
Class files can be created by right-clicking on the pacakge ORG.HANA.HAOOOP.MAPREO.SAMPLE, and then navigting to NEW • CLASS (Figure 74). This will create an empty class file which you can rename according to Table 4. 8 ~
... = 0
1:
Package Explorer !:3
•
~ HodoopExomples (HOB (HDE\'01, 'HDE'IOI.HodoopExomp es')) [? iovoMR..DocS
"' G src 1
e, org.h ana.hadoop.maprHI.sampl
• 8 JRE System library (JovoSE·1.7J
" a\ Referenced librari6 1> 1>
9
r.=
Showln
hadoop·mapreduce·client·core·
I!! hadoop·common·2.6.0.jar 1(!.1 had oop· mapreduce· client ··co re·
• rB rS
Open in New Window
h&d oop· common · 2.6.0.jar • C:\
• a, lib
I
New
IB
Copy
Alt+Shift+W •
Ctrl•C
~ Copy Quo l ~ied Name
1'1'
Paste
Ctri•V
Java Proj&t
Project...
~ Package
&
Class
0' G'
Inte rface
Enum
Fi gure 74 Create Java Class
Repeat these steps for each of the five classes or simply copy and rename the first class file you created five times. The necessary code for each file will be inserted in subsequent steps.
70
I
3
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
The fil e structure should now look like that shown in Figure 75. I:
Packag• Explor
9
~
v
~ l:l
~ HadoopExamples (HOB (HOEVOJ. 'HOEVOJ.HadoopExampl•s'))
"' ~ javaMR_DocSc.an " ~ src
" morg.hana.hadoop.mapred.samplt ~
Ql
t>
Q) Q) Q) Q)
p.
t> t> ~
customKey.java customOut.java SimpleDocume.ntScanAppJava SimpleOocumentScanMapper.java SimpleDocume.ntScanReductr.java
!!!l JRE System Library (JavaSE-1.7]
t> a\ Rde.renced Libraries • "" lib
Figure 75 Java Class Fi les Created
Next populate each of the five class files with the code examples in Listing 12 to Listing 16. custom Key package org . han a . hadoop . mapred . samp le ; impor t impor t import import
java . io . IOExcept ion : java . i o. Datalnput ; j ava . io . DataOutput : org . apache . hadoop .i o .WritableComparable;
& Word public class cus t omKey i mplements Wr i tabl eComparable<customKey> private Str ing filename; private Str ing word;
II Custom Key for Mapper. made up of Filen ame
pub lic customKey(String filename. String word) { this . filename ~f ile n ame; th is . word ~word : public customKey( ) 1 th i s . filename c new String() ; this . word ~new String(); public String getWord ( ) return 1~ord :
71
I
3
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
publ i c void write(OataOutput out) th rows IOException I out .writeUTF(filename); out .writeUTF(word) ;
pub li c void readFields(Oatalnput in) throws IOException { filename = in . readUTF () ; word= in . readUTF() : pub li c int compareTo(customKey otherKey> 1 if (otherKey == nu l 1 ) return 0; i nt intent i f ( intent return else { return
• f i lename .compareTo(otherKey . f il ename) ; ! = 0) I
intent ; word .compareTo(ot herKey . word);
pub li c int hashCode() I return this . toStri ng() . hashCode() ; @Override pub li c String toString() I return fi l ena me+ • .• +word :
Listing 12
customKey.java
custom Out package org . hana . hadoop .ma pred .sample : impor t java . i o . IOException ; import java . io .Oatalnput ; import java .i o .OataOutput : import org .apache .h adoop .i o .Wri table ; //Custom Output fo r Reducer . in cluded Word Count and Word Length pub l ic cl ass customOut implements Writabl e I II Some data pr ivate int count :
72
J
3
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
pr ivate int length ; publ i c customOut() t this . count = new Integer{O) ; this . lengt h = new Integer(Q) ;
publ i c customOut(int count, int length) t this . count = co unt ; this . lengt h - length ; publ i c vo id write(D ataOutput out) throws IOException { out . writelnt(count) ; out . writelnt(length) ; publ i c vo id read Fi elds ( Da tal nput in) t hrows IOException ( count = in . read l nt() ; length= in . read l nt(} ;
Listing 13
customOut.java
SimpleDocumentScanApp
package org . han a . hadoop . map red .sample ; import impor t import import impor t import import import impor t impor t
org . apache . ha doop . conf . Configu ration ; org . apache . hadoop . conf . Configured ; org . apache . hadoop . fs . Path ; org . apache . hadoop . mapreduce .Job ; org . apac he . hadoop . mapreduce . li b. input . Fi le ln putFormat ; org . apac he . hadoop . mapreduce . lib . input .Textl nputFormat ; org . apac he . hadoop . mapreduce . lib . output . FileOutputFormat; org . apac he . hadoop . mapreduce . li b. output . TextOutputFormat ; org . apac he . hadoop . ut il . Tool ; org . apache . hadoop . ut il . ToolRunner ;
publ ic cla ss Si mp leDocumentScanApp extends Configu red implements Too l t publ i c static void main(St rin g[] args) throws Exception t i nt res = ToolRunne r . run(new Conf i gu ration() , new Simp l eDocumentScanApp() . a rg s) ; System . exit(res) ;
73
J
3
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
public int run(String[) argsl t hrows Exception I Job job ~ Job .get l nstance(new Con f i gurat i on()) ; job . setJobName( "Simple Document Scan ") : job . setOutputKeyClass ( customKey .class); job . setOutputValueC la ss(cus t omOut .classl : job . setMapperClass(S i mpleDocumentScanMapper . class) ; job.setCombinerClass(SimpleDocumentScanReducer . cl ass) : job . setReducerClass(S i mpleDocumentScanReducer .classl ; job . setlnput FormatClass(Text lnputFormat .cl assl ; job . setOutputFo rmatClass ( TextOutputFormat .class) ; FilelnputFormat .setlnputPaths(job . new Path(args[O)ll ; Fi leOutput Format . setOutputPath(job . new Path(args[l))) : job . setJa r ByClass(SimpleDocumentScanApp .class) ; j ob . submit() ; return 0 ;
Listing 14
SimpleDocumentScanApp.java
SimpleDocumentScanMapper
package org . hana .hadoop . mapred .sample ; impor t java . io . IOExcept i on; import java . util . regex .Pa ttern ; import java . util . regex . Matcher; import org .apache . hadoop.io .Text : import org .apache . hadoop.i o .I ntWritable ; import org .apache . hadoop . mapreduce . lib . input . Fi leSplit ; impor t org .apache . hadoop . mapreduce . Mapper ; ////////////////////l/1111111
//MAPPER //Read document , ignore some special characters and collect //words used in document File Name+ Word //Custom Key is /////////////////////////////
public class SimpleDocumentScanMapper extends Mapper
74
J
3
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
customKey , IntWritable> l pr ivate pr ivate pr i vate pr ivate
final static IntWr i tab l e one - new IntWritabl e(l) ; Text word- new Text(} : Pattern pattern- Pa t tern . comp il e( "([A -Za-z]+) " ) ; cus tomKey cuskey- new customKey();
publ i c void map!Object key, Text value. Context context) t hrows IOExcept i on, Interr uptedExcept i on l Str ing filename ((Fi l eSp l itl context . get l nputSplit()) . getPath() . getName(); Matcher matcher= pattern . matc her(va l ue . toStringlll : while (matc her . f i nd(}) l word . set(matcher . group(l) . tolowerCase(ll : cuskey =new customKey(fi l ename , word . toString()) : context . write(cuskey, one) ;
Listing 15 SimpleDocument ScanMapper.java
SimpleDocumentScanReducer
package org . hana . hadoop . mapred .sample : impor t j ava . i o . IOExcep t i on ; impor t org . apache . hadoop . i o . JntWritable ; import org . apache . ha doop . mapreduce . Reducer : pu bl ic cl ass SimpleOocumentScanReducer extends Reducer<customKey , IntWr i table , customKey, customOut> { publ ic void reduce(customKey key , Iterable
Listing 16 SimpleDocumentScanReducer.java
75
I
3
3
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
Create Hadoop MR Jobs Archive File
In this step we will create the MapReduce package, and store it in SAP HANA. This package will then be used to pass the MapReduce Jar to Hadoop when queries are made in SAP HANA. First, create the MR Job Archive file (Figure 76). iQ SAP HANA Ot\-elopment • SAP HANA Studio f•le: f
!!!fVlg~tt
St.Jrch £rOJW. Bun
c:9 ·
· ~ · 0 · (!.
•
Ould:.Access
10 P•oj...
!:! '(IJ Repo...
'I., Sy.c..
0
1:1
8 ~ "
4
Q HadoopExamplts [HOB (HOE\'01. ~
a\ JavaScript Resources ~ MR
~ ~
SAP HANA S)'item l •braty
l!\ .XUCCtU
.c.(;;) looo!3ool
~ l .: <.oP ..._.N.
lll:i New
.•
HOEVOl
HANA Oe'V'doptnet\t
~<>
S.lect il wi.urd
r
- _..-
Hadoop MR'cbs Archive
IWIUitds::
typtf•lter t v:t
1!1 """PP
~
,.
&;J j.vaMilDocS<•n
'!:
Database Otvtlo.pmtnt ~ Database Tabit DOl Souret f •lt
0
fit Decision Table
[:
')G Flowgr.,ph Modd :.: • Hadoop MRJobsAtGhivt Q? Hadoop ~emote Sovrct
I
a? Hadoop Virtuol Function
";
ljl Role (W' Sc.ti.Jor Function 5iZ; Schema
-:
~ Search Rule Stt Filt
-
~
I
N"'>
I
f1 ni ~h
I
Coned
I )(
~
Deuription
,. A Wuning5(1 itun) .1)
Build path s~c ifi ts ~ecution environment h j.w1MR_I
Sys-ttma>. ChangeiO:
Fi gure 76 Create Hadoop MR Job Arch ive
Name the file "DocScan.hdbmrjobs" (Figure 77). Select the Java project with the MapReduce code (Figure 78).
,ea
"
Developing and Execut ing Hadoop Map Reduce Tasks from SAP HANA
Hadoop MR Jobs Arc:hivo Stlttt I HAIIIA Shl ftd Proj«t to Slort th~ IIIChivt
Ent~ or $tl«t tht p.rent folder.
H,ufoopExlmplu/MR
In
~ tCf .HD8.)2..10.90.135JIO.SINGL£D8.1-f)(V0l.lst-stttn PrejKt] • Cf H•6oopEumples (H08 (HOMl., 'HOEVOLH.doopExamplfl')) •
.stttings
~ Mit
Filt t'Wime: OocSutt.hdbrnrjobs
C•n
I
Figure 77 Define DocScan Archive File
HIM:toop MR Jobs Archive
;.;
Stl«t • MapRtduce projt<.t t nd schti'M for tht 1rchiw:
-
(nter or st:l«t the: p.rtnt folder: j•v•MflOO<X.,.
xh~~· ~l"~"~~~----------------------------------"·1
-
®
fitlish
II
Cu~<:c:l
Fi gure 78 Link DocScan to Java Project
77
3
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
The hdbmrjob file will now appear. Once you manually activate the project, your project folder should look like Figure 79. (0 Project Expl... 1Z t(}J Repositories 9-o Systems
= El
• ~ HadoopExamples (HDB (HDEWl, HDEWl.HadoopExamp ~
e\ JavaScript Resources
~ ~
SAP HANA Syst•m Library
m.xsaccm (!FO .xsapp ~
4
DocScan.hdbmrjobs
f-'J javaMR_OocScan 4
~
t~-
~
src
~
EB
org.hana.hadoop.mapred.sample
I!!A JRESystem Library (JavaSE-1.7)
\9
hadoop-common-2.6.0.jar
S
~ hodoop·mopre
Fi gu re 79 DocScan Created
Not e In SAP HANA SPS09 the hdbmrjobs fil e needs to be deleted and recreated every time the source code changes.
Create and Execute SAP HANA Virtual Function
In this step we create a more complex virtual function that will reference the following info. Parameter
Detail
Package
Name of t he custom Hadoop MR Jobs Archive, which contains the MapReduce Jar
mapred_input
Location on H DFS of the fil e(s) to process
mapred _input
Location on H DFS of the file(s) to process
mapred _mapper
The custom Map per class (e.g. , simp 1eDocumentScanMa ppe r )
mapred_reducer
The custom Reducer class (e.g., Si mp l eDocumentScan Reducer)
Table 5 Packages to Create SAP HAN A Virtual Function
I
3
Developing and Execut ing Hadoop Map Reduce Tasks from SAP HANA
First we n eed to run the following SQL to get the precise package name: SELECT* FROM "SYS" ." VIRTUA L_ FUNCTION_PACKAGES" ;
A list should appear, with the full package name of MR Job archive file shown, such as HDEV01.HADOOPEXAMPLES::DocSCAN (Figure 80). ~ [ffi Result ! SELECT • FR<»> L....::,"S "Y ":::-: S.=.-=.. v"" IR:-= TU,-:A.,L_-=Fu " "Nc::: CT:= ION ,.,.-, _P:A7CKA ""G ::-::E-::-: S": - - - - - - - - - - - - - - - -
SCHEMA_NAME
PACKAGE.NAME
AOAPTER_NAME
CREATE.TIMESTAMP
CONTE ~
SYS HDEVOl
sap.hana.hadoop.controller::CONTROLLER HDEVOl.HadoopExamples::OocScan
hadoop hadoop
Jul lO, .I.OlS 7:34:24.306 AM Jui10, .1.01S9:57:44.967 AM
PK U PKUt
Figure So List of Virtual Functi on Packages
In this example the packge name "HDEV01.HadoopExamples::DocScan" will create a virtual function that will execute the MapReduce job, returning four columns, as defined by the customKey and customOut definitions in Table 6. customl<ey
Filename
customOut
Word
Count
Length
Table 6 custom Key and customOut Definitions
Run the corresponding SQL statement: CREATE vir t ual FUNCTION HOEVOl . MR_OOCSCAN() RETURNS TABLE ( "filename " NVARCHAR(400), "word " NVARCHAR(400) . "wordcount" INTEGER . "word l ength " INTEGER) PACKAGE HDEVOl . "HOEVOl . HadoopExamp 1es : : OocScan" CON FI GURATI ON ' enable_remote_cachi ng=true ;mapred_jobchain=[{ "mapred_ input " : "/user/admin/input " . · mapred_mapper · : · org . hana . hadoop . mapred . sample .SimpleOocumentScanMapper" , "mapred_reducer ":" org . hana . hadoop . mapred .sample . Si mpleDocumentScanReducer " IJ ' AT Hadoop_SOURCE_COH ; List ing 17 Create Virt ual Fuction for DocumentScan MR
79
I
3
Developing and Execut ing Hadoop Map Reduce Tasks from SAP HANA
The virtual function should have been successfully created, and will appear as show in Figure 81: 0 Project E... llJl Repositor...
~0 Systems l;:l
= El
lfj'l · l liiil U · m~ ~ ir=J %
• lfh HOB (HOEV01) •a
Catalog Public Synonyms ~ ,Jg HANA)(S_BASE • ,.jg HOEVOl ~
a
t> "' Column Vit!WS ~ ~
EPM Models -. EPM Query Sources ,. a, Functions ~ HDFS_FllE_READ ['§ MR_DOCSCAN ~ liP Indexes t> k;. Procedures 1> Sequences ~ liil> Synonyms ~
a.
~ ~ Tables
~ "" Triggers ~ 5 Viows
Figure 81 List of Virtual Functions Created
Finally execute the virtual function and the associated MapReduce job with the following SQL: se le c t * from HDEV0 1.~1R_DOCSCAN(l order by " fi l ename " , " word ":
The results should appear as shown in Figure 82. HOB (HOEVOl) 52.10.90.13500 IE! SQL
ilfll
Resuk l select • frOOt '-::H"' OEV :::e"'t"'.~"'tR"' _ooc =sc = AN""(.,) ...,.o-r d;-:e-r -;:-b-y -;;.-;c fi"'le.,..n..,. a,.. -,-;; .. ,- ;;.wo .,....,... rd=- 1
10
filename
word
file01 fileOl fileD! file01 file02 file02 file02 file02 fileOl fileOl
betty bill jack jill harry hillary
wordcount
wordlength
jack jill tess tonv
Figure 82 Results of Simple Map Reduce
8o
I
3
Developing and Executing Hadoop MapReduce Tasks from SAP HANA
Scan Books in a Public Library
Executing a document scan like this against a few small files certainly isn't something you need Hadoop or SAP HANA for. The true power of Hadoop is that it is scalable and able to process thousands or millions of files. Once the results have been compiled, SAP HANA is ideally suited to aggregate and present that data back to users. To give a small taste of that let's extend the earlier example a little bit. First delete the files in the HDFS under the /user/admin/input directory. Next download a few free books from http://www.gutenberg.org/ and store them on the HDFS. In this example let's scan:
» Pride and Prejudice » A Tale of Two Cities » The Adventures ofSherlock Holmes Run the following Linux statements on the Hadoop NameNode: sudo hdfs dfs - rmr /user/admi n/input/* curl http : //www . gutenberg . org/cache/epub/1342/ pgl342 . txt I sudo hdfs dfs -put - / user/admin/input/PrideAndPrejudice cur l http : //www . gutenberg . org/cache/epub/98/pg98 . txt I sudo hdfs dfs -put - /user/admin/input/ATaleOfTwoCities cur l http : //www . gutenberg . org/cache/epub/1661/ pg 166 1. txt 1 sudo hdfs dfs -put - /user/admin/ i nput/ TheAdventuresOfSherlockHo l mes list ing 18 Download Three Books and Store on HDFS
The input directory should look like Figure 83. Finally run the Virtual Function again, this time storing the results in SAP HANA. Run the SQL statements in Listing 19 to create a results table "MR Results". Then execute the virtual function, via an insert & select statement. The results are stored in the new table.
81
I
3
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
3
J
create column tab l e " HOEVO l". " t~R_ RESULTS" ( " fi 1en ame " NVARCHAR(400), " word " NVARCHAR ( 400) . " wordcoun t " INTEGER , "wordlengt h" I NTEGER) ; inse r t i nto " HDEVOl "." MR_ RESULTS" sel ect * from " HD E V0 1 "." ~1R_RESULTS ": listing 19 Execute MR and St ore Results in a New SAP HANA Table
f41Ue
8
it
Query Editors v
Mebllstore M.neg-et
WorkflOW'S v
•
Start~
fo1 file narne
1t Home
O Act1onS .,..
user adm•n
input
• Name •
x MO\oe totrash
0
JiW ~.
v
.,
Y
Size
1
User achtin
•
Show
•
File Browser
Group
Penniu io1\s
9 Trash
HIStory
Dale
admin
ckwxr-xr-x
July 10. 2015 04:02AM
drwxr·xr-x
July 10. 2015 04·02 AM
root
admm
D
AleleOfTwoCities
7743KB
rool
admm
Cl
PrideAndPrejudice
700.8 KB
rool
admin
-M'-<-f-
July 10. 2015 04.01 AM
()
TheAdventuresOfSher1ockHolmes
581.0 KB
root
admm
-M'.f-f-
July 10. 2015 04:02AM
~s
" of 3 nems
July 10 2015 04·01 AM
Page
Figure 83 Books Stored on HDFS
Now we can use SAP HANA to perform detailed analysis of the results: » Number or words per book (Figure 84) » Most commonly used words (Figure 85) » Most commonly used words with length greater than five (Figure 86) » Most commonly used words only in Pride and Prejudice (Figure 87)
82
Developing and Executing Hadoop Map Reduce Tasks from SAP HANA
4/
"HDEV01"."MR_RESULTS" ~
fED Raw Data (]] Distinct valu~
E!
J1t
~vailable objects
a · au a•
T _. 1
llli
f
Anatysis
~beb: axis filename
q
Grid =
filename
AlaleOfTwoCities PrideAndPrejudice
,. Ll Numeric '
wordcount
1
wordltngth
TheA.dventuresOfSherlockHolmH
•
Values ~xis
I Max rows:
f.1 . . ,
200
=
-
4
~a~ 1::: Tabie J iill
X
String filename word
Show log
3 rows retrieved 283 ms
~ ~·
HTML
wordcount_SUM
-
141,487 125,897 109,000
1~
• wordcount .,. x
Figure 84 Number of Words per Book
c s~ select "'word"' 1 "wordcount"" , "wror-dlength"" "fro. ( select "'word"' , s... ( ..wordcount"') 21s "'wordcount'" , avg( "'wordlength .. ) as ..wordlength"' fro. "'HOfV&l" . '"HR_RESUL TS ..
group by "word"' ) order by "wordcount"' desc
word the and to of
in
that
10
was
11
he
12
you his
13
14 15 16 17 18 19 20
her with had
"not is for
2'1
be
22
at
wordcount
word length
18,547 11,813 10,717 10,648 7,730 7,098 6.420 5,381 5,317 5,032 4.685 4,497 4,441 3,700 3,335 3,313 3,229 2,984 2,889 2,825 2,691 2,636
Figure 85 Most Commonly Used Words
3
Developing and Execut ing Hadoop Map Reduce Tasks from SAP HANA
a SQL -.. Flow• sel~ct Mword" ~ "wordc.ount" ~ "wordlengttl" fi"''a ( sd~ct "word" , s..-( "wordcount" ) u '"wordcount", avaC wordhttgth") u &roop by "WOf"d" ) where "wordlength" ) S order" bv '"WO«fcoont" desc
word
word
lil1l• elitabeth
7l5 63;5
bdore
6lll 601
1-hould
holmn
''""' though
389
witho-.rt bennd
37l
......
3l3 320
l06
14
btngley ddoJrgt:
IS
thtough
299
16
always
lal
11 18 19
guunb... herself
281
........,
278
friend
270
PfO.Kt
264
m
278
sister
20 21 22
wordlength
m m
hiMWf
13
"t()EV91". "MA_R.ESULTS"
4fi7 436
nothing
10 II 12
"wordl~ngth" fr~
273
Figure 86 Most Commonly Used Wo rds wi th Length Greater than 5
HOB (HDEVOl) SU090J3SOO
a
SQL
l
t_e R~utt
s~lect
'"word"', ·wordcount" f!"f» '"HOEvet• . "Mit RfSULTS"
where "filena-.c" • 'PrideAAdPrejudice' and "word" not in ( nhct distinct "word" order by "wordcount" desc
,.,,.
......., datcy btnnd
10 11
63S 418 323
bingley
l06 194
collins
180 111 97 97 88
th~rlotte
as
12
ndherfield
13
u
kity
n
14
luus mttyton bthlviour ptmberley rosings
10
lS 16 11 18 19 20 21 22
t Miity htttf«dshire forster bourgh
'"HO'EWl" . "MA_RESUlTS'" wt\ot'l"e "filen,_" <> 'PrideAndPrejudice:' )
wor
wttkham lydia liuy gatdiner longboum
fr~
S7
ss S3 49 42
"
39 39
Figure 87 Most Commonly Used Words only in Pride and Prejudice
3
Ut ilizing Hadoop REST Services within SAP HANA XS
4
Utilizing Hadoop REST Services within
SAP HANA XS In the earlier sections the integration examples focused on accessing Hadoop data via SQL statements. SAP HANA is much more than just a database. It is also a development platform for creating custom HTML/5 applications. This section aims to highlight some of these capabilities, focusing on how applications deployed on SAP HANA are also able to read and write data from Hadoop. In order to demonstrate this, two REST APis are used:
» WebHDFS: File System Interface for HDFS » Stargate: HBase Interface 4.1
Accessing the Hadoop File System (HDFS)
To remotely read and write files to the HDFS, the WebHDFS REST API can be used. In Section 3, WebHDFS was used to create temporary directories, store Jar files , and collect the results of the MapReduce job. This is mostly transparent to the user. In order to use WebHDFS dir ectly from SAP HANA XS, a direct connection between SAP HANA and Hadoop needs to be explicitly defined using an xshttpdest file, in the SAP HANA development repository. With that in place a simple application can be developed. Figure 88 shows a simple example architecture of an application that displays the HDFS directory structure and enables files to be downloaded.
I
4
Uti lizing Hadoop REST Services w ithin SAP HANA XS
I DOWNLOAD
HADOOP Directory Structure
HANA SAPU15 ind ex.ht ml:
HADOOP Directory List
/----
..__ /
/
webHDFS.xsjs
HANA XS:
LISTSTATUS
OPEN
webH DFS.xsjslib
/
-
xshttpdest [Name Node]
I HADOOP:
/ -~
xshttpdest [Data Node]
w ebHDFS
~ -----·
I
HDFS: Hadoop Distribut ed Fi le System
Fi gure 88 SAP HANA Hadoop HDFS A p pl ication Techn ical Overview
Calling the WebHDFS REST API
W ebHDFS uses different URL parameters [operations (op)] for interacting with HDFS, e.g. to read the directories and download a file the following operations are used:
86
I
4
Ut ilizing Hadoop REST Services within SAP HANA XS
Operation
Linux equivalent
FILESTATUS
'dir' or 'Is' commands on a specified HDFS directory
OPEN
ftp 'get' command.
Table 7 WebHDFS URL operations for HDFS interaction
The following are example URLs that can be used to test the above operations:
http://
See the following for further information: http://hadoop .apache. org/docs/ r2. 7. 0/hadoop-proj ect-dist/hadoop-hdfs/ WebHDFS.html xshttpdest File
From SAP HANA Javascript code you are unable to call WebHDFS directly; you will receive Cross-origin resource sharing (CORS) errors. To get around this create an xshttpdest file. The contents would be similar to Listing 20: hos t = "
I
4
Ut ilizing Hadoop REST Services within SAP HANA XS
pathPref i x = "/webhdfs/v l"; authType = none : use Proxy - true ; proxyHost = "proxy-trial ": proxyPort = 8080 ; timeou t = 0; list ing 20 webHDFS.xshttpdest File
Note
You may need additional entries for each DataNode, for downloading files ,. as the NameNode host is red irected to the relevant DataNode.
SAP HANA XS Code Example
The following is a summary of the code required to call the webHDFS from SAP HANA, and to display the output to an HTML/5 SAPUI5 page. The complete code can be found in the supplemental downloads that came with this E-Bite. Create the files listed in Table 8. Each of these files will be populated with the code examples that are found in the downloadable content. File
Purpose
webHDFS.xsjslib
Library of code for connecting to xshttpdest locations, and handling the webHDFS URL parameters for LISTSTATUS and OPEN
webHDFS.xsjs
Uses webH DFS.xsjslib and creates a simplified access point for listing directories or opening files. This is the cal l by SAPUI5 screen
index.html
SAPUI5 (Horizontal Splitter, Tree, and Table controls) screen, which calls webHDFS.xsjs
Table 8 Files Requ ired to cal l WebHDFS from SAP HANA and Display Output to SAPUI5
88
I
4
Ut ilizing Hadoop REST Services within SAP HANA XS
J
4
1)
c ... .
Note For an example of storing SAP HANA results to Hadoop, you can see another example, w hich uses PUT to webHDFS: http://sen .sap .com/com mu nity/developer-center/hana/blog/2014/07/04/ downloading-query-results-to- hadoop-hdfs
Example Application
Figure 89 is an example of what the finished application looks like.
----
p
~Oo........MI-IIf_l_fil ..pkwH
· Cweoe:Po.· 0 1.....
-"""'"
·o · O ~~tl"' · CI -t~tt
·CI- " ' · O•
· o ~~
· o- ..... · o-
· o --ro. -a- ~-
.,_
-. ~-
· a-· : :J-· :::Joo•
· 0~
·0-
·o-
Fi gure 89 HDFS Directory List from SAP HANA XS
Select a file and then download (Figure 90). l)oM'IIoao
....
Q Q
,.SUCCESS
...........,..
........
.,..fdrlil; ~~oMfoad••,.,.. (l.l»lS)
Fi gure 90 Download HDFS File
.., . . .,,.., . .y~()alo -IQOII(IoooiOI
=
Ut ilizing Hadoop REST Services within SAP HANA XS
The results of the download should now appear (Figure 91).
,,.,
Oownload
Name
Sile Kb
~
_SUCCESS
~
part-m-00000
... ® looof3oool
rJ ( :\Use:rs\Aron.M.KOonald\A.ppOat.o\locai\Temp'tpart·m..()()(l()l)-2 • Notepad~ • File
Edit
v;.,.
Sdf(:h
o ..J ~ ~
0
Etw:ocing
l anguage Sdting• l&ao Run
1.,e 1• •• 1 ~
o ~ l .t
Plu-gins
Window 1
[l)"Jl rn ~ 1oo
~ 1 CC~ I """'
(i)
X
rn il ..a t@!l..,
...
Ia
' • •
~ ,.~z l:ll ·- 4 2011 -03 - 0 7 0 5 : 1 7 : 2 7 . 1.00 - 6. 252
1 51. 0092
2
2011 - 03- 06 23 : 4 7 : 01.$60 - 60 . 8062
3
20 11-03- 0 6 23 : 2i : S2 . SSO -6 . 2 8 58 150 .9379
6 '
...•' -" " .6
.. .. .2
:7
:9
20 2:
22 23 2<
2S 26 27
,.
19
- 2 6 . 9286
34. .56
1. 22
2 . 31.8
1 . • wl!
90
8 . 31
0.1
~
17
2. U 2
0 .81
1 .8
2011-03-06 21 : 5 6 : 4 5 . 900 19 . 1685 - 67 . 9 2 51 S2 ZOH-03- 0 6 1 5 : 1 5 : 2 1.09 0 3 5.9391 31.297S 5 1. 62
1.5
2011-03-06 14 : 31 : 46 . 640 - 21 . 1798
S7S . 1S
- 178 . 91SS
17
S. l @
10
4 . 6 Ml ~
19
262 . 8 1.01201 573 S6 1.3.82 0 . 86 87 1 - 687 1 . 9 wl!
20 11-03- 0 6 13 :51: 1:0 . 000 6 1. 591:5 - 1 59 . 6895
17 .5
3.9 ttl
2011 - 03- 0 6 13 : 11 : 36 . 260 16 . 37$
7 . 31.
u.
us co-oon1na
l.l l!l
u.sc000n1 bn
u• 0 . 13
u•
o. , ..
u
2 0 11 - C
""
prU 0 6 SOO~
u s cOOOn1 3d
u•
2 011: - (
u:rc000n12c
akll17757B
2 0 H-C
U . $1
1 . 3 wl!
26S 1 - 352
o. 72
u•
1.l#C000r.i 1111
20 11 -03-06 10 : 2 3 :59 . 6 10 - 7 .6507 117 . 1 5 0 1
293 . 11
5. 1
~
61
3. 078
0 . 99
U>
u s eOOOnt OS
201-t-03-06 OS : i2 : 37 . 3t0 U . S696 H$ . $736
2oe . ee s .• wl!
2$
L U.S
0. 94
u•
u.• c:000n3d
- 97 . $789
- n .. s1ss
20 14-0 3-0 6 0 4 : 3 7 : 0 6.200 -33.3278
5 8 .93
s
2011-03-06 03 : 21: 20 . 020 Sl.'t6H 176. H02
18 . 27
20 H-0 3-0 6 00 :55:55. 3 00 3 5. 7092 - 121.063
9 . 8 3. 1 Ml
2011 -03-06 00 : 26 : 33 . 000 -22 . 123
-1o.sse 1:1.s
20 11-0 3-0 6 00 : 23 : 19.330 - 0 . 0 828 1 22 . 9 1!9
1 35 . 11
33
1$3 . 9798
62
•
s.s ;;m
10 . 2058 - SS . 3Hi4 3 4.21 4. 7 -14 . ?995 16? . 2 4 0? :.14 . 23 38 . 0848 2 0 . 278 1 6 <6 4. 6 ~ 31.3588 138 . 1936 383 . 21 •• 7 25 . 68 21 -99 . 2918 36.58 4. 3 35 .6111 •91 . 312 9 6. $1 3. 3 38 . 1854 2 0 . 1805 10 . 0 6 4 . 8 ;1:1: -14 . 7341 169 . 8222 6 36. 7 6 33 . 9296667 - 116 . 347 6 . 59 -3 . 9?9.8 -16. 3293 110 . 9 6 • • 6 62 . 084 2 - 1 49 . 4622 3S . 7 4. 4 31.383 •119 . 3 5 51 2.07 s
0 .!61
110 1.582
wl!
5 7 .6
1 . 3 !l.l!
2011-03-os 22 : 27 : 07 . 830 -s . eu 20 14-0 3-0 5 21 : 15 : 53 . 7 9 0 20H•03-0S 11 : 3 4 : 20 . 280 20 14-03- 0 5 1 5 : 08 : 44 . 530 20H•03•0S 15 : 02 :45 . 1.60 2014-03- 0 5 14 : 4 0 : 35 . 380 20 11 ·03·0$ l1: : 1 7 : 0 6 . H O 20 14-03- 0 5 1 2 : 49 : 21.130 2014-03-0S 09 : 5 6 : 58 . 630 20 14-0 3-0 5 0 9 : 17 : 01.800 2011 -03-05 04 : 2 5 : 43 . 0 60 2014-03- 0 S 03 : 13 : 19 . 000 2 0 11•03-05 0 2 : 24:23 . 580
s. 3 lTll
ss
u~
0 . 82
0 . 07166522
2 . 28 0 . 963
1.15
u•
o. oa
u• II&
ltng!h : 108749 li ~ : 726
l " : 1 Col:t S
2( 2( 2(
useooonswc
u.ac000n3vc
2(
n c 72 l796 lf
ua C'OOOn 3a:t 20H-03-0{ l.U u• useooonssy 2 (
u•
..
2 . i22 0 . 96 uaeOOOn.3qp 20H · C 1 56 0 . 3 96 1 .4 U!l U!IC000n3lw 2 0 14·( S7 1 . 212 0 . 9$ ua:bOOOr.lm) s. 2 wl! ~· 2 014 - C 9 8 1. 59 1.04 us U!lbOOOnljp 0 . 47 wl! 6S 2 .22$ u• U!lb000nljm 2 ( ~ 183 2 . 239 o. se us U!lb000!'!.1)2 2 ( 0 . 61 ~ 31 o. ou u• U!lb OOOnh.a 2 ( 1 8 1. 71 1.18 u• U!JbOOOn l h% 2 014 -( 0 . 83 29 1 . 91 ue 1.Uib 000nle.> 6 . 3 (Q(J.l 3 . 07 cl 83 33 0 . 05251 0 . 13 &J. e i154': 0 . 57 wl! 119 4 .694 u• U!lbOOOnlc l 2 ( ml. 0 . 46 alc1117636 9 2 011 - C g,;c; 2S2 1.865 o . 79 u• U.!lb000nlb 3 2 ( . 17
r:~
u
.
"' Normal ted rile
~
2 011 - ( ..J useooon.tkl 2 (
UI
UTF·8 w/o 80M
INS
Figure 91 File Downloaded
Accessing HBase HBase is an open source, nonrelational, distributed database running on Hadoop. Broadly speaking an HBase table has only three fixed points: » Table name » Key (a single field) » Column family (similar to a BW cube dimension; it represents a logical grouping of fields)
90
4
Utilizing Hadoop REST Services w ithin SAP HANA XS
Beyond that anything goes. Columns can be added and populated on the fly within a column family. Columns are unique to a record rather than the entire table. HBase has a REST base service known as Stargate for accessing tables. In order to use Stargate directly from SAP HANA XS, a direct connect between SAP HANA and Hadoop needs to be explicitly defined using an xshttpdest file, in the SAP HANA development repository. With that in place a simple application can be developed. Figure 92 shows a simple example architecture of an application that uses HBase to track changes of field values in SAP HANA over time.
HANA Re.c;ords ~
~
I
Hbase Change log
HANA SAPUI5 HTML:
--I
-
;_J l oo~ j GET xsj s
HANA:
~
lI ~ xsj s li b
Hbase.xsj sl ib Documents
--t I
HADOOP:
----------------
xshttpdest Stargate
J
I
HBASE: HanaTabl el og
Figure 92 SAP HANA Hadoop HBase App licat io n Techn ical Overview
91
I
4
Utilizing Hadoop REST Services w ithin SAP HANA XS
I
4
Calling the HBase REST API (Stargate)
First, a table in HBase needs to be defined. For this example a generic table is created with the properties in Table 9. Table Name
HanaTablelog
Column Family
Table
Versions
100 (sets how many field changes are kept for an ind ivid ual cell; the default is 3)
Table 9 HBase Properties
The unique key of a row mustt be populated by the application, as records are inserted. The key is an alphanumeric field, however the structure and format of the key determines how ranges of data can be selected an d searched, depending on the needs of the application. From the command prompt on the Hadoop NameNode execute the follow statements to access the HBase command line and create the table: sudo -u hdfs hbase she ll crea t e ' HanaTablel og ', \NAME ; )
'table ', VE RSI ONS;) 1001
Unlike SAP HANA we also haven't defined any columns. These can be dynamically added per row as data is inserted and updated. In HUE we can add a row where the HBase key is made up of a SAP HANA table name DOCUMENTS and the SAP HANA row key values Doc_NAME DOC1 and Row 1 (Figure 93).
HBase Browser - Cluster I HanaTablelog Fbf C:>h.nus.rFa
OOCUMENTS:OOC1:1
ItS
~ All
SOftBy ASC
£:I Row
Fi gure 93 HBase Table Row Examp le
92
•
Utilizing Hadoop REST Services within SAP HANA XS
Here are a couple of simple examples using Stargate: Example Usage
GET
http:II<Stargate Node>:205501
PUT
http:II<Stargate Node>:205501 HanaTableLog I DOCUMENTS:DOC1 :11 In the body of the REST statement we also specify the key and the cells to update. In tlhis case let's update a cel l called "Free_Text", which has a new value, "Apple". " Row ":
I " key ": " RE9DVUlFT1RTOkRPOzE6MO==", " Cell ": [ {
" column ": "dGFibGU6RnJ1ZV9UZXh0 ", " timestamp ": 1400393414981 . " $ ":
" OXB1~bGU= "
}
That probably didn't make sense because the Stargate passes information with BASE64 encoding. If you translate (e.g., https:l/www.base64decode.org/) then you'll see: " key ": "OOCUMENTS : DOC1 : 1" " column ": " table : Free_Text " , " $ ": " App l e " Ta b le 10 HBase Stargate Row Examples
See the following for further information: https://wiki.apache.org/hadoop/
Hbase/Stargate.
93
I
4
Utilizing Hadoop REST Services within SAP HANA XS
xshttpdest File
You are unable to call Stargate directly from SAP HANA Javascript codeyou will receive CORS errors. To get around this create an xshttpdest file. The contents would be similar to Listing 21. hos t - "
SAP HANA XS Code Example
The following is a summary of the code required to call the webHDFS from SAP HANA, and to display the output to an HTML/5 SAPUI5 page. The complete code can be found in the supplemental downloads that came with this E-Bite. Create the files listed in Table 11 . Each of these files will be populated with the code examples that are found in the downloadable content. File
Description
Hbase.xsjs!ib
Library of code for connecting to xshttpdest locations, hand ling the URL parameters and decoding/encoding BASE64
Hbase.xsjs
Uses Hbase.xsjslib and creates a simplified access point for listing directories or opening files. This is the cal l by SAPUI5 screen
index.html
SAPUI5 (Table controls) screen, which calls Hbase.xsjs for reading HBase
Table 11 Files to Call webHDFS from SAP HANA and Display to an SAPUI5 Page
94
I
4
Utilizing Hadoop REST Services within SAP HANA XS
File
Description
OOCUMENTS_table_ exits.xsjslib
Contains a Save exit event on a SAP HANA table (called by ODATA save), which updates HBase with the latest version
J
4
Table 11 Files to Call webH D FS from SAP HANA and Display to an SAPUI5 Page (Cont.)
Example Application
The following is an example of what the finished application looks like. Figure 94 shows the DOCUMENTS table in SAP HANA, and HBase Table Log prior to a change.
-
oowmentt In H.an.a
Documents O«_lqme
I
....
OOC1
1
OOC1
2
·..,-
Frtt_TtJI
........
.......
, .1
Cflaf1Qt4_o,
Ohatlllta_•
SY$TEU
$un JI.In01201
S'VSTEU
SunM01201<~08
-
Ctlange Log O.Uillln HWse
Chango Log Ctlartot4at ~1A.0$.01 T08 1 83 1
t97Z
20tA-o6.01T081831 te7Z 2014>05·0'1f0818 3 1 HTZ
20U.OS.011'0818 319972
f lt iC:
Qmtd'hlut
Doc_H.amt
DOC1
....
"""'
frH_TtJII
... 1
Value
Figure 94 Docum ents in SAP HANA, Log Cont ents in HBase
Now make a change; for exa mple, change the free text from APPLE to "APPLE CIDER" (Figure 95). Document~
11'1
o.u-
l ooc• OOCI
-
H.an.a
Documents
.... ' 2
,,tt_Tt:Jt
-·
>~alut
fi'P\CQOERj
rt.e me &t )4.83..19.2"28 s.ays:
'"'
X
CrlanQt4_0y
Otl&nllta_.at
svmu
SUn.AII\01 201.&08 1
svsn:u
Sun.IIJI\0120UOI
Vplt•tc ;"''~
. . . . ~.J
-
Ctt.ange Log OeUIJI in H~u
Figure 95 Free Text Change Successful
95
Future Outlook
J
5
Update successful! As you can see in Figure 96, the changes are written to SAP HANA and HBase. Docu-ments In Kina
•..
Documents
fttt_Tt:4
Cl\anotcS_at
"'"'
S...M ()1201• 09 ~JUI'I 01 20U 08
"' Change log Deta il in Hbase
Change
~09 fltl
curr~._..,.
t:O.lk06·0110i 2.1 •2
~
f~t t_Tt.t
~OOER
~ '4-0t-Onoe
"n
0c(.t4.-nt
ooc•
tl 31
~;o$·0lTot 11t1fmzl ~1<~<06·01108
t8 31 "7Z
...
fiH _ If
.:.PP\.£
201'.o6.0U 08 t8 31 997Z
Figure 96 Change Log Shows Changes
5
Future Outlook
SAP HANA SPS1 0 promises a number of enhancements to Hadoop integration. Here we will briefly discuss why these changes were made, and their features. Hadoop started its life as an open source storage (HDFS) and batch pro-
cessing engine (MapReduce) for big data. With the increasing demand for reporting and analytics functionalities, Hadoop's response times needed to improve from minutes to seconds. In recent years Hadoop has tackled this issue by introducing ad d-ons such as Cloudera's Impala and improvements to open source HIVE. At the same time, Hadoop's MapReduce framework has been massively overhauled. YARN has now replaced MapReduce and offers significant enhancements, such as being a data operating system and resource manager. YARN has provide the basis for a new breed of applications to be built on top of Hadoop, making use of the massive parallel compute power a Hadoop cluster can offer.
Future Outlook
J
5
Apache Spark, running on YARN, provides in-memory data processing for batch, real-time, and advanced analytics for the Hadoop ecosystem. Spark is slowly emerging as the de-facto standard general data processing framework for Hadoop, making it easy to develop fast, end-to-end Big Data applications by combining batch, streaming, and interactive analytics on all your data. In response to these changes by Hadoop, SAP HANA SPS1 0 introduced a new HANA Spark Controller. This is a YARN application, developed by SAP, which, when installed on your Hadoop cluster, enables SAP HANA to communicate directly witih Spark SQL, rather than using the ODBC drivers you saw in Section 2. Beyond these developments, SAP also recently announced SAP HANA Vora (Figure 97), an in-memory query engine that runs on the Apache Spark framework. This query engine incorporates significant enhancements to the HANA Spark Controller released with SPS10. It provides the foundation for a true federation layer of Hadoop Data, enabling the int egration of SAP data with Hadoop data through a single access point. It is designed to simplify data access and consumption across the organization, reducing the need to persist multiple copies of information. It supports interactive in-memory SQL on Hadoop.
SPS 10+
II Spark Data-sourc~~ Application Services Processing Services Database Services Integration Services SAP HANA Platform
API enhancement
~
I
Spark
I
I I SPS 9
:~
~
I
Spark
I
~
I
Spark
I YARN
..._
~
~
HDFS
I I
HANA Smart Data Acess, UCFs, Others Hadoop Cluster
I Fi gure 97 HANA Integration with Vora
97
As you can see in Figure 97, SAP HANA Vora is an add-on application to a Hadoop Cluster. The main features of SAP HANA Vora include: » Accelerated in-memory processing » Compiled queries » Support for Scala, Python and Java » SAP HANA and Hadoop mash-ups » Hierarchies » Support for HDFS, Parquet and ORC file formats » NUMA awareness Support for the following features is planned in the near future: » C, C++ and R » Currency conversion » Dynamic data tiering
6
What's Next?
Now that you've successfully integrated SAP HANA and Hadoop, and have become familiar with three different integration scenarios, why not expand your knowledge further? Pick up Enterprise Information Management with SAP by Brague, Dichmann, Keller, Kuppe, On, et al. Learn how to effectively manage your data, and find out more about products like SAP PowerDesigner, SAP HANA Cloud Integration, and Hadoop.
What's Next?
Recommendation from Our Editors Want to learn more about SAP HANA and Hadoop? Visit www.sap-press.com/3666 and pick up Enterprise Information ~w'i!Mn.£~ Management with SAP! Learn to effectively manage you r data with the tools SAP ElM offers, and more.
In addition to this book, our editors picked a few other SAP PRESS publications that you might also be interested in. Check out the next page to learn more!
99
I
6
More from SAP PRESS Implementing SAP HANA: Ready to get familiar with SAP HANA? From initial setup to connecting to a business intelligence platform, follow stepby-step instructions and detailed examples for a complete SAP HANA implementation. Visit www.sap-press.com/3703 for more information. 860 pages, 2nd edit ion, pub. 12/2014 E-book: $69.99 I Print: $79.95 I Bundle: $89.99 www.sap-press.com/3703
Implementing SAP BW on SAP HANA: Learn your options for implementing SAP BW on SAP HANA. Find out how SAP HANA changes data modeling, reporting, and administration on SAP HANA. Visit www.sappress.com/3609 for more information. 467 pages, pub. 05/2015 E-book: $69.99 1 Print: $79.95 www.sap-press.com/3609
I
Bundle: $89.99
Integrating Success factors with SAP: Making the move to the cloud? Let this book help you. Learn to apply prepackaged or planned integration scenarios and walk through case studies that model the use of templates and APis. Visit www.sap-press.com/3723 for more information. 515 pages, pub. 04/2015 E-book: $69.99 1 Print: $79.95 www.sap-press.com/3723
1
Bundle: $89.99
SAP PRESS E-Bites SAP PRESS E-Bites provide you w ith a high-quality response to your specific project need. If you're looking for detailed instructions on a specific task; or if you need to become familiar with a small, but crucial sub-component of an SAP product; or if you want to understand all the hype around product xyz: SAP PRESS E-Bites have you covered. Authored by the top pro fessionals in the SAP universe, E-Bites provide the excellence you know from SAP PRESS, in a digest ible electron ic format, delivered (and consumed) in a fraction of the time !
Eric Du SAP HA NA Smart Dat a St reaming and t he Intern et of Things ISBN 978-1-4932-1303-0
I $9.99 I 86 pages
Pierpaolo Vezzosi, Gaetan Saulnier Predictive Modeling with Automated Analytics/SAP Predictive Analytics 2.0 ISBN 9 78-1-4932 -1326-9
I $14.99 I approx. 91
pp.
Peter Spielvogel et al. Using SAP Screen Personas ISBN 978-1 - 4932-1308-5 I $14.99
I approx. 94 pp.
The Author of this E-Bite Aron MacDonald is an independent SAP HANA consu ltant, currently working for Shell Oil Company. His area of focus is on the integration between SAP HANA and Hadoop. He is an SAP HANA Distinguished Engineer (HDE), which is an SAP program devoted to recognizing and promoting SAP HANA technical skills.
Imprint This e-bite is a publication many contributed to, specifically: Editor Hareem Shafi Acquisitions Editor Kelly Grace Weaver Copyeditor Adrienne Rebello Cover Design Graham Geary Layout Design Graham Geary Production Graham Geary Typesetting SatzPro, Krefeld (Germany) ISBN ~78 - 1 -4~3 2- 1 2~3-4 © 2016 by Rheinwerk Publishing, Inc .. Boston (MA) 1st edition 2016
All rights reserved. Neither this publication nor any part of it may be copied or reproduced in any form or by any means or translated into another language, without the prior consent of Rheinwerk Publishing,
2 Heritage Drive, Suite 305, Quincy, MA 02171. Rheinwerk Publishing makes no warranties or representations with respect to the content hereof and specifically disclaims any implied warranti es of merchantability or fitness for any particular purpose. Rheinwerk Publish ing assumes no responsibility for any errors that may appear in this publication. " Rheinwerk Publishing" and the Rheinwerk Publishing logo are registered t rademarks of Rhei nwerk Verlag GmbH, Bonn, Germany. SAP PRESS is an imprint of Rheinwerk Verlag GmbH and Rheinwerk Publish ing, Inc. Ail of the screenshots and graph ics reproduced in thi s book are subject to copyright Cl SAP SE. DietmarHopp-AIIee 16, 69190 Walldorf, Germany.
SAP, the SAP logo, ABAP, BAPI, Duet, mySAP.com, mySAP, SAP Archivelink, SAP EarlyWatch, SAP NetWeaver, SAP Business ByDesign. SAP BusinessObjects, SAP BusinessObjects Rapid Mart, SAP BusinessObjects Desktop Intelligence, SAP BusinessObjects Explorer, SAP Rapid Marts, SAP BusinessObjects Watch list Security, SAP BusinessObjects W eb Intelligence, SAP Crystal Reports, SAP GoingLive, SAP HANA, SAP MaxAttention, SAP Max DB, SAP PartnerEdge, SAP R/2 , SAP R/3, SAP R/3 Enterprise, SAP Strategic Enterprise Management (SAP SEM), SAP StreamWork, SAP Sybase Adapt ive Server Enterprise (SAP Sybase AS E), SAP Sybase IQ, SAP xApps, SAPPH IRE NOW, and Xcelslus are registered or unregistered trademarks of SAP SE, Walldorf, Germany. All other products mentioned in this book are registered or un registered trademarks of their respective compan ies.