How to Move Data from Hive to Workbench
Workbench in Viya represents remote AWS S3 locations that are mounted locally to provide a file system for SAS Viya users. Submit a ServiceNow ticket to request a workbench for an organization.
Step-by-step guide
There are two ways to move a Hive table to your organization Workbench:
#1 Explicit Conversion through PROC SQL
Step 1: Create a Libref for the workbench location.
LIBNAME mywork "/workspace/workbench/xxxxxxxxx/data/xxxxxxxxx"
Step 2: Move data from Hive to a workbench location.
%LET sql = %str(SELECT * FROM &myschema..TABLE1); %select_to_dataset(&sql, MYWORK.TABLE1);
Note
%select_to_dataset macro runs PROC SQL; CONNECT TO HADOOP; CREATE TABLE ... AS SELECT * FROM CONNECTION TO HADOOP;
#2 Implicit Conversion through PROC SQL
Step 1: Create a Libref for the Hive location.
%LET myschema = xxxxxxx; Libname mydb HADOOP &hive_libname schema = &myschema;
Step 2: Move table (i.e. Table 1) from Hive to a workbench location.
LIBNAME mywork "/workspace/workbench/xxxxxxxxx/data/xxxxxxxxx"; DATA MYWORK.TABLE1; SET MYDB.TABLE1; RUN;
Related articles