Skip to content
Snippets Groups Projects
Commit 2f6dece0 authored by Liang-Chi Hsieh's avatar Liang-Chi Hsieh Committed by Wenchen Fan
Browse files

[SPARK-22442][SQL][BRANCH-2.2][FOLLOWUP] ScalaReflection should produce...

[SPARK-22442][SQL][BRANCH-2.2][FOLLOWUP] ScalaReflection should produce correct field names for special characters

## What changes were proposed in this pull request?

`val TermName: TermNameExtractor` is new in scala 2.11. For 2.10, we should use deprecated `newTermName`.

## How was this patch tested?

Build locally with scala 2.10.

Author: Liang-Chi Hsieh <viirya@gmail.com>

Closes #19736 from viirya/SPARK-22442-2.2-followup.
parent f7363779
Branches exp_activity6
No related tags found
No related merge requests found
...@@ -27,7 +27,7 @@ import org.apache.spark.{SparkConf, SparkEnv} ...@@ -27,7 +27,7 @@ import org.apache.spark.{SparkConf, SparkEnv}
import org.apache.spark.serializer._ import org.apache.spark.serializer._
import org.apache.spark.sql.Row import org.apache.spark.sql.Row
import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.InternalRow
import org.apache.spark.sql.catalyst.ScalaReflection.universe.TermName import org.apache.spark.sql.catalyst.ScalaReflection.universe.newTermName
import org.apache.spark.sql.catalyst.encoders.RowEncoder import org.apache.spark.sql.catalyst.encoders.RowEncoder
import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.expressions.codegen.{CodegenContext, ExprCode} import org.apache.spark.sql.catalyst.expressions.codegen.{CodegenContext, ExprCode}
...@@ -190,7 +190,7 @@ case class Invoke( ...@@ -190,7 +190,7 @@ case class Invoke(
override def eval(input: InternalRow): Any = override def eval(input: InternalRow): Any =
throw new UnsupportedOperationException("Only code-generated evaluation is supported.") throw new UnsupportedOperationException("Only code-generated evaluation is supported.")
private lazy val encodedFunctionName = TermName(functionName).encodedName.toString private lazy val encodedFunctionName = newTermName(functionName).encodedName.toString
@transient lazy val method = targetObject.dataType match { @transient lazy val method = targetObject.dataType match {
case ObjectType(cls) => case ObjectType(cls) =>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment