Skip to content

Commit

Permalink
Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
beliefer committed Jun 13, 2023
1 parent abfa654 commit 4ebf5d3
Show file tree
Hide file tree
Showing 13 changed files with 142 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,11 @@ class PlanGenerationTestSuite
fn.regexp_extract(fn.col("g"), "(\\d+)-(\\d+)", 1)
}

functionTest("regexp_extract_all") {
functionTest("regexp_extract_all without regex group index") {
fn.regexp_extract_all(fn.col("g"), lit("(\\d+)([a-z]+)"))
}

functionTest("regexp_extract_all with regex group index") {
fn.regexp_extract_all(fn.col("g"), lit("(\\d+)([a-z]+)"), lit(1))
}

Expand All @@ -1510,7 +1514,11 @@ class PlanGenerationTestSuite
fn.regexp_substr(fn.col("g"), lit("\\d{2}(a|b|m)"))
}

functionTest("regexp_instr") {
functionTest("regexp_instr without regex group index") {
fn.regexp_instr(fn.col("g"), lit("\\d+(a|b|m)"))
}

functionTest("regexp_instr with regex group index") {
fn.regexp_instr(fn.col("g"), lit("\\d+(a|b|m)"), lit(1))
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Project [regexp_extract_all(g#0, (\d+)([a-z]+), 1) AS regexp_extract_all(g, (\d+)([a-z]+), 1)#0]
+- LocalRelation <empty>, [id#0L, a#0, b#0, d#0, e#0, f#0, g#0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Project [regexp_extract_all(g#0, (\d+)([a-z]+), 1) AS regexp_extract_all(g, (\d+)([a-z]+), 1)#0]
+- LocalRelation <empty>, [id#0L, a#0, b#0, d#0, e#0, f#0, g#0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Project [regexp_instr(g#0, \d+(a|b|m), 1) AS regexp_instr(g, \d+(a|b|m), 1)#0]
+- LocalRelation <empty>, [id#0L, a#0, b#0, d#0, e#0, f#0, g#0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Project [regexp_instr(g#0, \d+(a|b|m), 0) AS regexp_instr(g, \d+(a|b|m), 0)#0]
+- LocalRelation <empty>, [id#0L, a#0, b#0, d#0, e#0, f#0, g#0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"common": {
"planId": "1"
},
"project": {
"input": {
"common": {
"planId": "0"
},
"localRelation": {
"schema": "struct\u003cid:bigint,a:int,b:double,d:struct\u003cid:bigint,a:int,b:double\u003e,e:array\u003cint\u003e,f:map\u003cstring,struct\u003cid:bigint,a:int,b:double\u003e\u003e,g:string\u003e"
}
},
"expressions": [{
"unresolvedFunction": {
"functionName": "regexp_extract_all",
"arguments": [{
"unresolvedAttribute": {
"unparsedIdentifier": "g"
}
}, {
"literal": {
"string": "(\\d+)([a-z]+)"
}
}, {
"literal": {
"integer": 1
}
}]
}
}]
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"common": {
"planId": "1"
},
"project": {
"input": {
"common": {
"planId": "0"
},
"localRelation": {
"schema": "struct\u003cid:bigint,a:int,b:double,d:struct\u003cid:bigint,a:int,b:double\u003e,e:array\u003cint\u003e,f:map\u003cstring,struct\u003cid:bigint,a:int,b:double\u003e\u003e,g:string\u003e"
}
},
"expressions": [{
"unresolvedFunction": {
"functionName": "regexp_extract_all",
"arguments": [{
"unresolvedAttribute": {
"unparsedIdentifier": "g"
}
}, {
"literal": {
"string": "(\\d+)([a-z]+)"
}
}]
}
}]
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"common": {
"planId": "1"
},
"project": {
"input": {
"common": {
"planId": "0"
},
"localRelation": {
"schema": "struct\u003cid:bigint,a:int,b:double,d:struct\u003cid:bigint,a:int,b:double\u003e,e:array\u003cint\u003e,f:map\u003cstring,struct\u003cid:bigint,a:int,b:double\u003e\u003e,g:string\u003e"
}
},
"expressions": [{
"unresolvedFunction": {
"functionName": "regexp_instr",
"arguments": [{
"unresolvedAttribute": {
"unparsedIdentifier": "g"
}
}, {
"literal": {
"string": "\\d+(a|b|m)"
}
}, {
"literal": {
"integer": 1
}
}]
}
}]
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"common": {
"planId": "1"
},
"project": {
"input": {
"common": {
"planId": "0"
},
"localRelation": {
"schema": "struct\u003cid:bigint,a:int,b:double,d:struct\u003cid:bigint,a:int,b:double\u003e,e:array\u003cint\u003e,f:map\u003cstring,struct\u003cid:bigint,a:int,b:double\u003e\u003e,g:string\u003e"
}
},
"expressions": [{
"unresolvedFunction": {
"functionName": "regexp_instr",
"arguments": [{
"unresolvedAttribute": {
"unparsedIdentifier": "g"
}
}, {
"literal": {
"string": "\\d+(a|b|m)"
}
}]
}
}]
}
}
Binary file not shown.

0 comments on commit 4ebf5d3

Please sign in to comment.