cloud-fan commented on a change in pull request #35494:
URL: https://github.com/apache/spark/pull/35494#discussion_r813520243
##########
File path:
sql/catalyst/src/main/java/org/apache/spark/sql/connector/expressions/GeneralScalarExpression.java
##########
@@ -20,22 +20,42 @@
import java.io.Serializable;
import org.apache.spark.annotation.Evolving;
+import org.apache.spark.sql.connector.util.V2ExpressionSQLBuilder;
/**
- * The general SQL string corresponding to expression.
+ * The general representation of SQL scalar expressions, which contains the
upper-cased
+ * expression name and all the children expressions.
*
* @since 3.3.0
*/
@Evolving
-public class GeneralSQLExpression implements Expression, Serializable {
- private String sql;
+public class GeneralScalarExpression implements Expression, Serializable {
+ private String name;
+ private Expression[] children;
+ private String sql;
- public GeneralSQLExpression(String sql) {
- this.sql = sql;
- }
+ public GeneralScalarExpression(String name, Expression[] children) {
+ this.name = name;
+ this.children = children;
+ }
- public String sql() { return sql; }
+ public String name() { return name; }
+ public Expression[] children() { return children; }
- @Override
- public String toString() { return sql; }
+ @Override
+ public String toString() {
+ if (sql == null) {
Review comment:
is it a cache? seems not needed as `toString` is not called frequently.
--
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]