You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by cw...@apache.org on 2011/04/05 20:06:58 UTC
svn commit: r1089147 - in
/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc: HiveConnection.java
HivePreparedStatement.java HiveStatement.java JdbcSessionState.java
Author: cws
Date: Tue Apr 5 18:06:58 2011
New Revision: 1089147
URL: http://svn.apache.org/viewvc?rev=1089147&view=rev
Log:
HIVE-2054. Exception on windows when using the jdbc driver. 'IOException: The system cannot find the path specified' (Bennie Schut via cws)
Modified:
hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveConnection.java
hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HivePreparedStatement.java
hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveStatement.java
hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/JdbcSessionState.java
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=1089147&r1=1089146&r2=1089147&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 Apr 5 18:06:58 2011
@@ -18,9 +18,7 @@
package org.apache.hadoop.hive.jdbc;
-import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.metastore.api.MetaException;
-import org.apache.hadoop.hive.ql.session.SessionState;
import org.apache.hadoop.hive.service.HiveClient;
import org.apache.hadoop.hive.service.HiveInterface;
import org.apache.hadoop.hive.service.HiveServer;
@@ -53,7 +51,6 @@ import java.util.Properties;
*
*/
public class HiveConnection implements java.sql.Connection {
- private final JdbcSessionState session;
private TTransport transport;
private HiveInterface client;
private boolean isClosed = true;
@@ -65,12 +62,6 @@ public class HiveConnection implements j
* TODO: - parse uri (use java.net.URI?).
*/
public HiveConnection(String uri, Properties info) throws SQLException {
- session = new JdbcSessionState(new HiveConf(SessionState.class));
- session.in = null;
- session.out = null;
- session.err = null;
- SessionState.start(session);
-
if (!uri.startsWith(URI_PREFIX)) {
throw new SQLException("Invalid URL: " + uri, "08S01");
}
@@ -223,7 +214,7 @@ public class HiveConnection implements j
if (isClosed) {
throw new SQLException("Can't create Statement, connection is closed");
}
- return new HiveStatement(session, client);
+ return new HiveStatement(client);
}
/*
@@ -440,7 +431,7 @@ public class HiveConnection implements j
*/
public PreparedStatement prepareStatement(String sql) throws SQLException {
- return new HivePreparedStatement(session, client, sql);
+ return new HivePreparedStatement(client, sql);
}
/*
@@ -451,7 +442,7 @@ public class HiveConnection implements j
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
throws SQLException {
- return new HivePreparedStatement(session, client, sql);
+ return new HivePreparedStatement(client, sql);
}
/*
@@ -487,7 +478,7 @@ public class HiveConnection implements j
public PreparedStatement prepareStatement(String sql, int resultSetType,
int resultSetConcurrency) throws SQLException {
- return new HivePreparedStatement(session, client, sql);
+ return new HivePreparedStatement(client, sql);
}
/*
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=1089147&r1=1089146&r2=1089147&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 Apr 5 18:06:58 2011
@@ -50,7 +50,6 @@ import org.apache.hadoop.hive.service.Hi
*/
public class HivePreparedStatement implements PreparedStatement {
private String sql;
- private JdbcSessionState session;
private HiveInterface client;
/**
* We need to keep a reference to the result set to support the following:
@@ -78,9 +77,8 @@ public class HivePreparedStatement imple
/**
*
*/
- public HivePreparedStatement(JdbcSessionState session, HiveInterface client,
+ public HivePreparedStatement(HiveInterface client,
String sql) {
- this.session = session;
this.client = client;
this.sql = sql;
}
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=1089147&r1=1089146&r2=1089147&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 Apr 5 18:06:58 2011
@@ -31,7 +31,6 @@ import org.apache.hadoop.hive.service.Hi
*
*/
public class HiveStatement implements java.sql.Statement {
- private JdbcSessionState session;
private HiveInterface client;
private int fetchSize = 50;
@@ -62,8 +61,7 @@ public class HiveStatement implements ja
/**
*
*/
- public HiveStatement(JdbcSessionState session, HiveInterface client) {
- this.session = session;
+ public HiveStatement(HiveInterface client) {
this.client = client;
}
Modified: hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/JdbcSessionState.java
URL: http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/JdbcSessionState.java?rev=1089147&r1=1089146&r2=1089147&view=diff
==============================================================================
--- hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/JdbcSessionState.java (original)
+++ hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/JdbcSessionState.java Tue Apr 5 18:06:58 2011
@@ -1,37 +0,0 @@
-/**
- * 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.
- */
-
-package org.apache.hadoop.hive.jdbc;
-
-import org.apache.hadoop.hive.conf.HiveConf;
-import org.apache.hadoop.hive.ql.session.SessionState;
-
-/**
- * JdbcSessionState.
- *
- */
-public class JdbcSessionState extends SessionState {
-
- public JdbcSessionState() {
- super();
- }
-
- public JdbcSessionState(HiveConf conf) {
- super(conf);
- }
-}