列存在时列名无效 [英] Invalid column name when column is present

查看:92
本文介绍了列存在时列名无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

鉴于此输入: 

 [
{
" dataChannelId":8516,
" ;度量":[
{
" dateTime":" 2019-01-01T12:00:00",
},
{
" dateTime" ;:"2019-01-02T12:00:00",
}
}]

此查询: 

 WITH 
temp AS

SELECT
dataChannelId,
arrayElement.ArrayValue as element
FROM GriegInputStream
CROSS APPLY GetArrayElements([measures])AS arrayElement

SELECT
dataChannelId as sensorId,temp.element.dateTime
INTO
Sensoroutput
FROM
temp


我在dataChannelId上获取无效的列名,但它存在,与措施相同。如果我删除此字段,查询有效,但我想包括sensorId以及


解决方案

您好krister.karto,


为了确保您的查询以您期望的方式运行,Stream Analytics需要知道您的序列化格式是什么用于输入数据流。


确保在参考数据输入属性中使用JSON作为序列化格式。


希望这有帮助。


Given this input: 

[
        {
            "dataChannelId": 8516,
            "measures": [
                {
                    "dateTime": "2019-01-01T12:00:00",
                },
                {
                    "dateTime": "2019-01-02T12:00:00",
                }
}]

And this query: 

WITH 
temp AS
(
    SELECT 
        dataChannelId,
        arrayElement.ArrayValue as element
        FROM GriegInputStream 
        CROSS APPLY GetArrayElements([measures]) AS arrayElement  
)
SELECT
    dataChannelId as sensorId, temp.element.dateTime
INTO
    Sensoroutput
FROM
    temp

I Get Invalid column name on dataChannelId, but it is present, same as measures. If i remove this field, the query works, but I want to include the sensorId as well

解决方案

Hi krister.karto,

To make sure your queries work the way you expect, Stream Analytics needs to know which serialization format you're using for incoming data streams.

Make sure that you are using JSON as serialization format in Reference data input properties.

Hope this helps.


这篇关于列存在时列名无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆