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

support mahout version 0.9 #410

Open
wants to merge 2 commits into
base: master
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
4 changes: 2 additions & 2 deletions mahout/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<groupId>com.twitter.elephantbird</groupId>
<artifactId>elephant-bird-pig</artifactId>
</dependency>
<dependency>
<!--<dependency>
<groupId>com.twitter.elephantbird</groupId>
<artifactId>elephant-bird-pig</artifactId>
<type>test-jar</type>
</dependency>
</dependency>-->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,15 +309,15 @@ protected Tuple toTuple(VectorWritable writable, ResourceFieldSchema schema) thr

protected Tuple toDenseVectorTuple(Vector v) {
List<Number> values = Lists.newArrayListWithCapacity(v.size());
for (Element e : v) {
for (Element e : v.all()) {
values.add(floatPrecision ? (float) e.get() : e.get());
}
return tupleFactory.newTupleNoCopy(values);
}

protected Tuple toSparseVectorTuple(Vector v) {
DataBag bag = bagFactory.newDefaultBag();
Iterator<Element> itr = v.iterateNonZero();
Iterator<Element> itr = v.nonZeroes().iterator(); //iterateNonZero();
while (itr.hasNext()) {
Element e = itr.next();
bag.add(tupleFactory.newTupleNoCopy(Lists.<Number> newArrayList(e.index(),
Expand Down
9 changes: 5 additions & 4 deletions pig/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
<groupId>com.twitter.elephantbird</groupId>
<artifactId>elephant-bird-core</artifactId>
</dependency>
<dependency>
<!--<dependency>
<groupId>com.twitter.elephantbird</groupId>
<artifactId>elephant-bird-core</artifactId>
<type>test-jar</type>
</dependency>
<scope>test</scope>
</dependency> -->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
Expand Down Expand Up @@ -82,7 +83,7 @@
</plugin>

<!-- need this for the mahout tests -->
<plugin>
<!-- <plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
Expand All @@ -91,7 +92,7 @@
</goals>
</execution>
</executions>
</plugin>
</plugin> -->

</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import java.io.IOException;
import java.util.Map;
import java.math.BigDecimal;
import java.math.BigInteger;

import com.google.common.base.Preconditions;

Expand Down Expand Up @@ -79,11 +81,11 @@ public Double bytesToDouble(byte[] bytes) throws IOException {
return toDouble(writable = readFields(bytes, writable));
}

@Override
public Map<String, Object> bytesToMap(byte[] bytes) throws IOException {
return toMap(writable = readFields(bytes, writable));
}

@Override
public Map<String, Object> bytesToMap(byte[] bytes, ResourceFieldSchema schema) throws IOException {
return toMap(writable = readFields(bytes, writable), schema);
}
Expand Down Expand Up @@ -146,4 +148,14 @@ protected DataBag toBag(W writable, ResourceFieldSchema schema) throws IOExcepti
protected DateTime toDateTime(W writable) throws IOException {
throw new UnsupportedOperationException();
}

@Override
public BigDecimal bytesToBigDecimal(byte[] b) throws IOException {
throw new UnsupportedOperationException();
}

@Override
public BigInteger bytesToBigInteger(byte[] b) throws IOException {
throw new UnsupportedOperationException();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import java.io.IOException;
import java.util.Map;
import java.math.BigDecimal;
import java.math.BigInteger;

import com.google.common.base.Preconditions;

Expand Down Expand Up @@ -92,6 +94,16 @@ public byte[] toBytes(DataBag value) throws IOException {
return write(toWritable(value));
}

@Override
public byte[] toBytes(BigDecimal value) throws IOException {
return write(toWritable(value));
}

@Override
public byte[] toBytes(BigInteger value) throws IOException {
return write(toWritable(value));
}

protected W toWritable(DataByteArray value) throws IOException {
throw new UnsupportedOperationException();
}
Expand Down Expand Up @@ -135,4 +147,12 @@ protected W toWritable(DataBag value) throws IOException {
protected W toWritable(DateTime value) throws IOException {
throw new UnsupportedOperationException();
}

protected W toWritable(BigDecimal value) throws IOException {
throw new UnsupportedOperationException();
}

protected W toWritable(BigInteger value) throws IOException {
throw new UnsupportedOperationException();
}
}
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<slf4j.version>1.6.4</slf4j.version>
<apache.hadoop1.version>1.1.2</apache.hadoop1.version> <!-- for hadoop1 profile -->
<apache.hadoop2.version>2.0.3-alpha</apache.hadoop2.version> <!-- for hadoop2 profile -->
<apache.pig.version>0.11.1</apache.pig.version>
<apache.hadoop2.version>2.6.0</apache.hadoop2.version> <!-- for hadoop2 profile -->
<apache.pig.version>0.14.0</apache.pig.version>
<apache.crunch.hadoop1.version>0.8.2</apache.crunch.hadoop1.version>
<apache.crunch.hadoop2.version>0.8.2-hadoop2</apache.crunch.hadoop2.version>
<apache.hive.version>0.8.0</apache.hive.version>
<apache.mahout.version>0.6</apache.mahout.version>
<apache.mahout.version>0.9</apache.mahout.version>
<apache.lucene.version>4.0.0</apache.lucene.version>
<protobuf.version>2.4.1</protobuf.version>
<hadoop-lzo.version>0.4.19</hadoop-lzo.version>
Expand Down Expand Up @@ -417,9 +417,6 @@
<profiles>
<profile>
<id>hadoop1</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<specific.hadoop.version>
${apache.hadoop1.version}
Expand All @@ -432,6 +429,9 @@
</profile>
<profile>
<id>hadoop2</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<specific.hadoop.version>
${apache.hadoop2.version}
Expand Down Expand Up @@ -685,10 +685,10 @@
<module>hive</module>
<module>mahout</module>
<module>pig</module>
<module>rcfile</module>
<!-- <module>rcfile</module>
<module>lucene</module>
<module>pig-lucene</module>
<module>examples</module>
<module>examples</module> -->
</modules>

</project>