Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for PythonUDAF expression #937

Draft
wants to merge 9 commits into
base: dev
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ Pow,2.45
PreciseTimestampConversion,2.45
PromotePrecision,2.45
PythonUDF,2.45
PythonUDAF,2.45
Quarter,2.45
RLike,2.45
RaiseError,2.45
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ Pow,2.45
PreciseTimestampConversion,2.45
PromotePrecision,2.45
PythonUDF,2.45
PythonUDAF,2.45
Quarter,2.45
RLike,2.45
RaiseError,2.45
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ Pow,2.73
PreciseTimestampConversion,2.73
PromotePrecision,2.73
PythonUDF,2.73
PythonUDAF,2.73
Quarter,2.73
RLike,2.73
RaiseError,2.73
Expand Down
1 change: 1 addition & 0 deletions core/src/main/resources/operatorsScore-dataproc-gke-l4.csv
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ Pow,3.74
PreciseTimestampConversion,3.74
PromotePrecision,3.74
PythonUDF,3.74
PythonUDAF,3.74
Quarter,3.74
RLike,3.74
RaiseError,3.74
Expand Down
1 change: 1 addition & 0 deletions core/src/main/resources/operatorsScore-dataproc-gke-t4.csv
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ Pow,3.65
PreciseTimestampConversion,3.65
PromotePrecision,3.65
PythonUDF,3.65
PythonUDAF,3.65
Quarter,3.65
RLike,3.65
RaiseError,3.65
Expand Down
1 change: 1 addition & 0 deletions core/src/main/resources/operatorsScore-dataproc-l4.csv
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ Pow,4.16
PreciseTimestampConversion,4.16
PromotePrecision,4.16
PythonUDF,4.16
PythonUDAF,4.16
Quarter,4.16
RLike,4.16
RaiseError,4.16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ Pow,4.25
PreciseTimestampConversion,4.25
PromotePrecision,4.25
PythonUDF,4.25
PythonUDAF,4.25
Quarter,4.25
RLike,4.25
RaiseError,4.25
Expand Down
1 change: 1 addition & 0 deletions core/src/main/resources/operatorsScore-dataproc-t4.csv
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ Pow,4.88
PreciseTimestampConversion,4.88
PromotePrecision,4.88
PythonUDF,4.88
PythonUDAF,4.88
Quarter,4.88
RLike,4.88
RaiseError,4.88
Expand Down
1 change: 1 addition & 0 deletions core/src/main/resources/operatorsScore-emr-a10.csv
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ Pow,2.59
PreciseTimestampConversion,2.59
PromotePrecision,2.59
PythonUDF,2.59
PythonUDAF,2.59
Quarter,2.59
RLike,2.59
RaiseError,2.59
Expand Down
1 change: 1 addition & 0 deletions core/src/main/resources/operatorsScore-emr-a10G.csv
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ Pow,2.59
PreciseTimestampConversion,2.59
PromotePrecision,2.59
PythonUDF,2.59
PythonUDAF,2.59
Quarter,2.59
RLike,2.59
RaiseError,2.59
Expand Down
1 change: 1 addition & 0 deletions core/src/main/resources/operatorsScore-emr-t4.csv
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ Pow,2.07
PreciseTimestampConversion,2.07
PromotePrecision,2.07
PythonUDF,2.07
PythonUDAF,2.07
Quarter,2.07
RLike,2.07
RaiseError,2.07
Expand Down
1 change: 1 addition & 0 deletions core/src/main/resources/operatorsScore-onprem-a100.csv
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ Pow,4
PreciseTimestampConversion,4
PromotePrecision,4
PythonUDF,4
PythonUDAF,4
Quarter,4
RLike,4
RaiseError,4
Expand Down
16 changes: 8 additions & 8 deletions core/src/main/resources/supportedExprs.csv
Original file line number Diff line number Diff line change
Expand Up @@ -766,14 +766,14 @@ Empty2Null,S, ,None,project,input,NA,NA,NA,NA,NA,NA,NA,NA,NA,S,NA,NA,NA,NA,NA,NA
Empty2Null,S, ,None,project,result,NA,NA,NA,NA,NA,NA,NA,NA,NA,S,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
KnownNullable,S, ,None,project,input,S,S,S,S,S,S,S,S,PS,S,S,S,S,S,PS,PS,PS,S,S,S
KnownNullable,S, ,None,project,result,S,S,S,S,S,S,S,S,PS,S,S,S,S,S,PS,PS,PS,S,S,S
PythonUDAF,TNEW, ,None,aggregation,param,S,S,S,S,S,S,S,S,PS,S,NS,NS,NS,NS,PS,NS,PS,NS,NS,NS
PythonUDAF,TNEW, ,None,aggregation,result,S,S,S,S,S,S,S,S,PS,S,NS,NS,NS,NA,PS,NS,PS,NA,NA,NA
PythonUDAF,TNEW, ,None,reduction,param,S,S,S,S,S,S,S,S,PS,S,NS,NS,NS,NS,PS,NS,PS,NS,NS,NS
PythonUDAF,TNEW, ,None,reduction,result,S,S,S,S,S,S,S,S,PS,S,NS,NS,NS,NA,PS,NS,PS,NA,NA,NA
PythonUDAF,TNEW, ,None,window,param,S,S,S,S,S,S,S,S,PS,S,NS,NS,NS,NS,PS,NS,PS,NS,NS,NS
PythonUDAF,TNEW, ,None,window,result,S,S,S,S,S,S,S,S,PS,S,NS,NS,NS,NA,PS,NS,PS,NA,NA,NA
PythonUDAF,TNEW, ,None,project,param,S,S,S,S,S,S,S,S,PS,S,NS,NS,NS,NS,PS,NS,PS,NS,NS,NS
PythonUDAF,TNEW, ,None,project,result,S,S,S,S,S,S,S,S,PS,S,NS,NS,NS,NA,PS,NS,PS,NA,NA,NA
PythonUDAF,S, ,None,aggregation,param,S,S,S,S,S,S,S,S,PS,S,NS,NS,NS,NS,PS,NS,PS,NS,NS,NS
PythonUDAF,S, ,None,aggregation,result,S,S,S,S,S,S,S,S,PS,S,NS,NS,NS,NA,PS,NS,PS,NA,NA,NA
PythonUDAF,S, ,None,reduction,param,S,S,S,S,S,S,S,S,PS,S,NS,NS,NS,NS,PS,NS,PS,NS,NS,NS
PythonUDAF,S, ,None,reduction,result,S,S,S,S,S,S,S,S,PS,S,NS,NS,NS,NA,PS,NS,PS,NA,NA,NA
PythonUDAF,S, ,None,window,param,S,S,S,S,S,S,S,S,PS,S,NS,NS,NS,NS,PS,NS,PS,NS,NS,NS
PythonUDAF,S, ,None,window,result,S,S,S,S,S,S,S,S,PS,S,NS,NS,NS,NA,PS,NS,PS,NA,NA,NA
PythonUDAF,S, ,None,project,param,S,S,S,S,S,S,S,S,PS,S,NS,NS,NS,NS,PS,NS,PS,NS,NS,NS
PythonUDAF,S, ,None,project,result,S,S,S,S,S,S,S,S,PS,S,NS,NS,NS,NA,PS,NS,PS,NA,NA,NA
EphemeralSubstring,S,`substr`; `substring`,None,project,str,NA,NA,NA,NA,NA,NA,NA,NA,NA,S,NA,NA,NS,NA,NA,NA,NA,NA,NS,NS
EphemeralSubstring,S,`substr`; `substring`,None,project,pos,NA,NA,NA,S,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NS,NS
EphemeralSubstring,S,`substr`; `substring`,None,project,len,NA,NA,NA,S,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NS,NS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ object RDDCheckHelper {

object ExecHelper {
private val UDFRegExLookup = Set(
".*UDF.*".r
".*UDF.*".r, ".*UDAF.*".r
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is correct to add the *UDAF* to account for other UDAFs such as Hive and Scala.
However, the problem that the Q tool uses UDFRegExLookup to decide whether something is uDF or not.
That being said, any node description containing *UDAF* is going to be flagged as not-supported because it is a UDF.
Note that the same problem exists for PythonUDF which is supposed to be supported.

)

// we don't want to mark the *InPandas and ArrowEvalPythonExec as unsupported with UDF
Expand Down
88 changes: 0 additions & 88 deletions scripts/sync_plugin_files/override_supported_configs.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,94 +77,6 @@
}
]
},
{
"Expression": "PythonUDAF",
"Context": "aggregation",
"Params": "param",
"override": [
{
"key": "Supported",
"value": "TNEW"
}
]
},
{
"Expression": "PythonUDAF",
"Context": "aggregation",
"Params": "result",
"override": [
{
"key": "Supported",
"value": "TNEW"
}
]
},
{
"Expression": "PythonUDAF",
"Context": "reduction",
"Params": "param",
"override": [
{
"key": "Supported",
"value": "TNEW"
}
]
},
{
"Expression": "PythonUDAF",
"Context": "reduction",
"Params": "result",
"override": [
{
"key": "Supported",
"value": "TNEW"
}
]
},
{
"Expression": "PythonUDAF",
"Context": "window",
"Params": "param",
"override": [
{
"key": "Supported",
"value": "TNEW"
}
]
},
{
"Expression": "PythonUDAF",
"Context": "window",
"Params": "result",
"override": [
{
"key": "Supported",
"value": "TNEW"
}
]
},
{
"Expression": "PythonUDAF",
"Context": "project",
"Params": "param",
"override": [
{
"key": "Supported",
"value": "TNEW"
}
]
},
{
"Expression": "PythonUDAF",
"Context": "project",
"Params": "result",
"override": [
{
"key": "Supported",
"value": "TNEW"
}
]
},
{
"Expression": "RoundCeil",
"Context": "project",
Expand Down