Skip to content

Commit 41ebc5f

Browse files
committed
remove hive parquet bundle
1 parent a43e0da commit 41ebc5f

File tree

3 files changed

+58
-9
lines changed

3 files changed

+58
-9
lines changed

project/SparkBuild.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ object SQL {
228228
object Hive {
229229

230230
lazy val settings = Seq(
231-
libraryDependencies += "com.twitter" % "parquet-hive-bundle" % "1.5.0",
232231
javaOptions += "-XX:MaxPermSize=1g",
233232
// Multiple queries rely on the TestHive singleton. See comments there for more details.
234233
parallelExecution in Test := false,
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.spark.sql.hive.parquet
19+
20+
import java.util.Properties
21+
22+
import org.apache.hadoop.conf.Configuration
23+
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector.Category
24+
import org.apache.hadoop.hive.serde2.{SerDeStats, SerDe}
25+
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector
26+
import org.apache.hadoop.io.Writable
27+
28+
/**
29+
* A placeholder that allows SparkSQL users to create metastore tables that are stored as
30+
* parquet files. It is only intended to pass the checks that the serde is valid and exists
31+
* when a CREATE TABLE is run. The actual work of decoding will be done by ParquetTableScan
32+
* when "spark.sql.hive.convertMetastoreParquet" is set to true.
33+
*/
34+
@deprecated("No code should depend on FakeParquetHiveSerDe as it is only intended as a " +
35+
"placeholder in the Hive MetaStore")
36+
class FakeParquetSerDe extends SerDe {
37+
override def getObjectInspector: ObjectInspector = new ObjectInspector {
38+
override def getCategory: Category = Category.PRIMITIVE
39+
40+
override def getTypeName: String = "string"
41+
}
42+
43+
override def deserialize(p1: Writable): AnyRef = throwError
44+
45+
override def initialize(p1: Configuration, p2: Properties): Unit = {}
46+
47+
override def getSerializedClass: Class[_ <: Writable] = throwError
48+
49+
override def getSerDeStats: SerDeStats = throwError
50+
51+
override def serialize(p1: scala.Any, p2: ObjectInspector): Writable = throwError
52+
53+
private def throwError =
54+
sys.error(
55+
"spark.sql.hive.convertMetastoreParquet must be set to true to use FakeParquetSerDe")
56+
}

sql/hive/src/test/scala/org/apache/spark/sql/parquet/ParquetMetastoreSuite.scala

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,7 @@ class ParquetMetastoreSuite extends QueryTest with BeforeAndAfterAll {
6363
stringField STRING
6464
)
6565
PARTITIONED BY (p int)
66-
ROW FORMAT SERDE 'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
67-
STORED AS
68-
INPUTFORMAT 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
69-
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
66+
ROW FORMAT SERDE 'org.apache.spark.sql.hive.parquet.FakeParquetSerDe'
7067
location '${partitionedTableDir.getCanonicalPath}'
7168
""")
7269

@@ -76,10 +73,7 @@ class ParquetMetastoreSuite extends QueryTest with BeforeAndAfterAll {
7673
intField INT,
7774
stringField STRING
7875
)
79-
ROW FORMAT SERDE 'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
80-
STORED AS
81-
INPUTFORMAT 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
82-
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
76+
ROW FORMAT SERDE 'org.apache.spark.sql.hive.parquet.FakeParquetSerDe'
8377
location '${new File(partitionedTableDir, "p=1").getCanonicalPath}'
8478
""")
8579

0 commit comments

Comments
 (0)