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-37817][SQL][Minor] Remove unreachable code in complexTypeExtractors.scala #35106

Closed
wants to merge 1 commit into from

Conversation

gengliangwang
Copy link
Member

What changes were proposed in this pull request?

The constructor of GetArrayItem and GetMapValue with two input elements are not actually used. Usually, we implement such construction method so that it can be used in FunctionRegistry

def this(child: Expression, ordinal: Expression) = this(child, ordinal, SQLConf.get.ansiEnabled)

Since the expression GetArrayItem and GetMapValue are not used as functions in FunctionRegistry, we can remove these constructors.

Why are the changes needed?

Code clean up

Does this PR introduce any user-facing change?

No

How was this patch tested?

Existing UT

@github-actions github-actions bot added the SQL label Jan 5, 2022
@@ -236,8 +236,6 @@ case class GetArrayItem(
failOnError: Boolean = SQLConf.get.strictIndexOperator)
extends BinaryExpression with GetArrayItemUtil with ExpectsInputTypes with ExtractValue {

def this(child: Expression, ordinal: Expression) = this(child, ordinal, SQLConf.get.ansiEnabled)
Copy link
Member Author

Choose a reason for hiding this comment

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

The SQLConf.get.ansiEnabled here should be SQLConf.get.strictIndexOperator. But it doesn't matter since the code here is not reachable.

@gengliangwang
Copy link
Member Author

Merging to master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants