执行APIM_USER_AGENT_STATS脚本中的异常

时间:2018-08-20 12:07:51

标签: wso2 analytics

我正在使用WSO2 API Analytic 3.1.0。我总是在日志文件中看到以下异常:

TID: [-1234] [] [2018-08-20 15:20:45,020] ERROR {org.wso2.carbon.analytics.spark.core.AnalyticsTask} -  Error while executing the scheduled task for the script: APIM_USER_AGENT_STATS {org.wso2.carbon.analytics.spark.core.AnalyticsTask}org.wso2.carbon.analytics.spark.core.exception.AnalyticsExecutionException: Exception in executing query INSERT INTO TABLE APIUserBrowserData SELECT api,version,apiPublisher,tenantDomain,total_request_count,year,month,day,requestTime,os,browser FROM API_REQUEST_USER_BROWSER_SUMMARY_FINAL
at org.wso2.carbon.analytics.spark.core.internal.SparkAnalyticsExecutor.executeQueryLocal(SparkAnalyticsExecutor.java:764)
at org.wso2.carbon.analytics.spark.core.internal.SparkAnalyticsExecutor.executeQuery(SparkAnalyticsExecutor.java:721)
at org.wso2.carbon.analytics.spark.core.CarbonAnalyticsProcessorService.executeQuery(CarbonAnalyticsProcessorService.java:201)
at org.wso2.carbon.analytics.spark.core.CarbonAnalyticsProcessorService.executeScript(CarbonAnalyticsProcessorService.java:151)
at org.wso2.carbon.analytics.spark.core.AnalyticsTask.execute(AnalyticsTask.java:60)
at org.wso2.carbon.ntask.core.impl.TaskQuartzJobAdapter.execute(TaskQuartzJobAdapter.java:67)
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: Error while saving data to the table API_REQ_USER_BROW_SUMMARY : Job aborted due to stage failure: Task 0 in stage 676500.0 failed 1 times, most recent failure: Lost task 0.0 in stage 676500.0 (TID 572610, localhost): java.sql.BatchUpdateException: ORA-00932: inconsistent datatypes: expected - got CLOB

哪个列是clob?我不了解什么是column key_os_browser_facet,以及查询中如何填充它。

INSERT INTO TABLE APIUserBrowserData SELECT api,version,apiPublisher,tenantDomain,total_request_count,year,month,day,requestTime,os,browser FROM API_REQUEST_USER_BROWSER_SUMMARY_FINAL;

问题与本专栏有关吗? 如何在WSO2分析中调试脚本?

编辑: 我发现问题与os和浏览器参数的空值有关。我在选择查询中使用了if(os为null,“ UNKNOWN”,os),if(browser为null,“ UNKNOWN”,浏览器),并且在选择查询中也没有抛出异常。我的问题是,当我重新启动Analytic Server时,脚本已被重写,并且原始脚本,浏览器和os都没有if-null条件,而是替换为我的脚本。如何在启动分析时避免此问题?

0 个答案:

没有答案