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

[SPARK-26195][SQL] Correct exception messages in some classes #23154

Closed
wants to merge 1 commit into from

Conversation

lcqzte10192193
Copy link
Contributor

@lcqzte10192193 lcqzte10192193 commented Nov 27, 2018

What changes were proposed in this pull request?

UnsupportedOperationException messages are not the same with method name.This PR correct these messages.

How was this patch tested?

NA

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@kiszk
Copy link
Member

kiszk commented Nov 27, 2018

Good catch. I believe other files (e.g. VectorizedRleValuesReader.java, Expression.scala, and generators.scala also have the similar problem. Can this PR address them?

@lcqzte10192193 lcqzte10192193 changed the title [SQL] Correct two exception message in UnresolvedGenerator class [SQL] Correct exception messages in some classes Nov 28, 2018
@lcqzte10192193 lcqzte10192193 changed the title [SQL] Correct exception messages in some classes [SPARK-26195][SQL] Correct exception messages in some classes Nov 28, 2018
@lcqzte10192193
Copy link
Contributor Author

lcqzte10192193 commented Nov 28, 2018

Good catch. I believe other files (e.g. VectorizedRleValuesReader.java, Expression.scala, and generators.scala also have the similar problem. Can this PR address them?
···

ok,I will fix them,thanks

@kiszk
Copy link
Member

kiszk commented Nov 28, 2018

@lcqzte10192193 I am sorry for my misunderstanding The original code in VectorizedRleValuesReader.java was correct. Could you please revert you change?

@@ -204,10 +204,10 @@ case class UnresolvedGenerator(name: FunctionIdentifier, children: Seq[Expressio
throw new UnsupportedOperationException(s"Cannot evaluate expression: $this")

override protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode =
throw new UnsupportedOperationException(s"Cannot evaluate expression: $this")
throw new UnsupportedOperationException(s"Cannot generate code expression: $this")
Copy link
Member

Choose a reason for hiding this comment

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

Is it better to use generate code for expression or others rather than generate code expression?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes,I fix them.

@@ -258,7 +258,7 @@ case class GeneratorOuter(child: Generator) extends UnaryExpression with Generat
throw new UnsupportedOperationException(s"Cannot evaluate expression: $this")

final override protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode =
throw new UnsupportedOperationException(s"Cannot evaluate expression: $this")
throw new UnsupportedOperationException(s"Cannot generate code expression: $this")
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@@ -510,42 +510,42 @@ public void readIntegers(int total, WritableColumnVector c, int rowId) {

@Override
public byte readByte() {
throw new UnsupportedOperationException("only readInts is valid.");
throw new UnsupportedOperationException("only readByte is valid.");
Copy link
Contributor

Choose a reason for hiding this comment

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

These exception messages seem to be correct ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, thanks

@10110346
Copy link
Contributor

LGTM,thanks

@kiszk
Copy link
Member

kiszk commented Dec 1, 2018

LGTM cc @cloud-fan

@cloud-fan
Copy link
Contributor

thanks, merging to master!

@asfgit asfgit closed this in 031bd80 Dec 2, 2018
jackylee-ch pushed a commit to jackylee-ch/spark that referenced this pull request Feb 18, 2019
## What changes were proposed in this pull request?

UnsupportedOperationException messages are not the same with method name.This PR correct these messages.

## How was this patch tested?
NA

Closes apache#23154 from lcqzte10192193/wid-lcq-1127.

Authored-by: lichaoqun <li.chaoqun@zte.com.cn>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants