Specifies the type of table to create and how associated data files are handled.
| Valid in: | DATA and PROC steps (when accessing DBMS data using SAS/ACCESS software) |
|---|---|
| Category: | Data Set Control |
| Aliases: | DBCREATE_EXTERNAL= |
| DBCREATE_EXT= | |
| Default: | NO |
| Interaction: | You can specify this option, the DBCREATE_TABLE_LOCATION= option, or both. |
| Data source: | Hadoop |
| Tip: | This option determines only the disposition of a file upon delete. |
| See: | DBCREATE_TABLE_EXTERNAL= LIBNAME option, DBCREATE_TABLE_LOCATION= data set option, DBCREATE_TABLE_OPTS= LIBNAME option, DBCREATE_TABLE_OPTS= data set option |
Table of Contents
creates an external table—one that is stored outside of the Hive warehouse.
creates a managed table—one that is managed within the Hive warehouse.
When a managed table is dropped, its data is also deleted. When an external table is dropped, its data is preserved. Create an EXTERNAL table if you want to preserve table data if the table is dropped. SAS issues a DROP TABLE statement when PROC DELETE references a Hive table and also with the DROP TABLE statement in PROC SQL.
In this example, DBCREATE_TABLE_LOCATION= stores the table data outside of the Hive warehouse. DBCREATE_TABLE_EXTERNAL=YES protects the data from being deleted if the table is dropped.
LIBNAME db HADOOP SERVER=mysrv1 USER=myusr1 DB=myschema1;
DATA db.mytab (
DBCREATE_TABLE_EXTERNAL=YES
DBCREATE_TABLE_LOCATION="/mydir/mytab");
SET mydata;
RUN;