We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Alias
What is the bug? The current class definition of Alias looks
public class Alias extends UnresolvedExpression { /** Original field name. */ private final String name; /** Expression aliased. */ private final UnresolvedExpression delegated; /** Optional field alias. */ private String alias;
When we need to build an Alias object, we actually use its name, for example:
name
UnresolvedExpression aggExpression = internalVisitExpression(aggCtx.statsFunction()); String name = aggCtx.alias == null ? getTextInQuery(aggCtx) : aggCtx.alias.getText(); Alias alias = new Alias(name, aggExpression); aggListBuilder.add(alias);
But, when we need to use this alias name, sometimes we use its alias, for example:
alias
Expression arg = context.popNamedParseExpressions().get(); return context.getNamedParseExpressions().push( org.apache.spark.sql.catalyst.expressions.Alias$.MODULE$.apply(arg, node.getAlias() != null ? node.getAlias() : node.getName(), NamedExpression.newExprId(), seq(new java.util.ArrayList<String>()), Option.empty(),
Although, there is no bug here since we check its nullable before using it, this still would be easy to introduce bugs in future.
What is the expected behavior? Refactor this class definition to remove the alias member in Alias.
What is your host/environment?
Do you have any screenshots? If applicable, add screenshots to help explain your problem.
Do you have any additional context? Add any other context about the problem.
The text was updated successfully, but these errors were encountered:
LantaoJin
Successfully merging a pull request may close this issue.
What is the bug?
The current class definition of
Alias
looksWhen we need to build an
Alias
object, we actually use itsname
, for example:But, when we need to use this alias name, sometimes we use its
alias
, for example:Although, there is no bug here since we check its nullable before using it, this still would be easy to introduce bugs in future.
What is the expected behavior?
Refactor this class definition to remove the
alias
member inAlias
.What is your host/environment?
Do you have any screenshots?
If applicable, add screenshots to help explain your problem.
Do you have any additional context?
Add any other context about the problem.
The text was updated successfully, but these errors were encountered: