我有字符串列,我想要第一个分号后的数据列数据:Options;list:direct&ACFs:Sharemarket我希望输出为list:direct&ACFs:股票市场我试过这个选项选择(regexp_extract(property,'^(?:([^;]*)\;?){2}',1))结果输出为list:direct&如何在第一个分号之后填充完整的字符串,就像我的输出一样list:direct&ACFs:股票市场有人能帮帮我吗? 最佳答案 你可以试试这个selectregexp_extract('Options;list;d
我正在尝试配置一个从.csv或.xl3读取的水槽代理。文件示例:ClientAClientBStart-timeEnd-timeDurationStatus358625153695845216/01/201716/01/201710good324569882258369416/01/201716/01/201705good359684783698572416/01/201716/01/2017324569882258369416/01/201716/01/201701good我希望代理逐行过滤文件。如果Duration不为空,则事件将发送到hdfs/usr/admin/Good_Cal
我正在尝试为具有以下格式的日志文件创建一个Hive表。日志文件:#Software:1#Version:1#Start-Date:xx#Date:xx#Fields:datetimetime-takenc-ipcs-usernamecs-auth-groupx-exception-idsc-filter-resultcs-categoriescs(Referer)sc-statuss-actioncs-methodrs(Content-Type)cs-uri-schemecs-hostcs-uri-portcs-uri-pathcs-uri-querycs-uri-extensionc
我需要使用regex_extract从列中的字符串中提取数字。我在外部表上使用Impala。我已经检查了正则表达式,为了测试它,我还使用了regexp_like和regexp_replace。他们两个都工作得很完美。这里是查询:selectsucursal,regexp_like(sucursal,'^[0-9]{1,3}')asmatch,regexp_extract(sucursal,'^[0-9]{1,3}',1)asCodSucusal,regexp_replace(sucursal,'^[0-9]{1,3}','lala')asRepCodSucusalfromjdv.stg
我有一个如下所述的csv文件。VTS,51,0071,9739965515,NM,GP,INF01,V,19,072219,291014,0000.0000,N,00000.0000,E,07AEVTS,01,0097,9739965515,SP,GP,18,072253,V,0000.0000,N,00000.0000,E,0.0,0.0,291014,0000,00,4000,11,999,169,B205VTS,51,0071,9739965515,NM,GP,INF01,V,18,072311,291014,0000.0000,N,00000.0000,E,C24EVTS,01
输入文件如下eno::ename::dept::sal101::emp1::comp1::2800000201::emp2::comp2::2800000301::emp3::comp3::3400000401::emp4::comp4::3600000501::emp5::comp5::400000>createtableemp(enamestring,edeptstring)>rowformatserde'org.apache.hadoop.hive.contrib.serde2.RegexSerDe'>WITHSERDEPROPERTIES(>"input.regex"="^([
我正在使用Hive分析如下所示的Web日志415503--[10/Jun/1998:00:48:00+0000]"GET/english/images/nav_sitemap_off.gifHTTP/1.1"200416我使用下面的正则表达式将其加载到工作正常的配置单元表([^]*)([^]*)([^]*)(-|\\[[^\\]]*\\])([^\"]*|\"[^\"]*\")(-|[0-9]*)(-|[0-9]*)但是如果我在https://www.regex101.com/中检查这个正则表达式,此正则表达式与我的字符串不匹配。如果我删除block中的一些反斜杠(-|\\[[^\\]
我的表结构如下。CREATETABLEdb.TEST(f1string,f2string,f3string)ROWFORMATSERDE'org.apache.hadoop.hive.serde2.RegexSerDe'WITHSERDEPROPERTIES('input.regex'='(.{2})(.{3})(.{4})')STOREDASINPUTFORMAT'org.apache.hadoop.mapred.TextInputFormat'OUTPUTFORMAT'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputForma
我正在尝试从“[223.104.227.42]”中提取IP地址。我想提取“[”和“]”之间的223.104.227.42,我正在使用这个查询:selectregexp_extract('[223.104.227.42]','\\[(.*?)\\]')但是我得到一个错误:FAILED:Infunctionregexp_extract,patternmusthasonegroupreferenceatleast. 最佳答案 尝试将捕获组索引指定为参数(1):hive>selectregexp_extract('[223.104.227.
我想使用CASEWHEN、LIKE和正则表达式在配置单元表中编写查询。我使用了regexp和rlike,但我没有得到想要的结果。到目前为止,我的尝试如下selectdistinctendingfrom(selectdate,ending,name,count(distinctid)from(selectCONCAT_WS("/",year,month,day,hour)asdate,id,name,casewhentype='TRAN'then'tran'wheneventsregexp'%[:]no_reply[:]%[^o][^n][:]incomplete[:]%'andtype