[SPARK-3527] [SQL] Strip the string message