使用Apache Drill查询嵌套的异构JSON

问题描述

我有多个具有相同结构的json文件,我尝试使用apache演练在该文件上进行查询。 json就是这样的:

    {
  "job":{
    "executionMode":{
      "type":"historical","startTime":"2020-09-10 03:00:00","endTime":"2020-09-10 05:00:00"
    },"outputFolder":"./data/C106/1515/20200910044022","fileNamePrefix":"dataframes","outputMultipleFiles":false,"logfileNamePrefix":"lclog","fillNull":true,"compressDataframe":false,"lcLogs":"ON","UUID":"8cc2e3fe","dataframeExecutionStartTime":"2020-09-10T09:40:37.681Z","dataframeFileHeaders":"timestamp,PowerMetrics TotalcpuPower,Fan 1 RPMReading,Fan 3 RPMReading","dataframeExecutionEndTime":"2020-09-10T09:40:39.555Z","lclogExecutionStartTime":"2020-09-10T09:40:39.556Z","lclogFileHeaders":"time|context|created|description|entrytype|id|message|messageargs|messageargscount|messageid|name|oemrecordformat|severity|sourceId","lclogExecutionEndTime":"2020-09-10T09:40:39.785Z"
  },"database":{
    "connection":{
      "name":"influxdb","protocol":"http","host":"","port":"","database":"","username":"","password":""
    },"query":{
      "sampleInterval":null,"aggregationFunction":null,"fillType":null,"deleteAfter":false
    },"servers":[
      
    ]
  },"redfish":[
    {
      "metricReport":"FanSensor","metrics":[
        "RPMReading"
      ]
    },{
      "metricReport":"PowerMetrics","metrics":[
        "SystemPowerConsumption","TotalcpuPower","TotalFanPowerTotalStoragePower"
      ]
    },{
      "metricReport":"cpuSensor","metrics":[
        "TemperatureReading"
      ]
    }
  ],"lcLogMeasurements":[
    "LClogdata"
  ]
}

我想编写一个查询,该查询可以将数据转换为以下格式:

Format Image

Apache演练有可能吗? 如果是,那么查询将是什么。 非常感谢帮助。谢谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)