diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml
index e1f580ed32..084c3afe16 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.yaml
+++ b/.github/ISSUE_TEMPLATE/feature_request.yaml
@@ -40,7 +40,6 @@ body:
- Build
- Arrow
- Avro
- - Pig
- Protobuf
- Thrift
- CLI
diff --git a/README.md b/README.md
index ff6f162151..905229082c 100644
--- a/README.md
+++ b/README.md
@@ -72,7 +72,6 @@ Parquet is an active project, and new features are being added quickly. Here are
* Type-specific encoding
* Hive integration (deprecated)
-* Pig integration (deprecated)
* Cascading integration (deprecated)
* Crunch integration
* Apache Arrow integration
diff --git a/parquet-thrift/pom.xml b/parquet-thrift/pom.xml
index ade1ec3cdc..7fbd7cb646 100644
--- a/parquet-thrift/pom.xml
+++ b/parquet-thrift/pom.xml
@@ -70,7 +70,7 @@
provided
+ explicitly declare it as a test dependency. -->
com.google.guava
guava
@@ -89,18 +89,6 @@
-
- com.twitter.elephantbird
- elephant-bird-pig
- ${elephant-bird.version}
-
-
-
- com.hadoop.gplcompression
- hadoop-lzo
-
-
-
org.apache.parquet
parquet-jackson
@@ -124,18 +112,6 @@
test-jar
test
-
- org.apache.parquet
- parquet-pig
- 1.15.0
-
-
- org.apache.pig
- pig
- ${pig.version}
- ${pig.classifier}
- provided
-
org.apache.thrift
libthrift
diff --git a/parquet-thrift/src/main/java/org/apache/parquet/hadoop/thrift/AbstractThriftWriteSupport.java b/parquet-thrift/src/main/java/org/apache/parquet/hadoop/thrift/AbstractThriftWriteSupport.java
index dda9aadfb9..cb8a4c36b6 100644
--- a/parquet-thrift/src/main/java/org/apache/parquet/hadoop/thrift/AbstractThriftWriteSupport.java
+++ b/parquet-thrift/src/main/java/org/apache/parquet/hadoop/thrift/AbstractThriftWriteSupport.java
@@ -15,7 +15,6 @@
*/
package org.apache.parquet.hadoop.thrift;
-import com.twitter.elephantbird.pig.util.ThriftToPig;
import java.util.Map;
import org.apache.hadoop.conf.Configuration;
import org.apache.parquet.conf.HadoopParquetConfiguration;
@@ -25,13 +24,11 @@
import org.apache.parquet.io.ColumnIOFactory;
import org.apache.parquet.io.MessageColumnIO;
import org.apache.parquet.io.api.RecordConsumer;
-import org.apache.parquet.pig.PigMetaData;
import org.apache.parquet.schema.MessageType;
import org.apache.parquet.thrift.ParquetWriteProtocol;
import org.apache.parquet.thrift.ThriftMetaData;
import org.apache.parquet.thrift.ThriftSchemaConverter;
import org.apache.parquet.thrift.struct.ThriftType.StructType;
-import org.apache.thrift.TBase;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -99,26 +96,10 @@ protected void init(Class thriftClass) {
final Map extraMetaData =
new ThriftMetaData(thriftClass.getName(), thriftStruct).toExtraMetaData();
- // adding the Pig schema as it would have been mapped from thrift
- // TODO: make this work for non-tbase types
- if (isPigLoaded() && TBase.class.isAssignableFrom(thriftClass)) {
- new PigMetaData(new ThriftToPig((Class extends TBase, ?>>) thriftClass).toSchema())
- .addToMetaData(extraMetaData);
- }
this.writeContext = new WriteContext(schema, extraMetaData);
}
- protected boolean isPigLoaded() {
- try {
- Class.forName("org.apache.pig.impl.logicalLayer.schema.Schema");
- return true;
- } catch (ClassNotFoundException e) {
- LOG.info("Pig is not loaded, pig metadata will not be written");
- return false;
- }
- }
-
@Override
public WriteContext init(Configuration configuration) {
return init(new HadoopParquetConfiguration(configuration));
diff --git a/parquet-thrift/src/main/java/org/apache/parquet/thrift/pig/ParquetThriftStorer.java b/parquet-thrift/src/main/java/org/apache/parquet/thrift/pig/ParquetThriftStorer.java
deleted file mode 100644
index aec21eff4a..0000000000
--- a/parquet-thrift/src/main/java/org/apache/parquet/thrift/pig/ParquetThriftStorer.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.parquet.thrift.pig;
-
-import java.io.IOException;
-import java.util.Arrays;
-import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.mapreduce.Job;
-import org.apache.hadoop.mapreduce.OutputFormat;
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
-import org.apache.parquet.hadoop.ParquetOutputFormat;
-import org.apache.parquet.io.ParquetEncodingException;
-import org.apache.pig.StoreFunc;
-import org.apache.pig.data.Tuple;
-
-/**
- * To store in Pig using a thrift class
- * usage:
- * STORE 'foo' USING parquet.thrift.pig.ParquetThriftStorer('my.thrift.Class');
- *
- * @deprecated will be removed in 1.17.0 or 2.0.0
- */
-@Deprecated
-public class ParquetThriftStorer extends StoreFunc {
-
- private RecordWriter recordWriter;
-
- private String className;
-
- public ParquetThriftStorer(String[] params) {
- if (params == null || params.length != 1) {
- throw new IllegalArgumentException(
- "required the thrift class name in parameter. Got " + Arrays.toString(params) + " instead");
- }
- className = params[0];
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public OutputFormat getOutputFormat() throws IOException {
- return new ParquetOutputFormat(new TupleToThriftWriteSupport(className));
- }
-
- /**
- * {@inheritDoc}
- */
- @SuppressWarnings({"rawtypes", "unchecked"}) // that's how the base class is defined
- @Override
- public void prepareToWrite(RecordWriter recordWriter) throws IOException {
- this.recordWriter = recordWriter;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void putNext(Tuple tuple) throws IOException {
- try {
- this.recordWriter.write(null, tuple);
- } catch (InterruptedException e) {
- throw new ParquetEncodingException("Interrupted while writing", e);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void setStoreLocation(String location, Job job) throws IOException {
- FileOutputFormat.setOutputPath(job, new Path(location));
- }
-}
diff --git a/parquet-thrift/src/main/java/org/apache/parquet/thrift/pig/TupleToThriftWriteSupport.java b/parquet-thrift/src/main/java/org/apache/parquet/thrift/pig/TupleToThriftWriteSupport.java
deleted file mode 100644
index 395cf70f7e..0000000000
--- a/parquet-thrift/src/main/java/org/apache/parquet/thrift/pig/TupleToThriftWriteSupport.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.parquet.thrift.pig;
-
-import com.twitter.elephantbird.pig.util.PigToThrift;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.parquet.conf.HadoopParquetConfiguration;
-import org.apache.parquet.conf.ParquetConfiguration;
-import org.apache.parquet.hadoop.BadConfigurationException;
-import org.apache.parquet.hadoop.api.WriteSupport;
-import org.apache.parquet.hadoop.thrift.ThriftWriteSupport;
-import org.apache.parquet.io.api.RecordConsumer;
-import org.apache.pig.data.Tuple;
-import org.apache.thrift.TBase;
-
-/**
- * Stores Pig tuples as Thrift objects
- *
- * @deprecated will be removed in 1.17.0 or 2.0.0
- */
-@Deprecated
-public class TupleToThriftWriteSupport extends WriteSupport {
-
- private final String className;
- private ThriftWriteSupport> thriftWriteSupport;
- private PigToThrift> pigToThrift;
-
- /**
- * @param className the thrift class name
- */
- public TupleToThriftWriteSupport(String className) {
- super();
- this.className = className;
- }
-
- @Override
- public String getName() {
- return "thrift";
- }
-
- @Override
- public WriteContext init(Configuration configuration) {
- return init(new HadoopParquetConfiguration(configuration));
- }
-
- @SuppressWarnings({"rawtypes", "unchecked"})
- @Override
- public WriteContext init(ParquetConfiguration configuration) {
- try {
- Class> clazz = configuration.getClassByName(className).asSubclass(TBase.class);
- thriftWriteSupport = new ThriftWriteSupport(clazz);
- pigToThrift = new PigToThrift(clazz);
- return thriftWriteSupport.init(configuration);
- } catch (ClassNotFoundException e) {
- throw new BadConfigurationException("The thrift class name was not found: " + className, e);
- } catch (ClassCastException e) {
- throw new BadConfigurationException("The thrift class name should extend TBase: " + className, e);
- }
- }
-
- @Override
- public void prepareForWrite(RecordConsumer recordConsumer) {
- thriftWriteSupport.prepareForWrite(recordConsumer);
- }
-
- @Override
- public void write(Tuple t) {
- thriftWriteSupport.write(pigToThrift.getThriftObject(t));
- }
-}
diff --git a/parquet-thrift/src/main/java/org/apache/parquet/thrift/struct/ThriftType.java b/parquet-thrift/src/main/java/org/apache/parquet/thrift/struct/ThriftType.java
index 264790333a..c7aa12b3aa 100644
--- a/parquet-thrift/src/main/java/org/apache/parquet/thrift/struct/ThriftType.java
+++ b/parquet-thrift/src/main/java/org/apache/parquet/thrift/struct/ThriftType.java
@@ -142,6 +142,7 @@ default R visit(UUIDType uuidType, S state) {
/**
* @deprecated will be removed in 2.0.0; use StateVisitor instead.
*/
+ @Deprecated
public interface TypeVisitor {
void visit(MapType mapType);
diff --git a/parquet-thrift/src/test/java/org/apache/parquet/thrift/TestParquetWriteProtocol.java b/parquet-thrift/src/test/java/org/apache/parquet/thrift/TestParquetWriteProtocol.java
index 9e562bf734..d11be4af3c 100644
--- a/parquet-thrift/src/test/java/org/apache/parquet/thrift/TestParquetWriteProtocol.java
+++ b/parquet-thrift/src/test/java/org/apache/parquet/thrift/TestParquetWriteProtocol.java
@@ -23,7 +23,6 @@
import com.twitter.data.proto.tutorial.thrift.Person;
import com.twitter.data.proto.tutorial.thrift.PhoneNumber;
import com.twitter.data.proto.tutorial.thrift.PhoneType;
-import com.twitter.elephantbird.pig.util.ThriftToPig;
import com.twitter.elephantbird.thrift.test.TestMap;
import com.twitter.elephantbird.thrift.test.TestMapInList;
import com.twitter.elephantbird.thrift.test.TestMapInSet;
@@ -45,20 +44,14 @@
import java.util.Set;
import java.util.TreeMap;
import org.apache.hadoop.conf.Configuration;
-import org.apache.parquet.conf.ParquetConfiguration;
import org.apache.parquet.io.ColumnIOFactory;
import org.apache.parquet.io.ExpectationValidatingRecordConsumer;
import org.apache.parquet.io.MessageColumnIO;
import org.apache.parquet.io.RecordConsumerLoggingWrapper;
-import org.apache.parquet.pig.PigSchemaConverter;
-import org.apache.parquet.pig.TupleWriteSupport;
import org.apache.parquet.schema.MessageType;
import org.apache.parquet.thrift.struct.ThriftType.StructType;
-import org.apache.pig.data.Tuple;
-import org.apache.pig.impl.logicalLayer.schema.Schema;
import org.apache.thrift.TBase;
import org.apache.thrift.TException;
-import org.junit.ComparisonFailure;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -133,59 +126,20 @@ public void testMap() throws Exception {
map.put("foo", "bar");
map.put("foo2", "bar2");
TestMap testMap = new TestMap("map_name", map);
- try {
- validatePig(expectations, testMap);
- } catch (ComparisonFailure e) {
- // This can happen despite using a stable TreeMap, since ThriftToPig#toPigMap
- // in com.twitter.elephantbird.pig.util creates a HashMap.
- // So we test with the map elements in reverse order
- validatePig(expectationsAlt, testMap);
- }
validateThrift(expectations, testMap);
}
/**
* @throws Exception
- * @see TestThriftToPigCompatibility
*/
@Test
public void testMapInSet() throws Exception {
- String[] pigExpectations = {
- "startMessage()",
- "startField(name, 0)",
- "addBinary(top)",
- "endField(name, 0)",
- "startField(names, 1)", // set: optional field
- "startGroup()",
- "startField(t, 0)", // repeated field
- "startGroup()",
- "startField(names_tuple, 0)", // map: optional field
- "startGroup()",
- "startField(key_value, 0)", // repeated field
- "startGroup()",
- "startField(key, 0)", // key
- "addBinary(foo)",
- "endField(key, 0)",
- "startField(value, 1)", // value
- "addBinary(bar)",
- "endField(value, 1)",
- "endGroup()",
- "endField(key_value, 0)",
- "endGroup()",
- "endField(names_tuple, 0)",
- "endGroup()",
- "endField(t, 0)",
- "endGroup()",
- "endField(names, 1)",
- "endMessage()"
- };
final Set