MaxGekk commented on code in PR #38728:
URL: https://github.com/apache/spark/pull/38728#discussion_r1033537819
##########
connector/connect/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -504,7 +545,11 @@ class SparkConnectPlanner(session: SparkSession) {
case proto.Join.JoinType.JOIN_TYPE_LEFT_OUTER => LeftOuter
case proto.Join.JoinType.JOIN_TYPE_RIGHT_OUTER => RightOuter
case proto.Join.JoinType.JOIN_TYPE_LEFT_SEMI => LeftSemi
- case _ => throw InvalidPlanInput(s"Join type ${t} is not supported")
+ case _ =>
+ throw new SparkException(
+ errorClass = "CONNECT.INVALID_PLAN_UNSUPPORTED_JOIN_TYPE",
+ messageParameters = Map("type" -> s"${t}"),
Review Comment:
nit:
```suggestion
messageParameters = Map("type" -> s"$t"),
```
##########
connector/connect/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -265,7 +280,10 @@ class SparkConnectPlanner(session: SparkSession) {
// so we call filter instead of find.
val cols = allColumns.filter(col => resolver(col.name, colName))
if (cols.isEmpty) {
- throw InvalidPlanInput(s"Invalid deduplicate column ${colName}")
+ throw new SparkException(
+ errorClass =
"CONNECT.INVALID_PLAN_DEDUPLICATE_INVALID_INPUT_COLUMN",
+ messageParameters = Map("col" -> colName),
Review Comment:
Could you quote the column by `toSQLId()`, please.
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -134,6 +134,97 @@
"message" : [
"Error instantiating GRPC interceptor: <msg>"
]
+ },
+ "INVALID_COMMAND_WRITE_INVALID_BUCKET_BY" : {
+ "message" : [
+ "BucketBy must specify a bucket count > 0, received <bucket>
instead."
+ ]
+ },
+ "INVALID_PLAN_INPUT" : {
+ "message" : [
+ "Error transforming Spark Connect plan: <msg>"
+ ]
+ },
+ "INVALID_PLAN_UNKNOWN_RELATION": {
+ "message": [
+ "Relation: <param> not supported."
+ ]
+ },
+ "INVALID_PLAN_TRANSFORM_NA_FILL_EMPTY": {
+ "message": [
+ "Values must contains at least 1 item"
+ ]
+ },
+ "INVALID_PLAN_TRANSFORM_NA_FILL_SIZE": {
+ "message": [
+ "When values contains more than 1 items, ",
+ "values and cols should have the same length!"
+ ]
+ },
+ "INVALID_PLAN_UNSUPPORTED_LITERAL_TYPE": {
+ "message": [
+ "Unsupported Literal type: <type>"
+ ]
+ },
+ "INVALID_PLAN_EMPTY_INPUT" : {
+ "message": [
+ "Input relation must not be empty."
+ ]
+ },
+ "INVALID_PLAN_DEDUPLICATE_INVALID_INPUT" : {
+ "message": [
+ "Deduplicate must be called with either all or a subset of coulumn
names to deduplicate."
+ ]
+ },
+ "INVALID_PLAN_DEDUPLICATE_INVALID_INPUT_COLUMN" : {
+ "message": [
+ "Invalid column name used for Deduplicate: <col>"
+ ]
+ },
+ "INVALID_PLAN_INVALID_DATA_SOURCE" : {
+ "message": [
+ "Read from DataSource requires a format parameter"
Review Comment:
```suggestion
"Read from DataSource requires a format parameter."
```
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -134,6 +134,97 @@
"message" : [
"Error instantiating GRPC interceptor: <msg>"
]
+ },
+ "INVALID_COMMAND_WRITE_INVALID_BUCKET_BY" : {
+ "message" : [
+ "BucketBy must specify a bucket count > 0, received <bucket>
instead."
+ ]
+ },
+ "INVALID_PLAN_INPUT" : {
+ "message" : [
+ "Error transforming Spark Connect plan: <msg>"
+ ]
+ },
+ "INVALID_PLAN_UNKNOWN_RELATION": {
+ "message": [
+ "Relation: <param> not supported."
+ ]
+ },
+ "INVALID_PLAN_TRANSFORM_NA_FILL_EMPTY": {
+ "message": [
+ "Values must contains at least 1 item"
+ ]
+ },
+ "INVALID_PLAN_TRANSFORM_NA_FILL_SIZE": {
+ "message": [
+ "When values contains more than 1 items, ",
+ "values and cols should have the same length!"
Review Comment:
```suggestion
"When values contains more than 1 items, values and cols should
have the same length."
```
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -134,6 +134,97 @@
"message" : [
"Error instantiating GRPC interceptor: <msg>"
]
+ },
+ "INVALID_COMMAND_WRITE_INVALID_BUCKET_BY" : {
+ "message" : [
+ "BucketBy must specify a bucket count > 0, received <bucket>
instead."
+ ]
+ },
+ "INVALID_PLAN_INPUT" : {
+ "message" : [
+ "Error transforming Spark Connect plan: <msg>"
+ ]
+ },
+ "INVALID_PLAN_UNKNOWN_RELATION": {
+ "message": [
+ "Relation: <param> not supported."
+ ]
+ },
+ "INVALID_PLAN_TRANSFORM_NA_FILL_EMPTY": {
+ "message": [
+ "Values must contains at least 1 item"
Review Comment:
```suggestion
"Values must contains at least 1 item."
```
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -134,6 +134,97 @@
"message" : [
"Error instantiating GRPC interceptor: <msg>"
]
+ },
+ "INVALID_COMMAND_WRITE_INVALID_BUCKET_BY" : {
+ "message" : [
+ "BucketBy must specify a bucket count > 0, received <bucket>
instead."
+ ]
+ },
+ "INVALID_PLAN_INPUT" : {
+ "message" : [
+ "Error transforming Spark Connect plan: <msg>"
+ ]
+ },
+ "INVALID_PLAN_UNKNOWN_RELATION": {
Review Comment:
Wrong the formatting here and bellow:
```suggestion
"INVALID_PLAN_UNKNOWN_RELATION" : {
```
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -134,6 +134,97 @@
"message" : [
"Error instantiating GRPC interceptor: <msg>"
]
+ },
+ "INVALID_COMMAND_WRITE_INVALID_BUCKET_BY" : {
+ "message" : [
+ "BucketBy must specify a bucket count > 0, received <bucket>
instead."
+ ]
+ },
+ "INVALID_PLAN_INPUT" : {
+ "message" : [
+ "Error transforming Spark Connect plan: <msg>"
+ ]
+ },
+ "INVALID_PLAN_UNKNOWN_RELATION": {
+ "message": [
+ "Relation: <param> not supported."
+ ]
+ },
+ "INVALID_PLAN_TRANSFORM_NA_FILL_EMPTY": {
+ "message": [
+ "Values must contains at least 1 item"
+ ]
+ },
+ "INVALID_PLAN_TRANSFORM_NA_FILL_SIZE": {
+ "message": [
+ "When values contains more than 1 items, ",
+ "values and cols should have the same length!"
+ ]
+ },
+ "INVALID_PLAN_UNSUPPORTED_LITERAL_TYPE": {
+ "message": [
+ "Unsupported Literal type: <type>"
+ ]
+ },
+ "INVALID_PLAN_EMPTY_INPUT" : {
+ "message": [
+ "Input relation must not be empty."
+ ]
+ },
+ "INVALID_PLAN_DEDUPLICATE_INVALID_INPUT" : {
+ "message": [
+ "Deduplicate must be called with either all or a subset of coulumn
names to deduplicate."
+ ]
+ },
+ "INVALID_PLAN_DEDUPLICATE_INVALID_INPUT_COLUMN" : {
+ "message": [
+ "Invalid column name used for Deduplicate: <col>"
+ ]
+ },
+ "INVALID_PLAN_INVALID_DATA_SOURCE" : {
+ "message": [
+ "Read from DataSource requires a format parameter"
+ ]
+ },
+ "INVALID_PLAN_UNSUPPORTED_DATA_SOURCE" : {
+ "message": [
+ "Unsupported input data source: <type>"
+ ]
+ },
+ "INVALID_PLAN_UNSUPPORTED_EXPRESSION_TYPE" : {
+ "message": [
+ "Unsupported expression type: <type>"
+ ]
+ },
+ "INVALID_PLAN_INVALID_ALIAS" : {
+ "message": [
+ "Alias expressions with more than 1 identifier must not use optional
metadata."
+ ]
+ },
+ "INVALID_PLAN_INVALID_SET_OPERATION" : {
+ "message": [
+ "Invalid Set operation: <type> does not support <param>"
+ ]
+ },
+ "INVALID_PLAN_UNSUPPORTED_SET_OPERATION" : {
+ "message": [
+ "Unsupported Set operation: <type>"
+ ]
+ },
+ "INVALID_PLAN_UNSUPPORTED_JOIN_TYPE" : {
+ "message": [
+ "Unsupported Join type: <type>"
+ ]
+ },
+ "INVALID_PLAN_INVALID_JOIN_CONDITION" : {
+ "message": [
+ "Using columns or join conditions cannot be set at the same time in
Join"
Review Comment:
```suggestion
"Using columns or join conditions cannot be set at the same time
in Join."
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]