2

When creating an external table, I get the below error:

Msg 105005, Level 16, State 1, Line 1 CREATE EXTERNAL TABLE AS SELECT statement failed as the path name 'wasbs://.blob.core.windows.net/folder/Reject_Directory/_rejectedrows/' could not be used for export. Please ensure that the specified path is a directory which exists or can be created, and that files can be created in that directory.

I'm trying to create an external table using polybase, removing the REJECTED_ROW_LOCATION option works fine, but including it causes this error. How do I fix this?

Neil P
  • 2,920
  • 5
  • 33
  • 64

2 Answers2

1

Something else had already created the Reject_Directory/_rejectedrows folder, for some reason this caused a permissions error.

Delete the Reject_Directory/_rejectedrows folder from the blob store, so that Polybase can create it itself and the table can now be created.

Neil P
  • 2,920
  • 5
  • 33
  • 64
0

Please check on below two things. I was able to resolve this error by checking/adding the following things.

  1. Make sure when you create credentials -> you add enough permissions while generating the tokens. This will help to create/loan the error records file in the ADLS container.

  2. Make sure you use this with TYPE=HADOOP. For that -> CREATE EXTERNAL DATA SOURCE name WITH ( LOCATION='location', CREDENTIAL = credential name, TYPE=HADOOP). and then try adding REJECT_ROW_LOCATION while creating EXTERNAL TABLE.

AniG
  • 1
  • 1