cloud-fan commented on a change in pull request #24068: [SPARK-27105][SQL] 
Optimize away exponential complexity in ORC predicate conversion
URL: https://github.com/apache/spark/pull/24068#discussion_r264999576
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala
 ##########
 @@ -38,18 +41,18 @@ import org.apache.spark.sql.types._
  *
  * The annoying part is that, `SearchArgument` builder methods like 
`startAnd()`, `startOr()`, and
  * `startNot()` mutate internal state of the builder instance.  This forces us 
to translate all
- * convertible filters with a single builder instance. However, before 
actually converting a filter,
- * we've no idea whether it can be recognized by ORC or not. Thus, when an 
inconvertible filter is
- * found, we may already end up with a builder whose internal state is 
inconsistent.
+ * convertible filters with a single builder instance. However, if we try to 
translate a filter
+ * before checking whether it can be converted or not, we may end up with a 
builder whose internal
+ * state is inconsistent in the case of an inconvertible filter.
  *
  * For example, to convert an `And` filter with builder `b`, we call 
`b.startAnd()` first, and then
  * try to convert its children.  Say we convert `left` child successfully, but 
find that `right`
  * child is inconvertible.  Alas, `b.startAnd()` call can't be rolled back, 
and `b` is inconsistent
 
 Review comment:
   can the builder be copied? Then we can simulate the rollback.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to