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/05 00:17:45 UTC
svn commit: r1417235 - in /hive/trunk: ./
jdbc/src/java/org/apache/hadoop/hive/jdbc/ metastore/ pdk/scripts/
Author: hashutosh
Date: Tue Dec 4 23:17:43 2012
New Revision: 1417235
URL: http://svn.apache.org/viewvc?rev=1417235&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/trunk/build-common.xml
hive/trunk/build.properties
hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveBaseResultSet.java
hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveCallableStatement.java
hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveConnection.java
hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDataSource.java
hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDatabaseMetaData.java
hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDriver.java
hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HivePreparedStatement.java
hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveQueryResultSet.java
hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveStatement.java
hive/trunk/metastore/build.xml
hive/trunk/pdk/scripts/build-plugin.xml
Modified: hive/trunk/build-common.xml
URL: http://svn.apache.org/viewvc/hive/trunk/build-common.xml?rev=1417235&r1=1417234&r2=1417235&view=diff
==============================================================================
--- hive/trunk/build-common.xml (original)
+++ hive/trunk/build-common.xml Tue Dec 4 23:17:43 2012
@@ -437,6 +437,7 @@
<sysproperty key="hive.version" value="${version}"/>
<sysproperty key="java.net.preferIPv4Stack" value="${java.net.preferIPv4Stack}"/>
<sysproperty key="hadoop.bin.path" value="${test.hadoop.bin.path}${junit.script.extension}"/>
+ <jvmarg line="${jvm.args}"/>
<classpath refid="test.local.classpath"/>
<formatter type="${test.junit.output.format}" usefile="${test.junit.output.usefile}" />
Modified: hive/trunk/build.properties
URL: http://svn.apache.org/viewvc/hive/trunk/build.properties?rev=1417235&r1=1417234&r2=1417235&view=diff
==============================================================================
--- hive/trunk/build.properties (original)
+++ hive/trunk/build.properties Tue Dec 4 23:17:43 2012
@@ -110,7 +110,6 @@ mvn.pom.dir=${build.dir.hive}/maven/poms
mvn.license.dir=${build.dir.hive}/maven/licenses
mvn.deploy.id=apache.snapshots.https
mvn.deploy.url=https://repository.apache.org/content/repositories/snapshots
-
#
# unit test Properties
#
@@ -121,9 +120,13 @@ failonerror=false
#
datanucleus.repo=http://www.datanucleus.org/downloads/maven2
+# JVM arguments
+jvm.args=-XX:-UseSplitVerifier
+
#
# Eclipse Properties
#
# JVM arguments for Eclipse launch configurations
-eclipse.launch.jvm.args=-Xms256m -Xmx1024m
+eclipse.launch.jvm.args=-Xms256m -Xmx1024m ${jvm.args}
+
Modified: hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveBaseResultSet.java
URL: http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveBaseResultSet.java?rev=1417235&r1=1417234&r2=1417235&view=diff
==============================================================================
--- hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveBaseResultSet.java (original)
+++ hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveBaseResultSet.java Tue Dec 4 23:17:43 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/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveCallableStatement.java
URL: http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveCallableStatement.java?rev=1417235&r1=1417234&r2=1417235&view=diff
==============================================================================
--- hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveCallableStatement.java (original)
+++ hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveCallableStatement.java Tue Dec 4 23:17:43 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/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveConnection.java
URL: http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveConnection.java?rev=1417235&r1=1417234&r2=1417235&view=diff
==============================================================================
--- hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveConnection.java (original)
+++ hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveConnection.java Tue Dec 4 23:17:43 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/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDataSource.java
URL: http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDataSource.java?rev=1417235&r1=1417234&r2=1417235&view=diff
==============================================================================
--- hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDataSource.java (original)
+++ hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDataSource.java Tue Dec 4 23:17:43 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/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDatabaseMetaData.java
URL: http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDatabaseMetaData.java?rev=1417235&r1=1417234&r2=1417235&view=diff
==============================================================================
--- hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDatabaseMetaData.java (original)
+++ hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDatabaseMetaData.java Tue Dec 4 23:17:43 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/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDriver.java
URL: http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDriver.java?rev=1417235&r1=1417234&r2=1417235&view=diff
==============================================================================
--- hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDriver.java (original)
+++ hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveDriver.java Tue Dec 4 23:17:43 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/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HivePreparedStatement.java
URL: http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HivePreparedStatement.java?rev=1417235&r1=1417234&r2=1417235&view=diff
==============================================================================
--- hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HivePreparedStatement.java (original)
+++ hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HivePreparedStatement.java Tue Dec 4 23:17:43 2012
@@ -843,6 +843,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.
*
@@ -1139,6 +1145,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/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveQueryResultSet.java
URL: http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveQueryResultSet.java?rev=1417235&r1=1417234&r2=1417235&view=diff
==============================================================================
--- hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveQueryResultSet.java (original)
+++ hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveQueryResultSet.java Tue Dec 4 23:17:43 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/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveStatement.java
URL: http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveStatement.java?rev=1417235&r1=1417234&r2=1417235&view=diff
==============================================================================
--- hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveStatement.java (original)
+++ hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveStatement.java Tue Dec 4 23:17:43 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/trunk/metastore/build.xml
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/build.xml?rev=1417235&r1=1417234&r2=1417235&view=diff
==============================================================================
--- hive/trunk/metastore/build.xml (original)
+++ hive/trunk/metastore/build.xml Tue Dec 4 23:17:43 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/trunk/pdk/scripts/build-plugin.xml
URL: http://svn.apache.org/viewvc/hive/trunk/pdk/scripts/build-plugin.xml?rev=1417235&r1=1417234&r2=1417235&view=diff
==============================================================================
--- hive/trunk/pdk/scripts/build-plugin.xml (original)
+++ hive/trunk/pdk/scripts/build-plugin.xml Tue Dec 4 23:17:43 2012
@@ -27,11 +27,19 @@
<property name="install.dir" location="${pdk.script.dir}/../.."/>
<property name="pdk.test.conf.dir" location="${pdk.script.dir}/conf"/>
<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"/>
@@ -99,7 +107,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}" />
@@ -144,6 +152,7 @@
<assertions>
<enable />
</assertions>
+ <jvmarg line="${jvm.args}"/>
</junit>
</target>