Partition keys in SASHDAT
files and in-memory tables are constructed based on the formatted
values of the partition variables. The formatted values are derived
using internationalization and localization rules. (All formatted
values in the server follow the internationalization and localization
rules.)
All observations that
compare equal in the (concatenated) formatted key belong to the same
partition. This enables you to partition based on numeric variables.
For example, you can partition based on binning formats or date and
time variables use date and time formats.
A multi-variable partition
still has a single value for the key. If you partition according to
three variables, the server constructs a single character key based
on the three variables. The formatted values of the three variables
appear in the order in which the variables were specified in the PARTITION=
data set option. For example, partitioning a table by the character
variable REGION and the numeric variable DATE, where DATE is formatted
with a MONNAME3. format:
data hdfslib.sales(partition=(region date) replace=yes);
format date monname3.;
set work.sales;
run;
The partition keys might
resemble EastJan, NorthJan, NorthFeb, WestMar, and so on. It is important
to remember that partition keys are created only for the variable
combinations that occur in the data. It is also important to understand
that the partition key is not a sorting of Date (formatted as MONNAME3.)
within Region.
For
information about ordering, see
Ordering within Partitions.
If the formats for the partition keys are user-defined, they are transferred to the
LASR Analytic Server when the table is loaded to memory. Be aware that if you use
user-defined formats to partition a
SASHDAT file, the definition of the user-defined format is not stored in the SASHDAT file. Only
the name of the user-defined format is stored in the SASHDAT file. When you load the
SASHDAT file to a server, you need to provide the XML definition of the user-defined
format to the server. You can do this with the FMTLIBXML= option to the LASR procedure
at server start-up or with the PROC LASR ADD request.