在Azure流分析中使用拆分 [英] using split in azure stream analytics

查看:54
本文介绍了在Azure流分析中使用拆分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有格式为"1234.567.111"的字符串.我希望将其分为三个整数.

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.

谢谢

更新:

我已添加了对拆分功能的请求

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

推荐答案

我希望Stream Analytics具有拆分功能.您可能现在必须使用CHARINDEX和SUBSTRING: https://msdn.microsoft.com/en-us/library/azure/dn835064.aspx

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

我会在此处请求一个拆分功能(并发布链接,以便我们进行投票): http://feedback.azure.com/forums/270577-azure-stream-analytics

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

这篇关于在Azure流分析中使用拆分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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