SAP HANA Predictive Analysis Library (PAL)
As of 2026-09-25
What is SAP HANA Predictive Analysis Library (PAL)?
PAL is SAP's library of SQL-callable, in-database machine-learning and statistics procedures for SAP HANA, delivered as part of the AFL component. SAP's own sample repository shows real coverage across classification, regression, clustering, time series, association rules, anomaly detection, recommenders and more, called via SQL, via hana-ml in Python, or embedded in ABAP through AMDP — unlike APL, PAL leaves algorithm choice and tuning to the caller.
What PAL is, mechanically
The Predictive Analysis Library (PAL) is SAP's library of SQL-callable procedures for in-database machine learning and statistics inside SAP HANA. It ships as part of the AFL — Application Function Library — component: SAP's own sample-code repository states the requirement plainly, that running PAL examples needs "a SAP HANA database environment... with the AFL-component installed, which includes the Predictive Analysis Library (PAL)." That single sentence explains PAL's whole value proposition to a consultant: the algorithms run as C++ procedures inside the database engine itself, against tables that never leave HANA, rather than as a client-side library that pulls rows out first.
Two consumption paths exist for the same underlying procedures. You can call PAL directly in SQLScript — CREATE PROCEDURE, CALL, temporary parameter tables — or you can drive it from Python through hana-ml (C345), whose hana_ml.algorithms.pal module wraps the same procedures behind classes like UnifiedClassification and UnifiedRegression. Either way, the computation happens in the same place: inside HANA.
Why it matters
- PAL runs inside HANA's engine as C++ procedures — the pitch to a client is data never leaves the database, which is a different (and often stronger) governance story than most external ML platforms can tell.
- PAL and APL are frequently confused; getting the distinction right (manual algorithm choice vs. automated) is the difference between scoping a data-science-led engagement and an automation-led one.
- The same PAL model can be called from SQL, from Python via hana-ml, or embedded in ABAP via AMDP — a consultant who only knows one path will misjudge what a client's existing HANA investment already supports.
Key points
- PAL is SQL-callable, in-database ML/statistics for SAP HANA, delivered as part of the AFL (Application Function Library) component.
- Real coverage confirmed via SAP's own sample repository: classification, regression, clustering, time series (incl. massive/parallel), association rules, anomaly detection, recommenders, link prediction, statistics, data preparation, dimensionality reduction, plus model evaluation/parameter selection/model comparison utilities.
- PAL vs. APL: PAL leaves algorithm choice and parameter tuning to the caller (explicit parameter tables); APL (C344) automates that choice behind a smaller set of higher-level functions.
- SQL call pattern: create the input table, load a temporary parameter table (PARAM_NAME/INT_VALUE/DOUBLE_VALUE/STRING_VALUE), call the procedure directly or via a generated AFL wrapper.
- hana-ml (C345) wraps the same procedures in an estimator-style Python API — UnifiedClassification, UnifiedRegression, UnifiedClustering — with GridSearchCV/RandomSearchCV and ModelStorage for saving and scheduling retraining.
- PAL models can be embedded in ABAP via AMDP (ABAP Managed Database Procedures), which is the mechanism ISLM (C346) uses to run a PAL model inside a productive S/4HANA scenario.
- UnifiedClassification alone spans multiple algorithms via its func parameter (Hybrid Gradient Boosting Tree, Random Decision Trees, Random Forest).
Terms used on this page
- AFL
- Application Function Library — the SAP HANA component that ships PAL (and APL) as installable C++ procedures.
- SQLScript
- SAP HANA's procedural SQL extension used to write and call PAL procedures directly.
- UnifiedClassification / UnifiedRegression
- hana-ml Python classes that wrap multiple PAL algorithms behind one estimator-style API, selected via a func parameter.
- AMDP
- ABAP Managed Database Procedure — the mechanism that embeds a PAL (or hana-ml-generated) model call inside ABAP, used by ISLM (C346).
- ModelStorage
- hana-ml class that saves, lists, versions and can schedule retraining of a PAL/APL model stored in HANA tables.
Sources
- SAP HANA Cloud Help — SAP HANA Cloud, SAP HANA Database Predictive Analysis Library (PAL) (accessed 2026-09-25)
- SAP-samples/hana-ml-samples — README (AFL/PAL prerequisite) — GitHub (SAP), fetched 2026-09-25
- SAP-samples/hana-ml-samples — PAL-SQL sample directory (algorithm coverage by file name) — GitHub (SAP), fetched 2026-09-25
- SAP-samples/hana-ml-samples — Python-API/pal notebooks (UnifiedClassification, ModelStorage, GridSearchCV examples) — GitHub (SAP), fetched 2026-09-25
- SAP-samples/hana-ml-samples — PAL-AMDP/ISLM-UnifiedClassification-example (PAL embedded via AMDP) — GitHub (SAP), fetched 2026-09-25
Full card available to members. What the full card adds: the full decision framework · the common pitfalls and their fix · the cheat sheet · the code blocks · the facts worth quoting.