You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2012/12/07 17:37:13 UTC
svn commit: r1418384 - in /hive/branches/branch-0.9: ./
jdbc/src/java/org/apache/hadoop/hive/jdbc/ metastore/ pdk/scripts/
Author: hashutosh
Date: Fri Dec 7 16:37:09 2012
New Revision: 1418384
URL: http://svn.apache.org/viewvc?rev=1418384&view=rev
Log:
HIVE-3384 : HIVE JDBC module won't compile under JDK1.7 as new methods added in JDBC specification (Shengsheng Huang, Chris Drome, Mikhail Bautin via Ashutosh Chauhan)
Modified:
hive/branches/branch-0.9/build-common.xml
hive/branches/branch-0.9/build.properties
hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveBaseResultSet.java
hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveCallableStatement.java
hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveConnection.java
hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDataSource.java
hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDatabaseMetaData.java
hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDriver.java
hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HivePreparedStatement.java
hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveQueryResultSet.java
hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveStatement.java
hive/branches/branch-0.9/metastore/build.xml
hive/branches/branch-0.9/pdk/scripts/build-plugin.xml
Modified: hive/branches/branch-0.9/build-common.xml
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/build-common.xml?rev=1418384&r1=1418383&r2=1418384&view=diff
==============================================================================
--- hive/branches/branch-0.9/build-common.xml (original)
+++ hive/branches/branch-0.9/build-common.xml Fri Dec 7 16:37:09 2012
@@ -68,7 +68,7 @@
<property name="hadoop.opts.23" value="-D mapreduce.framework.name=local" />
<property name="hadoop.opts.20" value="" />
-
+
<path id="test.classpath">
<pathelement location="${test.build.classes}" />
<pathelement location="${test.build.resources}" />
@@ -185,7 +185,7 @@
<fileset dir="${build.dir.hive}" includes="*/*.jar"/>
<fileset dir="${hive.root}/lib" includes="*.jar"/>
<fileset dir="${build.ivy.lib.dir}/hadoop0.${hadoop.mr.rev}.shim" includes="*.jar" erroronmissingdir="false" />
- <fileset dir="${build.ivy.lib.dir}/default" includes="*.jar"
+ <fileset dir="${build.ivy.lib.dir}/default" includes="*.jar"
excludes="**/hadoop-*.jar"
erroronmissingdir="false"/>
</path>
@@ -395,7 +395,7 @@
</if>
<if>
<equals arg1="${test.print.classpath}" arg2="true" />
- <then>
+ <then>
<echo message="Test Classpath: ${hadoop.testcp}"/>
</then>
</if>
@@ -429,6 +429,7 @@
<sysproperty key="derby.version" value="${derby.version}"/>
<sysproperty key="hive.version" value="${version}"/>
<sysproperty key="hadoop.bin.path" value="${test.hadoop.bin.path}"/>
+ <jvmarg line="${jvm.args}"/>
<classpath refid="test.local.classpath"/>
<formatter type="${test.junit.output.format}" usefile="${test.junit.output.usefile}" />
Modified: hive/branches/branch-0.9/build.properties
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/build.properties?rev=1418384&r1=1418383&r2=1418384&view=diff
==============================================================================
--- hive/branches/branch-0.9/build.properties (original)
+++ hive/branches/branch-0.9/build.properties Fri Dec 7 16:37:09 2012
@@ -94,9 +94,11 @@ mvn.jar.dir=${build.dir.hive}/maven/jars
mvn.pom.dir=${build.dir.hive}/maven/poms
mvn.license.dir=${build.dir.hive}/maven/licenses
-
#
# Data nucleus repository - needed for jdo2-api-2.3-ec.jar download
#
datanucleus.repo=http://www.datanucleus.org/downloads/maven2
+# JVM arguments
+jvm.args=-XX:-UseSplitVerifier
+
Modified: hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveBaseResultSet.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveBaseResultSet.java?rev=1418384&r1=1418383&r2=1418384&view=diff
==============================================================================
--- hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveBaseResultSet.java (original)
+++ hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveBaseResultSet.java Fri Dec 7 16:37:09 2012
@@ -370,6 +370,16 @@ public abstract class HiveBaseResultSet
return getObject(findColumn(columnName));
}
+ public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
+ // TODO method required by JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
+ public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
+ // TODO method required by JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
public Object getObject(int i, Map<String, Class<?>> map) throws SQLException {
throw new SQLException("Method not supported");
}
Modified: hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveCallableStatement.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveCallableStatement.java?rev=1418384&r1=1418383&r2=1418384&view=diff
==============================================================================
--- hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveCallableStatement.java (original)
+++ hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveCallableStatement.java Fri Dec 7 16:37:09 2012
@@ -462,6 +462,17 @@ public class HiveCallableStatement imple
throw new SQLException("Method not supported");
}
+ public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException {
+ // TODO JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
+ public <T> T getObject(String parameterName, Class<T> type) throws SQLException {
+ // TODO JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
+
/*
* (non-Javadoc)
*
@@ -2031,6 +2042,16 @@ public class HiveCallableStatement imple
throw new SQLException("Method not supported");
}
+ public void closeOnCompletion() throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
+ public boolean isCloseOnCompletion() throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
/*
* (non-Javadoc)
*
Modified: hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveConnection.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveConnection.java?rev=1418384&r1=1418383&r2=1418384&view=diff
==============================================================================
--- hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveConnection.java (original)
+++ hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveConnection.java Fri Dec 7 16:37:09 2012
@@ -29,6 +29,7 @@ import org.apache.thrift.protocol.TProto
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;
+import java.util.concurrent.Executor;
import java.sql.Array;
import java.sql.Blob;
@@ -120,6 +121,12 @@ public class HiveConnection implements j
isClosed = false;
configureConnection();
}
+
+
+ public void abort(Executor executor) throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
private void configureConnection() throws SQLException {
Statement stmt = createStatement();
@@ -340,6 +347,17 @@ public class HiveConnection implements j
return new HiveDatabaseMetaData(client);
}
+
+ public int getNetworkTimeout() throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
+
+ public String getSchema() throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
/*
* (non-Javadoc)
*
@@ -607,6 +625,11 @@ public class HiveConnection implements j
throw new SQLException("Method not supported");
}
+ public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
/*
* (non-Javadoc)
*
@@ -640,6 +663,11 @@ public class HiveConnection implements j
throw new SQLException("Method not supported");
}
+ public void setSchema(String schema) throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
/*
* (non-Javadoc)
*
@@ -673,15 +701,9 @@ public class HiveConnection implements j
throw new SQLException("Method not supported");
}
- /*
- * (non-Javadoc)
- *
- * @see java.sql.Wrapper#unwrap(java.lang.Class)
- */
-
public <T> T unwrap(Class<T> iface) throws SQLException {
// TODO Auto-generated method stub
throw new SQLException("Method not supported");
}
-
}
+
Modified: hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDataSource.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDataSource.java?rev=1418384&r1=1418383&r2=1418384&view=diff
==============================================================================
--- hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDataSource.java (original)
+++ hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDataSource.java Fri Dec 7 16:37:09 2012
@@ -21,6 +21,8 @@ package org.apache.hadoop.hive.jdbc;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.util.logging.Logger;
import javax.sql.DataSource;
@@ -90,6 +92,12 @@ public class HiveDataSource implements D
* @see javax.sql.CommonDataSource#setLogWriter(java.io.PrintWriter)
*/
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ // JDK 1.7
+ throw new SQLFeatureNotSupportedException("Method not supported");
+ }
+
+
public void setLogWriter(PrintWriter arg0) throws SQLException {
// TODO Auto-generated method stub
throw new SQLException("Method not supported");
@@ -129,3 +137,4 @@ public class HiveDataSource implements D
}
}
+
Modified: hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDatabaseMetaData.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDatabaseMetaData.java?rev=1418384&r1=1418383&r2=1418384&view=diff
==============================================================================
--- hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDatabaseMetaData.java (original)
+++ hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDatabaseMetaData.java Fri Dec 7 16:37:09 2012
@@ -124,6 +124,18 @@ public class HiveDatabaseMetaData implem
return false;
}
}
+
+ public <T> T getObject(String columnLabel, Class<T> type)
+ throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
+ public <T> T getObject(int columnIndex, Class<T> type)
+ throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
};
} catch (Exception e) {
throw new SQLException(e);
@@ -139,6 +151,17 @@ public class HiveDatabaseMetaData implem
throw new SQLException("Method not supported");
}
+ public ResultSet getPseudoColumns(String catalog, String schemaPattern,
+ String tableNamePattern, String columnNamePattern) throws SQLException {
+ throw new SQLException("Method not supported");
+ }
+
+ public boolean generatedKeyAlwaysReturned() throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
+
/**
* Convert a pattern containing JDBC catalog search wildcards into
* Java regex patterns.
@@ -256,6 +279,18 @@ public class HiveDatabaseMetaData implem
return false;
}
}
+
+ public <T> T getObject(String columnLabel, Class<T> type)
+ throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
+ public <T> T getObject(int columnIndex, Class<T> type)
+ throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
};
} catch (Exception e) {
throw new SQLException(e);
@@ -514,6 +549,18 @@ public class HiveDatabaseMetaData implem
public boolean next() throws SQLException {
return false;
}
+
+ public <T> T getObject(String columnLabel, Class<T> type)
+ throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
+ public <T> T getObject(int columnIndex, Class<T> type)
+ throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
};
}
@@ -563,6 +610,18 @@ public class HiveDatabaseMetaData implem
return false;
}
}
+
+ public <T> T getObject(String columnLabel, Class<T> type)
+ throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
+ public <T> T getObject(int columnIndex, Class<T> type)
+ throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
};
return result;
}
@@ -630,6 +689,18 @@ public class HiveDatabaseMetaData implem
}
}
+ public <T> T getObject(String columnLabel, Class<T> type)
+ throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
+ public <T> T getObject(int columnIndex, Class<T> type)
+ throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
};
return result;
}
@@ -689,6 +760,18 @@ public class HiveDatabaseMetaData implem
public boolean next() throws SQLException {
return false;
}
+
+ public <T> T getObject(String columnLabel, Class<T> type)
+ throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
+ public <T> T getObject(int columnIndex, Class<T> type)
+ throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
};
}
@@ -1086,4 +1169,6 @@ public class HiveDatabaseMetaData implem
System.out.println("DriverName: " + meta.getDriverName());
System.out.println("DriverVersion: " + meta.getDriverVersion());
}
+
}
+
Modified: hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDriver.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDriver.java?rev=1418384&r1=1418383&r2=1418384&view=diff
==============================================================================
--- hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDriver.java (original)
+++ hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDriver.java Fri Dec 7 16:37:09 2012
@@ -24,9 +24,11 @@ import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverPropertyInfo;
import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
import java.util.Properties;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
+import java.util.logging.Logger;
import java.util.regex.Pattern;
/**
@@ -166,6 +168,11 @@ public class HiveDriver implements Drive
return HiveDriver.getMinorDriverVersion();
}
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ // JDK 1.7
+ throw new SQLFeatureNotSupportedException("Method not supported");
+ }
+
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
if (info == null) {
info = new Properties();
@@ -294,4 +301,6 @@ public class HiveDriver implements Drive
}
return manifestAttributes.getValue(attributeName);
}
+
}
+
Modified: hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HivePreparedStatement.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HivePreparedStatement.java?rev=1418384&r1=1418383&r2=1418384&view=diff
==============================================================================
--- hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HivePreparedStatement.java (original)
+++ hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HivePreparedStatement.java Fri Dec 7 16:37:09 2012
@@ -844,6 +844,12 @@ public class HivePreparedStatement imple
warningChain=null;
}
+
+ public void closeOnCompletion() throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
/**
* Closes the prepared statement.
*
@@ -1140,6 +1146,11 @@ public class HivePreparedStatement imple
return isClosed;
}
+ public boolean isCloseOnCompletion() throws SQLException {
+ //JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
/*
* (non-Javadoc)
*
Modified: hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveQueryResultSet.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveQueryResultSet.java?rev=1418384&r1=1418383&r2=1418384&view=diff
==============================================================================
--- hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveQueryResultSet.java (original)
+++ hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveQueryResultSet.java Fri Dec 7 16:37:09 2012
@@ -190,6 +190,16 @@ public class HiveQueryResultSet extends
return fetchSize;
}
+ public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
+ //JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
+ public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
+ //JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
/**
* Convert a LazyObject to a standard Java object in compliance with JDBC 3.0 (see JDBC 3.0
* Specification, Table B-3: Mapping from JDBC Types to Java Object Types).
@@ -207,4 +217,6 @@ public class HiveQueryResultSet extends
return obj;
}
+
}
+
Modified: hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveStatement.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveStatement.java?rev=1418384&r1=1418383&r2=1418384&view=diff
==============================================================================
--- hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveStatement.java (original)
+++ hive/branches/branch-0.9/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveStatement.java Fri Dec 7 16:37:09 2012
@@ -117,6 +117,11 @@ public class HiveStatement implements ja
isClosed = true;
}
+ public void closeOnCompletion() throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
/*
* (non-Javadoc)
*
@@ -400,6 +405,11 @@ public class HiveStatement implements ja
return isClosed;
}
+ public boolean isCloseOnCompletion() throws SQLException {
+ // JDK 1.7
+ throw new SQLException("Method not supported");
+ }
+
/*
* (non-Javadoc)
*
Modified: hive/branches/branch-0.9/metastore/build.xml
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/metastore/build.xml?rev=1418384&r1=1418383&r2=1418384&view=diff
==============================================================================
--- hive/branches/branch-0.9/metastore/build.xml (original)
+++ hive/branches/branch-0.9/metastore/build.xml Fri Dec 7 16:37:09 2012
@@ -103,7 +103,7 @@
<path refid="classpath"/>
<pathelement path="${build.dir}/classes/"/>
</classpath>
- <jvmarg line="-Dlog4j.configuration=${basedir}/../conf/hive-log4j.properties"/>
+ <jvmarg line="${jvm.args} -Dlog4j.configuration=${basedir}/../conf/hive-log4j.properties"/>
</datanucleusenhancer>
</target>
Modified: hive/branches/branch-0.9/pdk/scripts/build-plugin.xml
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/pdk/scripts/build-plugin.xml?rev=1418384&r1=1418383&r2=1418384&view=diff
==============================================================================
--- hive/branches/branch-0.9/pdk/scripts/build-plugin.xml (original)
+++ hive/branches/branch-0.9/pdk/scripts/build-plugin.xml Fri Dec 7 16:37:09 2012
@@ -26,11 +26,19 @@
<property name="build.metadata" location="${build.dir}/metadata"/>
<property name="install.dir" location="${pdk.script.dir}/../.."/>
<property name="function.sql.prefix" value=""/>
- <property name="plugin.jar.basename"
+ <property name="plugin.jar.basename"
value="${plugin.libname}-${plugin.version}.jar"/>
<property environment="env"/>
<property name="hadoop.home" value="${env.HADOOP_HOME}"/>
+ <if>
+ <not>
+ <isset property="jvm.args"/>
+ </not>
+ <then>
+ <property name="jvm.args" value="-XX:-UseSplitVerifier"/>
+ </then>
+ </if>
<path id="plugin.classpath">
<fileset dir="${build.ivy.lib.dir}/default" includes="hive-exec-*.jar"/>
@@ -98,7 +106,7 @@
<target name="extract-functions" depends="compile, get-class-list">
<mkdir dir="${build.metadata}"/>
- <java classname="org.apache.hive.pdk.FunctionExtractor"
+ <java classname="org.apache.hive.pdk.FunctionExtractor"
classpathref="plugin.classpath" fork="true"
output="${build.metadata}/class-info.xml">
<arg line="${class.list}" />
@@ -141,6 +149,7 @@
<assertions>
<enable />
</assertions>
+ <jvmarg line="${jvm.args}"/>
</junit>
</target>