spark重命名具有特殊字符“?”的列:

时间:2018-07-13 07:25:50

标签: scala apache-spark

我有一列如下

 root
 |-- metadata: struct (nullable = true)
 |    |-- "drop":{"dropPath":"https://dstpath.media27.ec2.st-av.net/drop?source_id: string (nullable = true)
 |    |-- "selection":{"AlllURL":"https://dstpath.media27.ec2.st-av.net/image?source_id: string (nullable = true)
 |    |-- "dstpath":"https://dstpath.media28.ec2.st-av.net/image?source_id: string (nullable = true)

现在选择任何列都存在问题,因为所有列都有特殊字符

"drop":{"dropPath":"https://dstpath.media27.ec2.st-av.net/drop?source_id: string (nullable = true)

此列具有特殊字符“:{和。

如何选择此列或在spark中重命名?

df.select('`"drop":{"dropPath":"https://dstpath.media27.ec2.st-av.net/drop?source_id`'

将错误视为错误:未封闭字符litera

0 个答案:

没有答案
相关问题