Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIG-5414 Fix the build for Linux ARM64 #35

Open
wants to merge 6 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 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.

os: linux
dist: focal
arch: arm64-graviton2
group: edge
virt: vm
language: generic
sudo: false

addons:
apt:
update: true
packages:
- openjdk-8-jdk
- ant
- ant-optional

before_script:
- lscpu
- export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-${TRAVIS_CPU_ARCH}"
- export PATH="$JAVA_HOME/bin:$PATH"
- java -version
- ant -version

script:
- ant clean test-unit
2 changes: 0 additions & 2 deletions ivy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,10 @@
<dependency org="org.apache.avro" name="trevni-core" rev="${avro.version}"
conf="compile->default;checkstyle->master">
<artifact name="trevni-core" ext="jar" />
<artifact name="trevni-core" type="test-jar" ext="jar" m:classifier="tests"/>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those break Ivy with:

/home/martin/git/apache/pig/build.xml:1777: impossible to ivy retrieve: java.lang.RuntimeException: problem during retrieve of org.apache.pig#pig: java.lang.RuntimeException: Multiple artifacts of the module org.apache.avro#trevni-core;1.8.2 are retrieved to the same file! Update the retrieve pattern  to fix this error.
	at org.apache.ivy.core.retrieve.RetrieveEngine.retrieve(RetrieveEngine.java:238)
	at org.apache.ivy.Ivy.retrieve(Ivy.java:561)
	at org.apache.ivy.ant.IvyRetrieve.doExecute(IvyRetrieve.java:113)
	at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:259)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:352)
	at org.apache.tools.ant.Target.execute(Target.java:437)
	at org.apache.tools.ant.Target.performTasks(Target.java:458)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1406)
	at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1261)
	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
	at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:352)
	at org.apache.tools.ant.Target.execute(Target.java:437)
	at org.apache.tools.ant.Target.performTasks(Target.java:458)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1406)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1377)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1261)
	at org.apache.tools.ant.Main.runBuild(Main.java:857)
	at org.apache.tools.ant.Main.startAnt(Main.java:236)
	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:287)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)
Caused by: java.lang.RuntimeException: Multiple artifacts of the module org.apache.avro#trevni-core;1.8.2 are retrieved to the same file! Update the retrieve pattern  to fix this error.
	at org.apache.ivy.core.retrieve.RetrieveEngine.determineArtifactsToCopy(RetrieveEngine.java:413)
	at org.apache.ivy.core.retrieve.RetrieveEngine.retrieve(RetrieveEngine.java:122)
	... 32 more

</dependency>
<dependency org="org.apache.avro" name="trevni-avro" rev="${avro.version}"
conf="compile->default;checkstyle->master">
<artifact name="trevni-avro" ext="jar" />
<artifact name="trevni-avro" type="test-jar" ext="jar" m:classifier="tests"/>
<exclude org="org.apache.hadoop" module="hadoop-core"/>
</dependency>
<dependency org="org.apache.avro" name="avro-tools" rev="${avro.version}"
Expand Down
6 changes: 3 additions & 3 deletions ivy/libraries.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ accumulo15.version=1.5.0
apacheant.version=1.7.1
apacherat.version=0.8
automaton.version=1.11-8
avro.version=1.7.5
avro.version=1.8.2
basjes-httpdlog-pigloader.version=5.0
commons-beanutils.version=1.7.0
commons-cli.version=1.2
Expand Down Expand Up @@ -89,10 +89,10 @@ jsr311-api.version=1.1.1
mockito.version=1.8.4
jansi.version=1.9
asm.version=3.3.1
snappy-java.version=1.1.1.3
snappy-java.version=1.1.8.4
tez.version=0.7.0
parquet-pig-bundle.version=1.9.0
snappy.version=0.2
snappy.version=0.4
leveldbjni.version=1.8
curator.version=2.6.0
htrace.version=3.1.0-incubating
Expand Down
3 changes: 1 addition & 2 deletions src/org/apache/pig/impl/util/avro/AvroRecordWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import static org.apache.avro.file.DataFileConstants.DEFAULT_SYNC_INTERVAL;
import static org.apache.avro.file.DataFileConstants.DEFLATE_CODEC;
import static org.apache.avro.mapred.AvroOutputFormat.DEFAULT_DEFLATE_LEVEL;
import static org.apache.avro.mapred.AvroOutputFormat.DEFLATE_LEVEL_KEY;
import static org.apache.avro.mapred.AvroOutputFormat.SYNC_INTERVAL_KEY;

Expand Down Expand Up @@ -73,7 +72,7 @@ static void configureDataFileWriter(DataFileWriter<GenericData.Record> writer,
JobConf job) throws UnsupportedEncodingException {
if (FileOutputFormat.getCompressOutput(job)) {
int level = job.getInt(DEFLATE_LEVEL_KEY,
DEFAULT_DEFLATE_LEVEL);
CodecFactory.DEFAULT_DEFLATE_LEVEL);
String codecName = job.get(AvroJob.OUTPUT_CODEC, DEFLATE_CODEC);
CodecFactory factory = codecName.equals(DEFLATE_CODEC)
? CodecFactory.deflateCodec(level)
Expand Down