Tuesday, July 5, 2016

Have PolyBase INSERT create a new Directory for you

You can use PolyBase to create a new directory for you when you plan on inserting records from SQL Server.

In our earlier example ( see PolyBase - Insert data into new Hadoop Directory) we first created a new Directory in Hue. To skip that step, all you need to do is to append the new directory name on the the location path when you create your new external table in PolyBase.

Location path to existing directory:

       WITH (LOCATION='/user/hue/AWDW2012_SalesData',

Location path to new directory to be created:

      WITH (LOCATION='/user/hue/AWDW2012_SalesData/AWDW_FileNameTest',

When you run the INSERT, PolyBase instructs Hue to create the new folder.

No comments: