ihuzenko commented on a change in pull request #1559: DRILL-540: Allow querying 
hive views in Drill
URL: https://github.com/apache/drill/pull/1559#discussion_r242475463
 
 

 ##########
 File path: 
contrib/storage-hive/core/src/test/java/org/apache/drill/exec/impersonation/hive/BaseTestHiveImpersonation.java
 ##########
 @@ -41,42 +44,62 @@
   protected static final String hivePluginName = "hive";
 
   protected static HiveConf hiveConf;
+
   protected static String whDir;
 
   protected static String studentData;
+
   protected static String voterData;
 
   protected static final String studentDef = "CREATE TABLE %s.%s" +
       "(rownum int, name string, age int, gpa float, studentnum bigint) " +
       "ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS TEXTFILE";
+
   protected static final String voterDef = "CREATE TABLE %s.%s" +
       "(voter_id int,name varchar(30), age tinyint, registration string, " +
       "contributions double,voterzone smallint,create_time timestamp) " +
       "ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS TEXTFILE";
+
   protected static final String partitionStudentDef = "CREATE TABLE %s.%s" +
       "(rownum INT, name STRING, gpa FLOAT, studentnum BIGINT) " +
       "partitioned by (age INT) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' 
STORED AS TEXTFILE";
 
   protected static void prepHiveConfAndData() throws Exception {
     hiveConf = new HiveConf();
+    File rootDir = dirTestWatcher.getRootDir();
 
-    File scratchDir = createFileWithPermissions(dirTestWatcher.getRootDir(), 
"scratch_dir");
-    File localScratchDir = 
createFileWithPermissions(dirTestWatcher.getRootDir(), "local_scratch_dir");
-    File metaStoreDBDir = new File(dirTestWatcher.getRootDir(), 
"metastore_db");
 
     // Configure metastore persistence db location on local filesystem
-    final String dbUrl = 
String.format("jdbc:derby:;databaseName=%s;create=true",  
metaStoreDBDir.getAbsolutePath());
+    final String dbUrl = 
String.format("jdbc:derby:;databaseName=%s;create=true",
+        new File(rootDir, "metastore_db").getAbsolutePath());
+
     hiveConf.set(ConfVars.METASTORECONNECTURLKEY.varname, dbUrl);
 
-    hiveConf.set(ConfVars.SCRATCHDIR.varname, "file://" + 
scratchDir.getAbsolutePath());
-    hiveConf.set(ConfVars.LOCALSCRATCHDIR.varname, 
localScratchDir.getAbsolutePath());
+    // HDFS root scratch dir for Hive jobs which gets created with write all 
(733) permission.
 
 Review comment:
   fixed

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to