Hi,

Thanks!!

I tried to apply the patches, both spark-1297-v2.txt and spark-1297-v4.txt are good here,  but not spark-1297-v5.txt:


$ patch -p1 -i spark-1297-v4.txt
patching file examples/pom.xml

$ patch -p1 -i spark-1297-v5.txt
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git docs/building-with-maven.md docs/building-with-maven.md
|index 672d0ef..f8bcd2b 100644
|--- docs/building-with-maven.md
|+++ docs/building-with-maven.md
--------------------------
File to patch: 



{\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210
{\fonttbl\f0\fnil\fcharset0 Menlo-Regular;}
{\colortbl;\red255\green255\blue255;}
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural

\f0\fs22 \cf0 \CocoaLigature0 diff --git docs/building-with-maven.md 
docs/building-with-maven.md\
index 672d0ef..f8bcd2b 100644\
--- docs/building-with-maven.md\
+++ docs/building-with-maven.md\
@@ -71,6 +71,9 @@ For Apache Hadoop 2.x, 0.23.x, Cloudera CDH, and other Hadoop 
versions with YARN\
   </tbody>\
 </table>\
 \
+To build against HBase 0.98.x releases, "hbase-hadoop1" is the default 
profile. This means hbase-0.98.x-hadoop1 would be used.\
+When building against hadoop-2, "hbase-hadoop2" profile should be specified.\
+\
 Examples:\
 \
 \{% highlight bash %\}\
diff --git examples/pom.xml examples/pom.xml\
index 8c4c128..9ae50cd 100644\
--- examples/pom.xml\
+++ examples/pom.xml\
@@ -45,6 +45,30 @@\
         </dependency>\
       </dependencies>\
     </profile>\
+    <profile>\
+      <id>hbase-hadoop2</id>\
+      <activation>\
+        <property>\
+          <name>hbase.profile</name>\
+          <value>hadoop2</value>\
+        </property>\
+      </activation>\
+      <properties>\
+        <hbase.version>0.98.4-hadoop2</hbase.version>\
+      </properties>\
+    </profile>\
+    <profile>\
+      <id>hbase-hadoop1</id>\
+      <activation>\
+        <property>\
+          <name>!hbase.profile</name>\
+        </property>\
+      </activation>\
+      <properties>\
+        <hbase.version>0.98.4-hadoop1</hbase.version>\
+      </properties>\
+    </profile>\
+\
   </profiles>\
   \
   <dependencies>\
@@ -110,36 +134,121 @@\
       <version>$\{project.version\}</version>\
     </dependency>\
     <dependency>\
-      <groupId>org.apache.hbase</groupId>\
-      <artifactId>hbase</artifactId>\
-      <version>$\{hbase.version\}</version>\
-      <exclusions>\
-        <exclusion>\
-          <groupId>asm</groupId>\
-          <artifactId>asm</artifactId>\
-        </exclusion>\
-        <exclusion>\
-          <groupId>org.jboss.netty</groupId>\
-          <artifactId>netty</artifactId>\
-        </exclusion>\
-        <exclusion>\
-          <groupId>io.netty</groupId>\
-          <artifactId>netty</artifactId>\
-        </exclusion>\
-        <exclusion>\
-          <groupId>commons-logging</groupId>\
-          <artifactId>commons-logging</artifactId>\
-        </exclusion>\
-        <exclusion>\
-          <groupId>org.jruby</groupId>\
-          <artifactId>jruby-complete</artifactId>\
-        </exclusion>\
-      </exclusions>\
-    </dependency>\
-    <dependency>\
       <groupId>org.eclipse.jetty</groupId>\
       <artifactId>jetty-server</artifactId>\
     </dependency>\
+      <dependency>\
+        <groupId>org.apache.hbase</groupId>\
+        <artifactId>hbase-testing-util</artifactId>\
+        <version>$\{hbase.version\}</version>\
+        <exclusions>\
+          <exclusion>\
+            <groupId>org.jruby</groupId>\
+            <artifactId>jruby-complete</artifactId>\
+          </exclusion>\
+        </exclusions>\
+      </dependency>\
+      <dependency>\
+        <groupId>org.apache.hbase</groupId>\
+        <artifactId>hbase-protocol</artifactId>\
+        <version>$\{hbase.version\}</version>\
+      </dependency>\
+      <dependency>\
+        <groupId>org.apache.hbase</groupId>\
+        <artifactId>hbase-common</artifactId>\
+        <version>$\{hbase.version\}</version>\
+      </dependency>\
+      <dependency>\
+        <groupId>org.apache.hbase</groupId>\
+        <artifactId>hbase-client</artifactId>\
+        <version>$\{hbase.version\}</version>\
+        <exclusions>\
+         <exclusion>\
+          <groupId>io.netty</groupId>\
+          <artifactId>netty</artifactId>\
+         </exclusion>\
+       </exclusions>\
+      </dependency>\
+      <dependency>\
+        <groupId>org.apache.hbase</groupId>\
+        <artifactId>hbase-server</artifactId>\
+        <version>$\{hbase.version\}</version>\
+        <exclusions>\
+          <exclusion>\
+            <groupId>org.apache.hadoop</groupId>\
+            <artifactId>hadoop-core</artifactId>\
+          </exclusion>\
+          <exclusion>\
+            <groupId>org.apache.hadoop</groupId>\
+            <artifactId>hadoop-client</artifactId>\
+          </exclusion>\
+          <exclusion>\
+            <groupId>org.apache.hadoop</groupId>\
+            <artifactId>hadoop-mapreduce-client-jobclient</artifactId>\
+          </exclusion>\
+          <exclusion>\
+            <groupId>org.apache.hadoop</groupId>\
+            <artifactId>hadoop-mapreduce-client-core</artifactId>\
+          </exclusion>\
+          <exclusion>\
+            <groupId>org.apache.hadoop</groupId>\
+            <artifactId>hadoop-auth</artifactId>\
+          </exclusion>\
+          <exclusion>\
+            <groupId>org.apache.hadoop</groupId>\
+            <artifactId>hadoop-annotations</artifactId>\
+          </exclusion>\
+          <exclusion>\
+            <groupId>org.apache.hadoop</groupId>\
+            <artifactId>hadoop-hdfs</artifactId>\
+          </exclusion>\
+          <exclusion>\
+            <groupId>org.apache.hbase</groupId>\
+            <artifactId>hbase-hadoop1-compat</artifactId>\
+          </exclusion>\
+          <exclusion>\
+            <groupId>org.apache.commons</groupId>\
+            <artifactId>commons-math</artifactId>\
+          </exclusion>\
+          <exclusion>\
+            <groupId>com.sun.jersey</groupId>\
+            <artifactId>jersey-core</artifactId>\
+          </exclusion>\
+          <exclusion>\
+            <groupId>org.slf4j</groupId>\
+            <artifactId>slf4j-api</artifactId>\
+          </exclusion>\
+          <exclusion>\
+            <groupId>com.sun.jersey</groupId>\
+            <artifactId>jersey-server</artifactId>\
+          </exclusion>\
+          <exclusion>\
+            <groupId>com.sun.jersey</groupId>\
+            <artifactId>jersey-core</artifactId>\
+          </exclusion>\
+          <exclusion>\
+            <groupId>com.sun.jersey</groupId>\
+            <artifactId>jersey-json</artifactId>\
+          </exclusion>\
+          <exclusion>\
+            <!-- hbase uses v2.4, which is better, but ...-->\
+            <groupId>commons-io</groupId>\
+            <artifactId>commons-io</artifactId>\
+          </exclusion>\
+        </exclusions>\
+      </dependency>\
+      <dependency>\
+        <groupId>org.apache.hbase</groupId>\
+        <artifactId>hbase-hadoop-compat</artifactId>\
+        <version>$\{hbase.version\}</version>\
+      </dependency>\
+      <dependency>\
+        <groupId>org.apache.hbase</groupId>\
+        <artifactId>hbase-hadoop-compat</artifactId>\
+        <version>$\{hbase.version\}</version>\
+        <type>test-jar</type>\
+        <scope>test</scope>\
+      </dependency>\
     <dependency>\
       <groupId>com.twitter</groupId>\
       <artifactId>algebird-core_$\{scala.binary.version\}</artifactId>\
}


Please advise.
Regards
Arthur



On 14 Sep, 2014, at 10:48 pm, Ted Yu <yuzhih...@gmail.com> wrote:

Spark examples builds against hbase 0.94 by default.

If you want to run against 0.98, see:

Cheers

On Sun, Sep 14, 2014 at 7:36 AM, arthur.hk.c...@gmail.com <arthur.hk.c...@gmail.com> wrote:
Hi, 

I have tried to to run HBaseTest.scala, but I  got following errors, any ideas to how to fix them?

Q1) 
scala> package org.apache.spark.examples
<console>:1: error: illegal start of definition
       package org.apache.spark.examples


Q2) 
scala> import org.apache.hadoop.hbase.mapreduce.TableInputFormat
<console>:31: error: object hbase is not a member of package org.apache.hadoop
       import org.apache.hadoop.hbase.mapreduce.TableInputFormat



Regards
Arthur


Reply via email to