The data source is the `sashelp.cars` table, which is an internal SAS example table. The destination is an external Hadoop database, connected via a `libname`. The script does not read external data; it writes to it.
1 Code Block
LIBNAME
Explanation : Defines a connection to a Hadoop server via the SAS/ACCESS to Hadoop interface. It also enables tracing options (`sastrace`) to record detailed information about the interaction with the database in the SAS log.
Explanation : This block loads data from the `sashelp.cars` table into a new `cars` table on the Hadoop server. The `bulkload=yes` option activates bulk loading mode, optimized for large volume data transfers. The table is then dropped with `PROC SQL` to clean up the environment.
Explanation : This block performs the same load as the previous one but without the `bulkload=yes` option. This allows comparison of the performance difference between a standard load (potentially row-by-row) and a bulk load. The table is then dropped.
Explanation : This block loads the data again, but uses the `dbcreate_table_opts` option to pass a specific instruction to Hadoop when creating the table. Here, it requests that the table be stored in 'Parquet' file format, a highly performant columnar storage format. The table is finally dropped.
Copied!
proc append base=mycdh.cars (dbcreate_table_opts='stored as parquetfile')
data=sashelp.cars;
run;
proc sql;
drop table mycdh.cars;
quit;
1
PROC APPEND base=mycdh.cars (dbcreate_table_opts='stored as parquetfile')
2
DATA=sashelp.cars;
3
RUN;
4
5
PROC SQL;
6
drop TABLE mycdh.cars;
7
QUIT;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.