Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12206#discussion_r58752400
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/StringUtils.scala
 ---
    @@ -52,4 +52,26 @@ object StringUtils {
     
       def isTrueString(s: UTF8String): Boolean = 
trueStrings.contains(s.toLowerCase)
       def isFalseString(s: UTF8String): Boolean = 
falseStrings.contains(s.toLowerCase)
    +
    +  /**
    +   * This utility can be used for filtering pattern in the "Like" of "Show 
Tables / Functions" DDL
    +   * @param names the names list to be filtered
    +   * @param pattern the filter pattern, only '*' and '|' are allowed as 
wildcards, others will
    +   *                follows regular expression convention, case 
insensitive match and white spaces
    +   *                on both ends will be ignored
    +   * @return the filtered names list in order
    +   */
    +  def filterPattern(names: Seq[String], pattern: String): Seq[String] = {
    +    val funcNames = scala.collection.mutable.SortedSet.empty[String]
    +    pattern.trim().split("\\|").foreach {
    --- End diff --
    
    style:
    ```
    ....foreach { subPattern =>
      try {
      } ...
    }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to