我下面使用谷歌的BigQuery,Hadoop的連接器這個字計數例如:陣列輸出模式引起異常
https://developers.google.com/hadoop/writing-with-bigquery-connector#completecode
的例子能正常工作,因爲它是。
要在輸出模式測試陣列,我已經通過添加陣列對象定義到輸出模式改變中的代碼只是一個行:
String outputTableSchema = "[{'name': 'Word','type': 'STRING'},{'name': 'Number','type': 'INTEGER'},{'name':'Persons','mode':'REPEATED','type':'RECORD','fields':[{'name': 'name','type': 'STRING'},{'name': 'age','type': 'INTEGER'}]}]";
現在,當我運行字計數例子,它給出了該例外:
java.lang.IllegalStateException 在com.google.gson.JsonArray.getAsString(JsonArray.java:133) 在com.google.cloud.hadoop.io.bigquery.BigQueryUtils.getSchemaFromString(BigQueryUtils .java:97) at com.google.cloud.hadoop.io.bigquery.BigQueryOutputFormat.getRecordWriter(BigQueryOutputFormat.java:121) at org.apache.hadoop.mapred.ReduceTask $ NewTrackingRecordWriter。(ReduceTask.java:568) at org.apache .hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:637) at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:418) at org.apache.hadoop.mapred.Child $ 4.run( Child.java:255) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hadoop.security.UserGroupInformation.doAs (UserGroupInformation.java:1190) at org.apache.hadoop.mapred.Child.main(Child.java:249)
有誰知道這個問題是什麼?
謝謝