Hello,

I'm trying to make shallow copies of `SqlNode` objects by calling the `clone(SqlParserPos pos) <https://calcite.apache.org/javadocAggregate/org/apache/calcite/sql/SqlNode.html#clone(org.apache.calcite.sql.parser.SqlParserPos)>` method. However, the `SqlBasicCall` class overrides this method with an implementation <https://github.com/apache/calcite/blob/4b1e9ed1a513eae0c873a660b755bb4f27b39da9/core/src/main/java/org/apache/calcite/sql/SqlBasicCall.java#L100> that might return a new `SqlCall` that shares the operand array with the original. This is due to it calling `SqlOperator.createCall(SqlLiteral functionQualifier, SqlParserPos pos, SqlNode... operands) <https://calcite.apache.org/javadocAggregate/org/apache/calcite/sql/SqlOperator.html#createCall(org.apache.calcite.sql.SqlLiteral,org.apache.calcite.sql.parser.SqlParserPos,org.apache.calcite.sql.SqlNode...)>`, whose default implementation <https://github.com/apache/calcite/blob/4b1e9ed1a513eae0c873a660b755bb4f27b39da9/core/src/main/java/org/apache/calcite/sql/SqlOperator.java#L272> creates a new `SqlBasicCall` object without copying `operands`.

Is my understanding correct?

Thank you!

Best regards,
Wen

Reply via email to