简体   繁体   English

WSO2DAS中的分析

[英]Analytics in WSO2DAS

I'm getting a Table Not Found error while running a select query on spark console of wso2das. 在wso2das的Spark控制台上运行选择查询时,出现“未找到表”错误。 I've kept all the default configurations intact after the installation. 安装后,我保留了所有默认配置。 I'm unable to fetch the data from the event stream even when it's been shown under table dropdown of data explorer. 我无法从事件流中获取数据,即使它已显示在数据浏览器的表下拉菜单中也是如此。

Initially when the data is moved into the wso2das, it would be persisted in the data store you mention. 最初,当数据移入wso2das时,它将保留在您提到的数据存储中。

But, these are not the tables that are created in spark. 但是,这些不是在spark中创建的表。 You need to write a spark query to create a temporary table in spark which would reference the table you have persisted. 您需要编写一个spark查询以在spark中创建一个临时表,该临时表将引用您已保留的表。

For example, 例如,

If your stream is, 如果您的流是

{
  "name": "sample",
  "version": "1.0.0",
  "nickName": "",
  "description": "",
  "payloadData": [
    {
      "name": "ID",
      "type": "INT"
    },
    {
      "name": "NAME",
      "type": "STRING"
    }
  ]
}

you need to write the following spark query in the spark console, 您需要在Spark控制台中编写以下Spark查询,

CREATE TEMPORARY TABLE sample_temp USING CarbonAnalytics OPTIONS (tableName "sample", schema "ID INT, NAME STRING");

after executing the above script,try the following, 执行上述脚本后,请尝试以下操作,

select * from sample_temp;

This should fetch the data you have pushed into WSO2DAS. 这应该获取您推送到WSO2DAS中的数据。

Happy learning!! 学习愉快! :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM