HyukjinKwon commented on code in PR #58838:
URL: https://github.com/apache/spark/pull/58838#discussion_r4079526425
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/ResolveDefaultColumnsUtil.scala:
##########
@@ -497,9 +497,19 @@ object ResolveDefaultColumns extends QueryErrorsBase
* Afterwards, set element(s) to false before calling
[[applyExistenceDefaultValuesToRow]] below.
*/
def resetExistenceDefaultsBitmask(schema: StructType, bitmask:
Array[Boolean]): Unit = {
- val defaultValues = existenceDefaultValues(schema)
- for (i <- 0 until defaultValues.length) {
- bitmask(i) = (defaultValues(i) != null)
+ resetExistenceDefaultsBitmask(existenceDefaultValues(schema), bitmask)
+ }
+
+ /**
+ * Resets the bitmask from a precomputed array of existence default values
(see
+ * [[getExistenceDefaultValues]]). Callers that cache the values should use
this overload to avoid
+ * recomputing them from the schema on every row.
+ */
+ def resetExistenceDefaultsBitmask(defaultValues: Array[Any], bitmask:
Array[Boolean]): Unit = {
Review Comment:
Why do we separate the methods?
--
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]