using split in azure stream analytics

坚强是说给别人听的谎言 提交于 2020-01-07 09:03:49

问题


I have strings in the format "1234.567.111". I wish to break it into three int.

I do not see a split function in azure stream analytics. Is it possible to do this any other way.

Thanks

Update:

I have added a request for split function here.., would appreciate if you guys voted for the same..


回答1:


I wish Stream Analytics had a split function. You may have to use CHARINDEX and SUBSTRING for now: https://msdn.microsoft.com/en-us/library/azure/dn835064.aspx

It's a bit of a pain, but the following should work:

SELECT mystring
,SUBSTRING(
  mystring
  ,0
  ,CHARINDEX('.',mystring)
 ) as segment1
,SUBSTRING(
  mystring
  ,CHARINDEX('.',mystring)+1
  ,CHARINDEX('.',mystring,CHARINDEX('.',mystring)+1) - CHARINDEX('.',mystring) - 1
 ) as segment2
,SUBSTRING(
  mystring
  ,CHARINDEX('.',mystring,CHARINDEX('.',mystring)+1)+1
  ,999
 ) as segment3
from myinput

I would request a split function here (and post the link so we can vote): http://feedback.azure.com/forums/270577-azure-stream-analytics



来源:https://stackoverflow.com/questions/31555293/using-split-in-azure-stream-analytics

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!