Skip to content

Commit aca3f28

Browse files
author
Harish Butani
committed
for testing don't connect to hive thriftserver
use Mysql based metastore connection
1 parent a4e9df8 commit aca3f28

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

windowing/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
208208
<artifactId>commons-io</artifactId>
209209
<version>2.3</version>
210210
</dependency>
211+
<dependency>
212+
<groupId>mysql</groupId>
213+
<artifactId>mysql-connector-java</artifactId>
214+
<version>5.1.21</version>
215+
</dependency>
211216
</dependencies>
212217
<repositories>
213218
<repository>

windowing/src/test/java/com/sap/hadoop/windowing/testutils/BaseTest.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import com.sap.hadoop.windowing.query2.translate.Translator;
2222
import com.sap.hadoop.windowing.runtime2.LocalExecutor;
2323
import com.sap.hadoop.windowing.runtime2.QueryOutputPrinter;
24-
import com.sap.hadoop.windowing.runtime2.ThriftBasedHiveQueryExecutor;
24+
//import com.sap.hadoop.windowing.runtime2.ThriftBasedHiveQueryExecutor;
2525
import com.sap.hadoop.windowing.runtime2.WindowingShell;
2626

2727
public abstract class BaseTest extends ClusterMapReduceDelegate
@@ -69,7 +69,7 @@ public static void setupClass() throws Exception
6969

7070
HiveConf hCfg = new HiveConf(conf, conf.getClass());
7171
wshell = new WindowingShell(hCfg, new Translator(), new LocalExecutor(new PrintStream(outStream)));
72-
wshell.setHiveQryExec(new ThriftBasedHiveQueryExecutor(conf));
72+
//wshell.setHiveQryExec(new ThriftBasedHiveQueryExecutor(conf));
7373
outPrinter = null;
7474
}
7575

@@ -113,9 +113,15 @@ fs, new Path("/user/hive/warehouse/test.db/"),
113113

114114
public static void LOCAL(Configuration conf)
115115
{
116-
conf.set("hive.metastore.uris", "thrift://localhost:9083");
117-
conf.set(Constants.HIVE_THRIFTSERVER, "localhost");
118-
conf.setInt(Constants.HIVE_THRIFTSERVER_PORT, 10000);
116+
conf.set("javax.jdo.option.ConnectionURL",
117+
"jdbc:mysql://localhost/hivems?createDatabaseIfNotExist=true");
118+
conf.set("javax.jdo.option.ConnectionDriverName", "com.mysql.jdbc.Driver");
119+
conf.set("javax.jdo.option.ConnectionUserName", "hiveuser");
120+
conf.set("javax.jdo.option.ConnectionPassword", "hive");
121+
conf.set("hive.metastore.local", "true");
122+
123+
//conf.set(Constants.HIVE_THRIFTSERVER, "localhost");
124+
//conf.setInt(Constants.HIVE_THRIFTSERVER_PORT, 10000);
119125
conf.set("io.sort.mb", "200");
120126
conf.set("mapred.compress.map.output", "true");
121127
conf.set("mapred.child.java.opts", "-Xms128m -Xmx512m");

windowing/src/test/java/com/sap/hadoop/windowing/testutils/MRBaseTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import com.sap.hadoop.windowing.query2.definition.QueryDef;
1717
import com.sap.hadoop.windowing.query2.translate.Translator;
1818
import com.sap.hadoop.windowing.runtime2.QueryOutputPrinter;
19-
import com.sap.hadoop.windowing.runtime2.ThriftBasedHiveQueryExecutor;
19+
//import com.sap.hadoop.windowing.runtime2.ThriftBasedHiveQueryExecutor;
2020
import com.sap.hadoop.windowing.runtime2.WindowingShell;
2121
import com.sap.hadoop.windowing.runtime2.mr.MRExecutor;
2222

@@ -29,7 +29,7 @@ public static void setupClass() throws Exception
2929

3030
HiveConf hCfg = new HiveConf(conf, conf.getClass());
3131
wshell = new WindowingShell(hCfg, new Translator(), new MRExecutor());
32-
wshell.setHiveQryExec(new ThriftBasedHiveQueryExecutor(conf));
32+
//wshell.setHiveQryExec(new ThriftBasedHiveQueryExecutor(conf));
3333
outPrinter = new QueryOutputPrinter(new TestLogHelper(false));
3434
}
3535

0 commit comments

Comments
 (0)