โ06-14-2022 07:28 AM
Hello everyone,
I've created by error a DBFS folder named : ${env]
But when I run this command :
dbutils.fs.rm("/mnt/${env]")
It returns me this error :
java.net.URISyntaxException: Illegal character in path at index 12: /mnt/$%7Benv]
How can I do please ?
Thanks.
โ06-16-2022 03:31 AM
โ06-15-2022 11:13 PM
hi @Salah K.โ what command you used to create the folder name $[env] ?
If you have used dbutils, it would have failed to create a folder with this name. You would have got the error "Illegal character in path".
Please do `%fs ls /mnt` and check if the created folder exists.
โ06-16-2022 01:26 AM
Hi,
Here is the result of of the "ls" command :
path name size modificationTime
dbfs:/mnt/${env]/ ${env]/ 0 1654780637000
dbfs:/mnt/Temp/ Temp/ 0 1643299456000
dbfs:/mnt/bronze/ bronze/ 0 1655217261000
dbfs:/mnt/dev/ dev/ 0 1642150158000
dbfs:/mnt/extprd/ extprd/ 0 0
dbfs:/mnt/gold/ gold/ 0 1655197511000
dbfs:/mnt/prod/ prod/ 0 1649774080000
dbfs:/mnt/qa/ qa/ 0 1643122331000
dbfs:/mnt/silver/ silver/ 0 1654676963000
dbfs:/mnt/uat/ uat/ 0 1642150009000
I've used this command to create the folder :
CREATE OR REPLACE TABLE ${env}XXXXX.ZZZZ (
.....
)
USING DELTA
OPTIONS (PATH '/mnt/${env]/gold/XXXXX/ZZZZ/')
As you can see, I've written "${env]" instead of "${env}'.
โ06-16-2022 03:31 AM
Hello @Salah K.โ
Can you try below?
%sh rm -r /dbfs/mnt/$\{env\]
โ06-16-2022 04:34 AM
Thank you it works !!
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโt want to miss the chance to attend and share knowledge.
If there isnโt a group near you, start one and help create a community that brings people together.
Request a New Group