、、、 我试图迭代一个文件夹,并使用Pyspark在DataBricks中获取文件名和这些文件的路径。突然产生了一个想法,如果我们可以将文件的名称设置为变量,并将路径分配给名为variable的相应文件。我们可以使用dbutils来创建小部件,并将文件名指定为参数,以使事情变得更简单。因此,在这个过程中,我直到获得了文件和文件名的路径...
1. Save PySpark printSchema() result to String Now let’s save this printSchema() result to a string variable. If you look at the source code of this statement, it internally does the following. # printSchema() internally uses below line print(self._jdf.schema().treeString()) So, you...