TEMP_CTAS= LIBNAME Statement Option

Specifies whether to create an intermediate (temporary) table in Hive.

Valid in: SAS/ACCESS LIBNAME statement
Category: Data Set Control
Default: YES [when the Hive property hive.server2.enable.doAs is set to TRUE. See “Details.”]
NO
Interaction: works with the READ_METHOD= LIBNAME option
Data source: Hadoop
Note: The default value changed to NO in SAS 9.4M9.
See: READ_METHOD= LIBNAME option

Table of Contents

Syntax

TEMP_CTAS=YES | NO

Syntax Description

YES

creates an intermediate (temporary) table in Hive.

NO

does not create an intermediate (temporary) table in Hive.

Details

When READ_METHOD=HDFS, SAS/ACCESS Interface to Hadoop creates an intermediate result set to HDFS. This set can be created as a TEMPORARY table in Hive or as an EXTERNAL table in HDFS. In each case, the intermediate result set is deleted when the query operation completes. Creating the result set as a TEMPORARY table offers the advantage of Hive managing the life cycle of the table.

To enable this option, the SAS Viya platform administrator must also set the Hive property hive.server2.enable.doAs to TRUE. In this case, the Hive process impersonates the current user to create the intermediate result set with the current user’s permissions. This works even if the intermediate result set is created as a Hive TEMORARY table.

The default for TEMP_CTAS is YES when the Hive property hive.server2.enable.doAs is set to TRUE. In this case, the Hive process impersonates the current user to create the intermediate result set with the current user’s permissions. This works even if the intermediate result set is created as a Hive TEMORARY table.

When hive.server2.enable.doAs is set to FALSE, the Hive process runs under the “hive” user ID. In this case, the intermediate result set must be created as an external table so that SAS/ACCESS to Hadoop can read the table. The reason for that is that the running user will not have permission to read a temporary table that the “hive” user owns.

The user typically does not have to set this option. It is provided for cases when the intermediate result set is created as a TEMPORARY table and cannot be read.

You can override the value of TEMP_CTAS= by setting the environment variable SAS_HADOOP_TEMP_CTAS=YES/NO.

Last updated: February 3, 2026