Skip to content

Commit c00bb1b

Browse files
marmbrusyhuai
authored andcommitted
Don't use reflection to read options
1 parent 1ea6e7b commit c00bb1b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,13 @@ private[hive] class HiveMetastoreCatalog(hive: HiveContext) extends Catalog with
7373

7474
// It does not appear that the ql client for the metastore has a way to enumerate all the
7575
// SerDe properties directly...
76-
val method = classOf[Table].getDeclaredMethod("getSerdeInfo")
77-
method.setAccessible(true)
78-
val serdeInfo = method.invoke(table).asInstanceOf[SerDeInfo]
76+
val options = table.getTTable.getSd.getSerdeInfo.getParameters.toMap
7977

8078
val resolvedRelation =
8179
ResolvedDataSource(
8280
hive,
8381
table.getProperty("spark.sql.sources.provider"),
84-
serdeInfo.getParameters.toMap)
82+
options)
8583

8684
LogicalRelation(resolvedRelation.relation)
8785
}

0 commit comments

Comments
 (0)