[英]stream analytics query get error column name doesn't exist, but it does?
When I run my query in management studio it works fine, but in a stream analytics job it throws an error: Query compilation error: Invalid column name: 'afkorting'. 当我在Management Studio中运行查询时,它可以正常工作,但是在流分析作业中,它将引发错误:查询编译错误:无效的列名:'afkorting'。 Column with such name does not exist..
具有该名称的列不存在。
I downloaded the input tables to check if something went wrong with uploading, but that file does have that column name (and I double checked for capital letters, miswriting etc), so how can I fix this? 我下载了输入表,以检查上传是否有问题,但是该文件确实具有该列名(并且我再次检查了大写字母,错误书写等),那么如何解决此问题?
This is my query: 这是我的查询:
; WITH Check AS
(
SELECT afkorting, *
FROM Reizen RE
LEFT JOIN Gegevens AP
ON RE.ID = AP.code
)
SELECT *
FROM Check CH
JOIN Model VM
ON CH.afkorting = VM.Station
WHERE VM.h_station = VM.v_station
AND DATEPART(hour, CH.MsgReportDate) = VM.start_uur
AND (DATEPART(minute, CH.MsgReportDate) BETWEEN VM.start_minuut AND VM.eind_minuut)
AND DATEPART(weekday, CH.MsgReportDate) = VM.weekdag
Hope someone can help me! 希望可以有人帮帮我!
*PROBLEM SOLVED: you need to give in all columnnames, so not SELECT * but SELECT column1, column2 and use the given prefixes of the table, in my case: AP.column1, RE.column2 etc* *已解决问题:您需要输入所有列名,而不是SELECT *,而是选择SELECT列1,列2,并使用表的给定前缀,在我的情况下:AP.column1,RE.column2等*
Just summarize all comments above for resolving the issue, I did some testing for Stream Query language elements WITH
, SELECT
& JOIN
. 只需总结以上解决问题的所有评论,我就对Stream Query语言元素
WITH
, SELECT
& JOIN
进行了一些测试。 Here is my result list for the issue. 这是我针对该问题的结果列表。
JOIN
, using column names with symbol *
in the WITH
scope is correct for executing on ASA. JOIN
,则在WITH
范围内使用带有符号*
列名对于在ASA上执行是正确的。 JOIN
, it's necessary to list all column names you want without symbol *
for executing. JOIN
,有必要列出要执行的所有列名,但不带符号*
。 The reason seems to be to avoid ambiguity with column name conflict. you need to give in all column names, so not 您需要输入所有列名,所以不
SELECT * but SELECT column1, column2
and use the given prefixes of the table, for example in my case: 并使用表的给定前缀,例如在我的情况下:
AP.column1, RE.column2 etc
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.