将MapType col转换为Json:DataFrame

时间:2019-02-14 13:26:31

标签: json scala apache-spark dataframe

我有一个数据框,内容如下:

if (value.length >= 3)

我想在Json中将其转换,例如

plugins: [
  new HtmlWebpackPlugin({
    title: 'Custom template',
    // Load a custom template (lodash by default)
    template: 'index.html'
  })
]

我尝试了<table [dataSource]="(searchResults$ | async)?.accounts" mat-table matSort multiTemplateDataRows> <ng-container matColumnDef="Code"> <th *matHeaderCellDef mat-header-cell mat-sort-header> Account Code</th> <td *matCellDef="let account" mat-cell> {{account.code}} </td> </ng-container> </table> ,但是在运行AnalysisException时却得到了AnalysisException。

+---+-----------------------------------------------------------------------------------------------------------------------------------+
|id |mapData                                                                                                                            |
+---+-----------------------------------------------------------------------------------------------------------------------------------+
|1  |Map(e1 -> WrappedArray({"number":"n1","strData":"d1","intData":2}), e2 -> WrappedArray({"number":"n1","strData":"d1","intData":2}))|
+---+-----------------------------------------------------------------------------------------------------------------------------------+

版本:

+---+-----------------------------------------------------------------------------------------------------------------------------------+
|1  |{"e1": [{"number": "n1","strData": "d1","intData": 2}],"e2": [{"number": "n1","strData": "d1","intData": 2}]}                      |
+---+-----------------------------------------------------------------------------------------------------------------------------------+

0 个答案:

没有答案