oracle - regexp_substr oracle 函数转换为 pyspark
问题描述
我正在尝试将使用内置函数的现有 Oracle sql 转换regexp_substr
为 pyspark sql。这个 oracle sql 正在获取用户输入值并应用 regexp_substr 函数来获取所需的输出字符串。
示例 - 下面的 1BBC 字符串是用户输入值
1. select nvl(regexp_substr('1BBC', 'BBB\+|BBB|CCC|AAA|BB|CC|AA|B|A|C'), 'XYZ') from dual
Output -
BB
2. BBB++ string below is the user input value
select nvl(regexp_substr('BBB++', 'BBB\+|BBB|CCC|AAA|BB|CC|AA|B|A|C'), 'XYZ') from dual
Output -
BBB+
有没有办法使用 pyspark sql 或数据框操作来实现类似的输出?
解决方案
推荐阅读
- javascript - 一种遍历集合的跨浏览器方式。JS
- reactjs - 使用 React js 在 bootstrap 4 中获取导航栏的状态
- r - 我如何创建一个函数 gentimes() 来创建一个点的 nreps(w1,w2)
- html - 如何设置 Materialize 选择元素的大小?
- jmeter - JMETER:条件失败并出现语法错误
- c# - 我的机器的Application pool在Windows服务开发中消费第三方rest服务的作用是什么
- php - Laravel - 无法添加外键约束
- python - 为什么这个 Python 代码的 while 循环在运行时不会停止?
- linux - 如何打印在 linux elf 二进制文件中记录的编译目录?
- entity-framework - 如何在 C# EF Core 查询中将字符串转换为 DateTime