提取配置单元中的数据

pkln4tw6  于 2021-06-26  发布在  Hive
关注(0)|答案(2)|浏览(270)

我在配置单元表列中有如下数据: customer reason=Other#customer reason free text=Space#customer type=Regular#customer end date=2020-12-31 19:50:00#customer offering criterion=0#customer type=KK#Customer factor=0.00#customer period=0#customer type=TN#customer value=0#customer plan type=M#cttype type=KK# 我要根据客户值提取数据值0。
我尝试了下面的查询,但它给出了完整的“客户价值=0”,但我只想要0。请建议。 select regexp_replace(regexp_extract(information,'customer period=[^#]*',0),'customer period=','') from detail;

cotxawn7

cotxawn71#

这个问题一点也不清楚。如果要限制输出,请使用limit 1(其中1是要限制的行数)

bfhwhh0e

bfhwhh0e2#

请给下面的人一个机会,
---表格创建----
创建表ch7(custdetailsMap字符串,string>)
行格式分隔
以“#”结尾的集合项
以“=”结尾的Map键;
----数据加载----
加载本地数据inpath“your file location in local”覆盖到表ch7中;
----数据选择-----
从ch7中选择custdetails[“customer value”];
希望这有帮助!!

相关问题