Description
scala> spark.sql("select regexp_replace('', '[a\\\\d]{0,2}', 'x')").show +----------------------------------+ |regexp_replace(, [a\d]\{0,2}, x, 1)| +----------------------------------+ | x| +----------------------------------+ scala> spark.sql("select regexp_replace('', '[a\\\\d]{0, 2}', 'x')").show org.apache.spark.SparkException: The Spark SQL phase optimization failed with an internal error. Please, fill a bug report in, and provide the full stack trace.