Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-32559

Fix the trim logic in UTF8String.toInt/toLong did't handle Chinese characters correctly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.1
    • Component/s: SQL
    • Labels:

      Description

      The trim logic in Cast expression introduced in https://github.com/apache/spark/pull/26622 will trim chinese characters unexpectly.

      For example,  sql  select cast("1中文" as float) gives 1 instead of null

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                EdisonWang EdisonWang
                Reporter:
                EdisonWang EdisonWang
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: