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

    https://github.com/apache/spark/pull/22048#discussion_r213537463
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala ---
    @@ -294,23 +294,29 @@ class Dataset[T] private[sql](
         // We set a minimum column width at '3'
         val minimumColWidth = 3
     
    +    // Regular expression matching full width characters
    +    val fullWidthRegex = 
"""[\u1100-\u115F\u2E80-\uA4CF\uAC00-\uD7A3\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE6F\uFF00-\uFF60\uFFE0-\uFFE6]""".r
    +    // The number of half width of a string
    +    def stringHalfWidth = (str: String) => {
    +      str.length + fullWidthRegex.findAllIn(str).size
    +    }
    --- End diff --
    
    better to add tests for the helper function, too.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to