You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by gu...@apache.org on 2014/01/01 23:47:43 UTC
svn commit: r1554693 - in /hive/branches/tez: ./
hbase-handler/src/java/org/apache/hadoop/hive/hbase/
hcatalog/src/test/e2e/templeton/tests/
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/
ql/src/java/org/apache/hadoop/hive/ql/ex...
Author: gunther
Date: Wed Jan 1 22:47:42 2014
New Revision: 1554693
URL: http://svn.apache.org/r1554693
Log:
Merge latest trunk into branch. (Gunther Hagleitner)
Modified:
hive/branches/tez/ (props changed)
hive/branches/tez/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HiveHBaseTableInputFormat.java
hive/branches/tez/hcatalog/src/test/e2e/templeton/tests/ddl.conf
hive/branches/tez/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java
hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java
hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/io/rcfile/merge/BlockMergeTask.java
hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/io/rcfile/merge/MergeWork.java
hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/io/rcfile/merge/RCFileMergeMapper.java
hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMRFileSink1.java
hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java
hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/AlterTablePartMergeFilesDesc.java
hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/FileSinkProcessor.java
hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/TaskCompiler.java
hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/plan/ConditionalResolverMergeFiles.java
hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadFileDesc.java
hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadMultiFilesDesc.java
hive/branches/tez/ql/src/test/results/compiler/plan/case_sensitivity.q.xml
hive/branches/tez/ql/src/test/results/compiler/plan/input1.q.xml
hive/branches/tez/ql/src/test/results/compiler/plan/input2.q.xml
hive/branches/tez/ql/src/test/results/compiler/plan/input3.q.xml
hive/branches/tez/ql/src/test/results/compiler/plan/input6.q.xml
hive/branches/tez/ql/src/test/results/compiler/plan/input7.q.xml
hive/branches/tez/ql/src/test/results/compiler/plan/input9.q.xml
hive/branches/tez/ql/src/test/results/compiler/plan/input_testsequencefile.q.xml
hive/branches/tez/ql/src/test/results/compiler/plan/sample2.q.xml
hive/branches/tez/ql/src/test/results/compiler/plan/sample3.q.xml
hive/branches/tez/ql/src/test/results/compiler/plan/sample4.q.xml
hive/branches/tez/ql/src/test/results/compiler/plan/sample5.q.xml
hive/branches/tez/ql/src/test/results/compiler/plan/sample6.q.xml
hive/branches/tez/ql/src/test/results/compiler/plan/sample7.q.xml
hive/branches/tez/ql/src/test/results/compiler/plan/subq.q.xml
hive/branches/tez/ql/src/test/results/compiler/plan/union.q.xml
hive/branches/tez/testutils/ptest2/pom.xml
hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/PTest.java
hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/conf/TestConfiguration.java
hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudComputeService.java
hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudExecutionContextProvider.java
hive/branches/tez/testutils/ptest2/src/main/resources/source-prep.vm
hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.java
hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepGit.approved.txt
hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepNone.approved.txt
hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepSvn.approved.txt
hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/context/TestCloudComputeService.java
Propchange: hive/branches/tez/
------------------------------------------------------------------------------
Merged /hive/trunk:r1553628-1554298
Modified: hive/branches/tez/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HiveHBaseTableInputFormat.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HiveHBaseTableInputFormat.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HiveHBaseTableInputFormat.java (original)
+++ hive/branches/tez/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HiveHBaseTableInputFormat.java Wed Jan 1 22:47:42 2014
@@ -177,6 +177,11 @@ public class HiveHBaseTableInputFormat e
final org.apache.hadoop.mapreduce.RecordReader<ImmutableBytesWritable, Result>
recordReader = createRecordReader(tableSplit, tac);
+ try {
+ recordReader.initialize(tableSplit, tac);
+ } catch (InterruptedException e) {
+ throw new IOException("Failed to initialize RecordReader", e);
+ }
return new RecordReader<ImmutableBytesWritable, ResultWritable>() {
Modified: hive/branches/tez/hcatalog/src/test/e2e/templeton/tests/ddl.conf
URL: http://svn.apache.org/viewvc/hive/branches/tez/hcatalog/src/test/e2e/templeton/tests/ddl.conf?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/hcatalog/src/test/e2e/templeton/tests/ddl.conf (original)
+++ hive/branches/tez/hcatalog/src/test/e2e/templeton/tests/ddl.conf Wed Jan 1 22:47:42 2014
@@ -392,8 +392,15 @@ $cfg =
'outputFormat' => "org.apache.hadoop.hive.ql.io.RCFileOutputFormat",
'partitioned' => "true",
'table' => "templetontest_tabe",
-
-
+ 'totalNumberFiles' => 0,
+ 'totalFileSize' => 0,
+ 'database' => "default",
+ 'retention' => 0,
+ 'parametersSize' => 5,
+ 'tableType' => "MANAGED_TABLE",
+ 'parameters' => 'comment.*This is the page view table.*prop1.*val1.*prop2.*val2.*SORTBUCKETCOLSPREFIX.*TRUE',
+ #since 'sd' filed has multiple levels and indeterminate field value, only check "field.delim" and "line.delim"
+ 'sd' => 'field.delim.*1.*line.delim.*n',
},
'json_field_match_object' =>
{'columns' => '[
Modified: hive/branches/tez/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java (original)
+++ hive/branches/tez/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java Wed Jan 1 22:47:42 2014
@@ -294,8 +294,8 @@ public class HcatDelegator extends Launc
}
/**
- * Return a json "show table extended like". This will return
- * only the first single table.
+ * Return a json "show table extended like" with extra info from "desc exteded"
+ * This will return table with exact name match.
*/
public Response descExtendedTable(String user, String db, String table)
throws HcatException, NotAuthorizedException, BusyException,
@@ -303,11 +303,23 @@ public class HcatDelegator extends Launc
String exec = String.format("use %s; show table extended like %s;",
db, table);
try {
+ //get detailed "tableInfo" from query "desc extended tablename;"
+ Response res0 = descTable(user, db, table, true);
+ if (res0.getStatus() != HttpStatus.OK_200)
+ return res0;
+ Map m = (Map) res0.getEntity();
+ Map tableInfo = (Map) m.get("tableInfo");
+
String res = jsonRun(user, exec);
JsonBuilder jb = JsonBuilder.create(singleTable(res, table))
.remove("tableName")
.put("database", db)
- .put("table", table);
+ .put("table", table)
+ .put("retention", tableInfo.get("retention"))
+ .put("sd", tableInfo.get("sd"))
+ .put("parameters", tableInfo.get("parameters"))
+ .put("parametersSize", tableInfo.get("parametersSize"))
+ .put("tableType", tableInfo.get("tableType"));
// If we can get them from HDFS, add group and permission
String loc = (String) jb.getMap().get("location");
Modified: hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java (original)
+++ hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java Wed Jan 1 22:47:42 2014
@@ -336,7 +336,7 @@ public class ExplainTask extends Task<Ex
private boolean isPrintable(Object val) {
if (val instanceof Boolean || val instanceof String
|| val instanceof Integer || val instanceof Long || val instanceof Byte
- || val instanceof Float || val instanceof Double) {
+ || val instanceof Float || val instanceof Double || val instanceof Path) {
return true;
}
Modified: hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java (original)
+++ hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java Wed Jan 1 22:47:42 2014
@@ -204,7 +204,7 @@ public class MoveTask extends Task<MoveW
// to appropriate locations
LoadFileDesc lfd = work.getLoadFileWork();
if (lfd != null) {
- Path targetPath = new Path(lfd.getTargetDir());
+ Path targetPath = lfd.getTargetDir();
Path sourcePath = new Path(lfd.getSourceDir());
moveFile(sourcePath, targetPath, lfd.getIsDfsDir());
}
@@ -217,7 +217,7 @@ public class MoveTask extends Task<MoveW
int i = 0;
while (i <lmfd.getSourceDirs().size()) {
Path srcPath = new Path(lmfd.getSourceDirs().get(i));
- Path destPath = new Path(lmfd.getTargetDirs().get(i));
+ Path destPath = lmfd.getTargetDirs().get(i);
FileSystem fs = destPath.getFileSystem(conf);
if (!fs.exists(destPath.getParent())) {
fs.mkdirs(destPath.getParent());
Modified: hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/io/rcfile/merge/BlockMergeTask.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/io/rcfile/merge/BlockMergeTask.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/io/rcfile/merge/BlockMergeTask.java (original)
+++ hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/io/rcfile/merge/BlockMergeTask.java Wed Jan 1 22:47:42 2014
@@ -140,8 +140,8 @@ public class BlockMergeTask extends Task
throw new RuntimeException(e.getMessage());
}
- String outputPath = this.work.getOutputDir();
- Path tempOutPath = Utilities.toTempPath(new Path(outputPath));
+ Path outputPath = this.work.getOutputDir();
+ Path tempOutPath = Utilities.toTempPath(outputPath);
try {
FileSystem fs = tempOutPath.getFileSystem(job);
if (!fs.exists(tempOutPath)) {
@@ -152,7 +152,7 @@ public class BlockMergeTask extends Task
return 6;
}
- RCFileBlockMergeOutputFormat.setMergeOutputPath(job, new Path(outputPath));
+ RCFileBlockMergeOutputFormat.setMergeOutputPath(job, outputPath);
job.setOutputKeyClass(NullWritable.class);
job.setOutputValueClass(NullWritable.class);
@@ -340,7 +340,7 @@ public class BlockMergeTask extends Task
}
}
- MergeWork mergeWork = new MergeWork(inputPaths, outputDir);
+ MergeWork mergeWork = new MergeWork(inputPaths, new Path(outputDir));
DriverContext driverCxt = new DriverContext();
BlockMergeTask taskExec = new BlockMergeTask();
taskExec.initialize(hiveConf, null, driverCxt);
Modified: hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/io/rcfile/merge/MergeWork.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/io/rcfile/merge/MergeWork.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/io/rcfile/merge/MergeWork.java (original)
+++ hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/io/rcfile/merge/MergeWork.java Wed Jan 1 22:47:42 2014
@@ -45,7 +45,7 @@ public class MergeWork extends MapWork i
private static final long serialVersionUID = 1L;
private List<String> inputPaths;
- private String outputDir;
+ private transient Path outputDir;
private boolean hasDynamicPartitions;
private DynamicPartitionCtx dynPartCtx;
private boolean isListBucketingAlterTableConcatenate;
@@ -54,11 +54,11 @@ public class MergeWork extends MapWork i
public MergeWork() {
}
- public MergeWork(List<String> inputPaths, String outputDir) {
+ public MergeWork(List<String> inputPaths, Path outputDir) {
this(inputPaths, outputDir, false, null);
}
- public MergeWork(List<String> inputPaths, String outputDir,
+ public MergeWork(List<String> inputPaths, Path outputDir,
boolean hasDynamicPartitions, DynamicPartitionCtx dynPartCtx) {
super();
this.inputPaths = inputPaths;
@@ -83,11 +83,11 @@ public class MergeWork extends MapWork i
this.inputPaths = inputPaths;
}
- public String getOutputDir() {
+ public Path getOutputDir() {
return outputDir;
}
- public void setOutputDir(String outputDir) {
+ public void setOutputDir(Path outputDir) {
this.outputDir = outputDir;
}
Modified: hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/io/rcfile/merge/RCFileMergeMapper.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/io/rcfile/merge/RCFileMergeMapper.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/io/rcfile/merge/RCFileMergeMapper.java (original)
+++ hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/io/rcfile/merge/RCFileMergeMapper.java Wed Jan 1 22:47:42 2014
@@ -311,13 +311,12 @@ public class RCFileMergeMapper extends M
}
}
- public static void jobClose(String outputPath, boolean success, JobConf job,
+ public static void jobClose(Path outputPath, boolean success, JobConf job,
LogHelper console, DynamicPartitionCtx dynPartCtx, Reporter reporter
) throws HiveException, IOException {
- Path outpath = new Path(outputPath);
- FileSystem fs = outpath.getFileSystem(job);
- Path backupPath = backupOutputPath(fs, outpath, job);
- Utilities.mvFileToFinalPath(outputPath, job, success, LOG, dynPartCtx, null,
+ FileSystem fs = outputPath.getFileSystem(job);
+ Path backupPath = backupOutputPath(fs, outputPath, job);
+ Utilities.mvFileToFinalPath(outputPath.toUri().toString(), job, success, LOG, dynPartCtx, null,
reporter);
fs.delete(backupPath, true);
}
Modified: hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMRFileSink1.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMRFileSink1.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMRFileSink1.java (original)
+++ hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMRFileSink1.java Wed Jan 1 22:47:42 2014
@@ -27,6 +27,7 @@ import java.util.Stack;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.ql.exec.FileSinkOperator;
import org.apache.hadoop.hive.ql.exec.Operator;
@@ -92,7 +93,7 @@ public class GenMRFileSink1 implements N
chDir = GenMapRedUtils.isMergeRequired(ctx.getMvTask(), hconf, fsOp, currTask, isInsertTable);
}
- String finalName = processFS(fsOp, stack, opProcCtx, chDir);
+ Path finalName = processFS(fsOp, stack, opProcCtx, chDir);
if (chDir) {
// Merge the files in the destination table/partitions by creating Map-only merge job
@@ -156,14 +157,14 @@ public class GenMRFileSink1 implements N
* @return the final file name to which the FileSinkOperator should store.
* @throws SemanticException
*/
- private String processFS(FileSinkOperator fsOp, Stack<Node> stack,
+ private Path processFS(FileSinkOperator fsOp, Stack<Node> stack,
NodeProcessorCtx opProcCtx, boolean chDir) throws SemanticException {
GenMRProcContext ctx = (GenMRProcContext) opProcCtx;
Task<? extends Serializable> currTask = ctx.getCurrTask();
// If the directory needs to be changed, send the new directory
- String dest = null;
+ Path dest = null;
List<FileSinkOperator> seenFSOps = ctx.getSeenFileSinkOps();
if (seenFSOps == null) {
Modified: hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java (original)
+++ hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java Wed Jan 1 22:47:42 2014
@@ -1179,7 +1179,7 @@ public final class GenMapRedUtils {
*
*/
public static void createMRWorkForMergingFiles (FileSinkOperator fsInput,
- String finalName, DependencyCollectionTask dependencyTask,
+ Path finalName, DependencyCollectionTask dependencyTask,
List<Task<MoveWork>> mvTasks, HiveConf conf,
Task<? extends Serializable> currTask) throws SemanticException {
@@ -1195,7 +1195,7 @@ public final class GenMapRedUtils {
// Create a FileSink operator
TableDesc ts = (TableDesc) fsInputDesc.getTableInfo().clone();
- FileSinkDesc fsOutputDesc = new FileSinkDesc(finalName, ts,
+ FileSinkDesc fsOutputDesc = new FileSinkDesc(finalName.toUri().toString(), ts,
conf.getBoolVar(ConfVars.COMPRESSRESULT));
FileSinkOperator fsOutput = (FileSinkOperator) OperatorFactory.getAndMakeChild(
fsOutputDesc, inputRS, tsMerge);
@@ -1481,7 +1481,7 @@ public final class GenMapRedUtils {
* null otherwise
*/
public static MapWork createRCFileMergeTask(FileSinkDesc fsInputDesc,
- String finalName, boolean hasDynamicPartitions) throws SemanticException {
+ Path finalName, boolean hasDynamicPartitions) throws SemanticException {
String inputDir = fsInputDesc.getFinalDirName();
TableDesc tblDesc = fsInputDesc.getTableInfo();
@@ -1679,19 +1679,19 @@ public final class GenMapRedUtils {
* @param dependencyTask
* @return
*/
- public static String createMoveTask(Task<? extends Serializable> currTask, boolean chDir,
+ public static Path createMoveTask(Task<? extends Serializable> currTask, boolean chDir,
FileSinkOperator fsOp, ParseContext parseCtx, List<Task<MoveWork>> mvTasks,
HiveConf hconf, DependencyCollectionTask dependencyTask) {
- String dest = null;
+ Path dest = null;
if (chDir) {
- dest = fsOp.getConf().getFinalDirName();
+ dest = new Path(fsOp.getConf().getFinalDirName());
// generate the temporary file
// it must be on the same file system as the current destination
Context baseCtx = parseCtx.getContext();
- String tmpDir = baseCtx.getExternalTmpFileURI((new Path(dest)).toUri());
+ String tmpDir = baseCtx.getExternalTmpFileURI(dest.toUri());
FileSinkDesc fileSinkDesc = fsOp.getConf();
// Change all the linked file sink descriptors
Modified: hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/AlterTablePartMergeFilesDesc.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/AlterTablePartMergeFilesDesc.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/AlterTablePartMergeFilesDesc.java (original)
+++ hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/AlterTablePartMergeFilesDesc.java Wed Jan 1 22:47:42 2014
@@ -22,6 +22,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
+import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hive.ql.plan.Explain;
import org.apache.hadoop.hive.ql.plan.ListBucketingCtx;
@@ -33,7 +34,7 @@ public class AlterTablePartMergeFilesDes
private ListBucketingCtx lbCtx; // context for list bucketing.
private List<String> inputDir = new ArrayList<String>();
- private String outputDir = null;
+ private Path outputDir = null;
public AlterTablePartMergeFilesDesc(String tableName,
HashMap<String, String> partSpec) {
@@ -59,11 +60,11 @@ public class AlterTablePartMergeFilesDes
this.partSpec = partSpec;
}
- public String getOutputDir() {
+ public Path getOutputDir() {
return outputDir;
}
- public void setOutputDir(String outputDir) {
+ public void setOutputDir(Path outputDir) {
this.outputDir = outputDir;
}
Modified: hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java (original)
+++ hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java Wed Jan 1 22:47:42 2014
@@ -1626,7 +1626,7 @@ public class DDLSemanticAnalyzer extends
Task<? extends Serializable> mergeTask = TaskFactory.get(ddlWork, conf);
TableDesc tblDesc = Utilities.getTableDesc(tblObj);
String queryTmpdir = ctx.getExternalTmpFileURI(newTblPartLoc.toUri());
- mergeDesc.setOutputDir(queryTmpdir);
+ mergeDesc.setOutputDir(new Path(queryTmpdir));
LoadTableDesc ltd = new LoadTableDesc(new Path(queryTmpdir), queryTmpdir, tblDesc,
partSpec == null ? new HashMap<String, String>() : partSpec);
ltd.setLbCtx(lbCtx);
Modified: hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/FileSinkProcessor.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/FileSinkProcessor.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/FileSinkProcessor.java (original)
+++ hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/FileSinkProcessor.java Wed Jan 1 22:47:42 2014
@@ -22,6 +22,7 @@ import java.util.Stack;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.ql.exec.FileSinkOperator;
import org.apache.hadoop.hive.ql.lib.Node;
@@ -60,7 +61,7 @@ public class FileSinkProcessor implement
boolean chDir = GenMapRedUtils.isMergeRequired(context.moveTask,
hconf, fileSink, context.currentTask, isInsertTable);
- String finalName = GenMapRedUtils.createMoveTask(context.currentTask,
+ Path finalName = GenMapRedUtils.createMoveTask(context.currentTask,
chDir, fileSink, parseContext, context.moveTask, hconf, context.dependencyTask);
if (chDir) {
Modified: hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java (original)
+++ hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java Wed Jan 1 22:47:42 2014
@@ -5471,8 +5471,7 @@ public class SemanticAnalyzer extends Ba
// fall through
case QBMetaData.DEST_DFS_FILE: {
dest_path = new Path(qbm.getDestFileForAlias(dest));
- String destStr = dest_path.toString();
-
+
if (isLocal) {
// for local directory - we always write to map-red intermediate
// store and then copy to local fs
@@ -5554,14 +5553,14 @@ public class SemanticAnalyzer extends Ba
tblDesc.setCols(new ArrayList<FieldSchema>(field_schemas));
}
- if (!ctx.isMRTmpFileURI(destStr)) {
- idToTableNameMap.put(String.valueOf(destTableId), destStr);
+ if (!ctx.isMRTmpFileURI(dest_path.toUri().toString())) {
+ idToTableNameMap.put(String.valueOf(destTableId), dest_path.toUri().toString());
currentTableId = destTableId;
destTableId++;
}
boolean isDfsDir = (dest_type.intValue() == QBMetaData.DEST_DFS_FILE);
- loadFileWork.add(new LoadFileDesc(tblDesc, new Path(queryTmpdir), destStr, isDfsDir, cols,
+ loadFileWork.add(new LoadFileDesc(tblDesc, new Path(queryTmpdir), dest_path, isDfsDir, cols,
colTypes));
if (tblDesc == null) {
@@ -5577,7 +5576,7 @@ public class SemanticAnalyzer extends Ba
if (!outputs.add(new WriteEntity(dest_path, !isDfsDir))) {
throw new SemanticException(ErrorMsg.OUTPUT_SPECIFIED_MULTIPLE_TIMES
- .getMsg(destStr));
+ .getMsg(dest_path.toUri().toString()));
}
break;
}
Modified: hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/TaskCompiler.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/TaskCompiler.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/TaskCompiler.java (original)
+++ hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/parse/TaskCompiler.java Wed Jan 1 22:47:42 2014
@@ -159,8 +159,9 @@ public abstract class TaskCompiler {
assert (oneLoadFile); // should not have more than 1 load file for
// CTAS
// make the movetask's destination directory the table's destination.
- String location = qb.getTableDesc().getLocation();
- if (location == null) {
+ Path location;
+ String loc = qb.getTableDesc().getLocation();
+ if (loc == null) {
// get the table's default location
Table dumpTable;
Path targetPath;
@@ -179,7 +180,9 @@ public abstract class TaskCompiler {
throw new SemanticException(e);
}
- location = targetPath.toString();
+ location = targetPath;
+ } else {
+ location = new Path(loc);
}
lfd.setTargetDir(location);
Modified: hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/plan/ConditionalResolverMergeFiles.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/plan/ConditionalResolverMergeFiles.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/plan/ConditionalResolverMergeFiles.java (original)
+++ hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/plan/ConditionalResolverMergeFiles.java Wed Jan 1 22:47:42 2014
@@ -285,8 +285,8 @@ public class ConditionalResolverMergeFil
MoveWork mvWork = (MoveWork) mvTask.getWork();
LoadFileDesc lfd = mvWork.getLoadFileWork();
- String targetDir = lfd.getTargetDir();
- List<String> targetDirs = new ArrayList<String>(toMove.size());
+ Path targetDir = lfd.getTargetDir();
+ List<Path> targetDirs = new ArrayList<Path>(toMove.size());
for (int i = 0; i < toMove.size(); i++) {
String toMoveStr = toMove.get(i);
@@ -295,9 +295,9 @@ public class ConditionalResolverMergeFil
}
String[] moveStrSplits = toMoveStr.split(Path.SEPARATOR);
int dpIndex = moveStrSplits.length - dpLbLevel;
- String target = targetDir;
+ Path target = targetDir;
while (dpIndex < moveStrSplits.length) {
- target = target + Path.SEPARATOR + moveStrSplits[dpIndex];
+ target = new Path(target, moveStrSplits[dpIndex]);
dpIndex++;
}
Modified: hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadFileDesc.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadFileDesc.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadFileDesc.java (original)
+++ hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadFileDesc.java Wed Jan 1 22:47:42 2014
@@ -21,6 +21,7 @@ package org.apache.hadoop.hive.ql.plan;
import java.io.Serializable;
import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hive.ql.exec.PTFUtils;
/**
* LoadFileDesc.
@@ -28,18 +29,21 @@ import org.apache.hadoop.fs.Path;
*/
public class LoadFileDesc extends LoadDesc implements Serializable {
private static final long serialVersionUID = 1L;
- private String targetDir;
+ private transient Path targetDir;
private boolean isDfsDir;
// list of columns, comma separated
private String columns;
private String columnTypes;
private String destinationCreateTable;
+ static {
+ PTFUtils.makeTransient(LoadFileDesc.class, "targetDir");
+ }
public LoadFileDesc() {
}
public LoadFileDesc(final CreateTableDesc createTableDesc, final Path sourcePath,
- final String targetDir,
+ final Path targetDir,
final boolean isDfsDir, final String columns, final String columnTypes) {
this(sourcePath, targetDir, isDfsDir, columns, columnTypes);
if (createTableDesc != null && createTableDesc.getDatabaseName() != null
@@ -50,7 +54,7 @@ public class LoadFileDesc extends LoadDe
}
}
- public LoadFileDesc(final Path sourcePath, final String targetDir,
+ public LoadFileDesc(final Path sourcePath, final Path targetDir,
final boolean isDfsDir, final String columns, final String columnTypes) {
super(sourcePath);
@@ -61,11 +65,11 @@ public class LoadFileDesc extends LoadDe
}
@Explain(displayName = "destination")
- public String getTargetDir() {
+ public Path getTargetDir() {
return targetDir;
}
- public void setTargetDir(final String targetDir) {
+ public void setTargetDir(final Path targetDir) {
this.targetDir = targetDir;
}
Modified: hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadMultiFilesDesc.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadMultiFilesDesc.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadMultiFilesDesc.java (original)
+++ hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadMultiFilesDesc.java Wed Jan 1 22:47:42 2014
@@ -21,23 +21,29 @@ package org.apache.hadoop.hive.ql.plan;
import java.io.Serializable;
import java.util.List;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hive.ql.exec.PTFUtils;
+
/**
* LoadMultiFilesDesc.
*
*/
public class LoadMultiFilesDesc implements Serializable {
private static final long serialVersionUID = 1L;
- private List<String> targetDirs;
+ private transient List<Path> targetDirs;
private boolean isDfsDir;
// list of columns, comma separated
private String columns;
private String columnTypes;
private List<String> srcDirs;
+ static {
+ PTFUtils.makeTransient(LoadMultiFilesDesc.class, "targetDirs");
+ }
public LoadMultiFilesDesc() {
}
- public LoadMultiFilesDesc(final List<String> sourceDirs, final List<String> targetDir,
+ public LoadMultiFilesDesc(final List<String> sourceDirs, final List<Path> targetDir,
final boolean isDfsDir, final String columns, final String columnTypes) {
this.srcDirs = sourceDirs;
@@ -48,7 +54,7 @@ public class LoadMultiFilesDesc implemen
}
@Explain(displayName = "destinations")
- public List<String> getTargetDirs() {
+ public List<Path> getTargetDirs() {
return targetDirs;
}
@@ -61,7 +67,7 @@ public class LoadMultiFilesDesc implemen
this.srcDirs = srcs;
}
- public void setTargetDirs(final List<String> targetDir) {
+ public void setTargetDirs(final List<Path> targetDir) {
this.targetDirs = targetDir;
}
Modified: hive/branches/tez/ql/src/test/results/compiler/plan/case_sensitivity.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/compiler/plan/case_sensitivity.q.xml?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/compiler/plan/case_sensitivity.q.xml (original)
+++ hive/branches/tez/ql/src/test/results/compiler/plan/case_sensitivity.q.xml Wed Jan 1 22:47:42 2014
@@ -377,9 +377,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
Modified: hive/branches/tez/ql/src/test/results/compiler/plan/input1.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/compiler/plan/input1.q.xml?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/compiler/plan/input1.q.xml (original)
+++ hive/branches/tez/ql/src/test/results/compiler/plan/input1.q.xml Wed Jan 1 22:47:42 2014
@@ -377,9 +377,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
Modified: hive/branches/tez/ql/src/test/results/compiler/plan/input2.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/compiler/plan/input2.q.xml?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/compiler/plan/input2.q.xml (original)
+++ hive/branches/tez/ql/src/test/results/compiler/plan/input2.q.xml Wed Jan 1 22:47:42 2014
@@ -377,9 +377,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
@@ -856,9 +853,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
@@ -1339,9 +1333,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
Modified: hive/branches/tez/ql/src/test/results/compiler/plan/input3.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/compiler/plan/input3.q.xml?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/compiler/plan/input3.q.xml (original)
+++ hive/branches/tez/ql/src/test/results/compiler/plan/input3.q.xml Wed Jan 1 22:47:42 2014
@@ -377,9 +377,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
@@ -856,9 +853,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
@@ -1339,9 +1333,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
@@ -1714,9 +1705,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
@@ -1738,9 +1726,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- <string>../../../../build/contrib/hive/ql/test/data/warehouse/dest4.out</string>
- </void>
</object>
</void>
</object>
Modified: hive/branches/tez/ql/src/test/results/compiler/plan/input6.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/compiler/plan/input6.q.xml?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/compiler/plan/input6.q.xml (original)
+++ hive/branches/tez/ql/src/test/results/compiler/plan/input6.q.xml Wed Jan 1 22:47:42 2014
@@ -377,9 +377,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
Modified: hive/branches/tez/ql/src/test/results/compiler/plan/input7.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/compiler/plan/input7.q.xml?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/compiler/plan/input7.q.xml (original)
+++ hive/branches/tez/ql/src/test/results/compiler/plan/input7.q.xml Wed Jan 1 22:47:42 2014
@@ -377,9 +377,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
Modified: hive/branches/tez/ql/src/test/results/compiler/plan/input9.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/compiler/plan/input9.q.xml?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/compiler/plan/input9.q.xml (original)
+++ hive/branches/tez/ql/src/test/results/compiler/plan/input9.q.xml Wed Jan 1 22:47:42 2014
@@ -377,9 +377,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
Modified: hive/branches/tez/ql/src/test/results/compiler/plan/input_testsequencefile.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/compiler/plan/input_testsequencefile.q.xml?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/compiler/plan/input_testsequencefile.q.xml (original)
+++ hive/branches/tez/ql/src/test/results/compiler/plan/input_testsequencefile.q.xml Wed Jan 1 22:47:42 2014
@@ -377,9 +377,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
Modified: hive/branches/tez/ql/src/test/results/compiler/plan/sample2.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/compiler/plan/sample2.q.xml?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/compiler/plan/sample2.q.xml (original)
+++ hive/branches/tez/ql/src/test/results/compiler/plan/sample2.q.xml Wed Jan 1 22:47:42 2014
@@ -377,9 +377,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
Modified: hive/branches/tez/ql/src/test/results/compiler/plan/sample3.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/compiler/plan/sample3.q.xml?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/compiler/plan/sample3.q.xml (original)
+++ hive/branches/tez/ql/src/test/results/compiler/plan/sample3.q.xml Wed Jan 1 22:47:42 2014
@@ -377,9 +377,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
Modified: hive/branches/tez/ql/src/test/results/compiler/plan/sample4.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/compiler/plan/sample4.q.xml?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/compiler/plan/sample4.q.xml (original)
+++ hive/branches/tez/ql/src/test/results/compiler/plan/sample4.q.xml Wed Jan 1 22:47:42 2014
@@ -377,9 +377,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
Modified: hive/branches/tez/ql/src/test/results/compiler/plan/sample5.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/compiler/plan/sample5.q.xml?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/compiler/plan/sample5.q.xml (original)
+++ hive/branches/tez/ql/src/test/results/compiler/plan/sample5.q.xml Wed Jan 1 22:47:42 2014
@@ -377,9 +377,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
Modified: hive/branches/tez/ql/src/test/results/compiler/plan/sample6.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/compiler/plan/sample6.q.xml?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/compiler/plan/sample6.q.xml (original)
+++ hive/branches/tez/ql/src/test/results/compiler/plan/sample6.q.xml Wed Jan 1 22:47:42 2014
@@ -377,9 +377,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
Modified: hive/branches/tez/ql/src/test/results/compiler/plan/sample7.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/compiler/plan/sample7.q.xml?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/compiler/plan/sample7.q.xml (original)
+++ hive/branches/tez/ql/src/test/results/compiler/plan/sample7.q.xml Wed Jan 1 22:47:42 2014
@@ -377,9 +377,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
Modified: hive/branches/tez/ql/src/test/results/compiler/plan/subq.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/compiler/plan/subq.q.xml?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/compiler/plan/subq.q.xml (original)
+++ hive/branches/tez/ql/src/test/results/compiler/plan/subq.q.xml Wed Jan 1 22:47:42 2014
@@ -286,9 +286,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
@@ -310,9 +307,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- <string>../build/ql/test/data/warehouse/union.out</string>
- </void>
</object>
</void>
</object>
Modified: hive/branches/tez/ql/src/test/results/compiler/plan/union.q.xml
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/compiler/plan/union.q.xml?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/compiler/plan/union.q.xml (original)
+++ hive/branches/tez/ql/src/test/results/compiler/plan/union.q.xml Wed Jan 1 22:47:42 2014
@@ -286,9 +286,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- #### A masked pattern was here ####
- </void>
</object>
</void>
</object>
@@ -310,9 +307,6 @@
<void property="isDfsDir">
<boolean>true</boolean>
</void>
- <void property="targetDir">
- <string>../build/ql/test/data/warehouse/union.out</string>
- </void>
</object>
</void>
</object>
Modified: hive/branches/tez/testutils/ptest2/pom.xml
URL: http://svn.apache.org/viewvc/hive/branches/tez/testutils/ptest2/pom.xml?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
Binary files - no diff available.
Modified: hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/PTest.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/PTest.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/PTest.java (original)
+++ hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/PTest.java Wed Jan 1 22:47:42 2014
@@ -122,6 +122,7 @@ public class PTest {
put("antTestTarget", configuration.getAntTestTarget()).
put("mavenEnvOpts", configuration.getMavenEnvOpts()).
put("mavenArgs", configuration.getMavenArgs()).
+ put("mavenBuildArgs", configuration.getMavenBuildArgs()).
put("mavenTestArgs", configuration.getMavenTestArgs());
final ImmutableMap<String, String> templateDefaults = templateDefaultsBuilder.build();
TestParser testParser = new TestParser(configuration.getContext(), configuration.getTestCasePropertyName(),
@@ -272,9 +273,9 @@ public class PTest {
options.addOption(null, PATCH, true, "URI to patch, either file:/// or http(s)://");
options.addOption(ANT_ARG, null, true, "Supplemntal ant arguments");
options.addOption(null, JAVA_HOME, true, "Java Home for compiling and running tests (unless " + JAVA_HOME_TEST + " is specified)");
- options.addOption(null, JAVA_HOME_TEST, true, "Java Home for running tests (optional)");
+ options.addOption(null, JAVA_HOME_TEST, true, "Java Home for running tests (optional)");
options.addOption(null, ANT_TEST_ARGS, true, "Arguments to ant test on slave nodes only");
- options.addOption(null, ANT_ENV_OPTS, true, "ANT_OPTS environemnt variable setting");
+ options.addOption(null, ANT_ENV_OPTS, true, "ANT_OPTS environment variable setting");
CommandLine commandLine = parser.parse(options, args);
if(!commandLine.hasOption(PROPERTIES)) {
throw new IllegalArgumentException(Joiner.on(" ").
Modified: hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/conf/TestConfiguration.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/conf/TestConfiguration.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/conf/TestConfiguration.java (original)
+++ hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/conf/TestConfiguration.java Wed Jan 1 22:47:42 2014
@@ -40,16 +40,16 @@ public class TestConfiguration {
public static final String ANT_ENV_OPTS = "antEnvOpts";
public static final String ANT_TEST_ARGS = "antTestArgs";
public static final String ANT_TEST_TARGET = "antTestTarget";
- public static final String MAVEN_ENV_OPTS = "mavenEnvOpts";
- public static final String MAVEN_TEST_ARGS = "mavenTestArgs";
- public static final String MAVEN_TEST_TARGET = "mavenTestTarget";
private static final String REPOSITORY_TYPE = "repositoryType";
private static final String GIT = "git";
private static final String SVN = "svn";
private static final String ANT = "ant";
private static final String MAVEN = "maven";
+ private static final String MAVEN_ENV_OPTS = "mavenEnvOpts";
private static final String MAVEN_ARGS = "mavenArgs";
+ private static final String MAVEN_BUILD_ARGS = "mavenBuildArgs";
+ private static final String MAVEN_TEST_ARGS = "mavenTestArgs";
private static final String ANT_ARGS = "antArgs";
private static final String JIRA_URL = "jiraUrl";
private static final String JIRA_USER = "jiraUser";
@@ -64,6 +64,7 @@ public class TestConfiguration {
private String antEnvOpts;
private String antTestTarget;
private String mavenArgs;
+ private String mavenBuildArgs;
private String mavenTestArgs;
private String mavenEnvOpts;
private String repositoryType;
@@ -105,7 +106,8 @@ public class TestConfiguration {
antTestArgs = context.getString(ANT_TEST_ARGS, "").trim();
antEnvOpts = context.getString(ANT_ENV_OPTS, "").trim();
antTestTarget = context.getString(ANT_TEST_TARGET, "test").trim();
- mavenArgs = context.getString(MAVEN_ARGS, "").trim();
+ mavenArgs = context.getString(MAVEN_ARGS, "").trim();
+ mavenBuildArgs = context.getString(MAVEN_BUILD_ARGS, "").trim();
mavenTestArgs = context.getString(MAVEN_TEST_ARGS, "").trim();
mavenEnvOpts = context.getString(MAVEN_ENV_OPTS, "").trim();
javaHome = context.getString(JAVA_HOME, "").trim();
@@ -175,6 +177,9 @@ public class TestConfiguration {
public String getMavenArgs() {
return mavenArgs;
}
+ public String getMavenBuildArgs() {
+ return mavenBuildArgs;
+ }
public String getMavenTestArgs() {
return mavenTestArgs;
}
Modified: hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudComputeService.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudComputeService.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudComputeService.java (original)
+++ hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudComputeService.java Wed Jan 1 22:47:42 2014
@@ -22,6 +22,7 @@ import java.util.Collections;
import java.util.Properties;
import java.util.Set;
+import org.jclouds.Constants;
import org.jclouds.ContextBuilder;
import org.jclouds.aws.ec2.compute.AWSEC2TemplateOptions;
import org.jclouds.compute.ComputeService;
@@ -59,11 +60,13 @@ public class CloudComputeService {
mMaxBid = maxBid;
mGroupTag = "group=" + mGroupName;
Properties overrides = new Properties();
- overrides.put(ComputeServiceProperties.POLL_INITIAL_PERIOD, String.valueOf(10L * 1000L));
- overrides.put(ComputeServiceProperties.POLL_MAX_PERIOD, String.valueOf(30L * 1000L));
+ overrides.put(ComputeServiceProperties.POLL_INITIAL_PERIOD, String.valueOf(60L * 1000L));
+ overrides.put(ComputeServiceProperties.POLL_MAX_PERIOD, String.valueOf(600L * 1000L));
+ overrides.put(Constants.PROPERTY_MAX_RETRIES, String.valueOf(60));
mComputeServiceContext = ContextBuilder.newBuilder("aws-ec2")
.credentials(apiKey, accessKey)
.modules(ImmutableSet.of(new Log4JLoggingModule()))
+ .overrides(overrides)
.buildView(ComputeServiceContext.class);
mComputeService = mComputeServiceContext.getComputeService();
}
Modified: hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudExecutionContextProvider.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudExecutionContextProvider.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudExecutionContextProvider.java (original)
+++ hive/branches/tez/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudExecutionContextProvider.java Wed Jan 1 22:47:42 2014
@@ -67,7 +67,7 @@ public class CloudExecutionContextProvid
public static final String USERNAME = "user";
public static final String INSTANCE_TYPE = "instanceType";
public static final String NUM_THREADS = "numThreads";
-
+
private final RandomAccessFile mHostLog;
private final String mPrivateKey;
private final String mUser;
@@ -126,7 +126,7 @@ public class CloudExecutionContextProvid
public void run() {
while (true) {
try {
- TimeUnit.MINUTES.sleep(15);
+ TimeUnit.MINUTES.sleep(60);
performBackgroundWork();
} catch (Exception e) {
LOG.error("Unexpected error in background worker", e);
@@ -194,11 +194,19 @@ public class CloudExecutionContextProvid
Set<NodeMetadata> result = Sets.newHashSet();
int attempts = 0;
int numRequired = numHosts;
+ // pause so we don't get banned
+ try {
+ TimeUnit.SECONDS.sleep(mRetrySleepInterval);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
do {
+ boolean error = false;
LOG.info("Attempting to create " + numRequired + " nodes");
try {
- result.addAll(mCloudComputeService.createNodes(numRequired));
+ result.addAll(mCloudComputeService.createNodes(Math.min(2, numRequired)));
} catch (RunNodesException e) {
+ error = true;
LOG.warn("Error creating nodes", e);
terminateInternal(e.getNodeErrors().keySet());
result.addAll(e.getSuccessfulNodes());
@@ -206,9 +214,14 @@ public class CloudExecutionContextProvid
result = verifyHosts(result);
LOG.info("Successfully created " + result.size() + " nodes");
numRequired = numHosts - result.size();
- if(numRequired > 0) {
+ if (numRequired > 0) {
+ long sleepTime = mRetrySleepInterval;
+ if (error) {
+ sleepTime *= ++attempts;
+ }
+ LOG.info("Pausing creation process for " + sleepTime + " seconds");
try {
- TimeUnit.SECONDS.sleep(++attempts * mRetrySleepInterval);
+ TimeUnit.SECONDS.sleep(sleepTime);
} catch(InterruptedException e) {
throw new CreateHostsFailedException("Interrupted while trying to create hosts", e);
}
@@ -308,12 +321,18 @@ public class CloudExecutionContextProvid
mTerminationExecutor.submit(new Runnable() {
@Override
public void run() {
+ // pause so we don't get banned
+ try {
+ TimeUnit.SECONDS.sleep(mRetrySleepInterval);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
try {
LOG.info("Terminating " + node.getHostname());
- mCloudComputeService.destroyNode(node.getId());
if (!mTerminatedHosts.containsKey(node.getHostname())) {
mTerminatedHosts.put(node.getHostname(), System.currentTimeMillis());
}
+ mCloudComputeService.destroyNode(node.getId());
} catch (Exception e) {
LOG.error("Error attempting to terminate host " + node, e);
}
Modified: hive/branches/tez/testutils/ptest2/src/main/resources/source-prep.vm
URL: http://svn.apache.org/viewvc/hive/branches/tez/testutils/ptest2/src/main/resources/source-prep.vm?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/testutils/ptest2/src/main/resources/source-prep.vm (original)
+++ hive/branches/tez/testutils/ptest2/src/main/resources/source-prep.vm Wed Jan 1 22:47:42 2014
@@ -85,11 +85,11 @@ cd $workingDir/
if [[ "${buildTool}" == "maven" ]]
then
rm -rf $workingDir/maven/org/apache/hive
- mvn -B clean install -DskipTests -Dmaven.repo.local=$workingDir/maven $mavenArgs
- mvn -B test -Dmaven.repo.local=$workingDir/maven -Dtest=TestDummy $mavenArgs
+ mvn -B clean install -DskipTests -Dmaven.repo.local=$workingDir/maven $mavenArgs $mavenBuildArgs
+ mvn -B test -Dmaven.repo.local=$workingDir/maven -Dtest=TestDummy $mavenArgs $mavenTestArgs
cd itests
- mvn -B clean install -DskipTests -Dmaven.repo.local=$workingDir/maven $mavenArgs
- mvn -B test -Dmaven.repo.local=$workingDir/maven -Dtest=TestDummy $mavenArgs
+ mvn -B clean install -DskipTests -Dmaven.repo.local=$workingDir/maven $mavenArgs $mavenBuildArgs
+ mvn -B test -Dmaven.repo.local=$workingDir/maven -Dtest=TestDummy $mavenArgs $mavenTestArgs
elif [[ "${buildTool}" == "ant" ]]
then
ant $antArgs -Divy.default.ivy.user.dir=$workingDir/ivy \
Modified: hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.java (original)
+++ hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.java Wed Jan 1 22:47:42 2014
@@ -143,6 +143,9 @@ public class TestScripts {
templateVariables.put("clearLibraryCache", "true");
templateVariables.put("javaHome", "/usr/java/jdk1.7");
templateVariables.put("antEnvOpts", "-Dhttp.proxyHost=somehost -Dhttp.proxyPort=3128");
+ templateVariables.put("mavenArgs", "-X");
+ templateVariables.put("mavenBuildArgs", "-Phadoop-2");
+ templateVariables.put("mavenTestArgs", "-Phadoop-1");
templateVariables.put("repositoryType", "git");
String template = readResource("source-prep.vm");
String actual = getTemplateResult(template, templateVariables);
Modified: hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepGit.approved.txt
URL: http://svn.apache.org/viewvc/hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepGit.approved.txt?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepGit.approved.txt (original)
+++ hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepGit.approved.txt Wed Jan 1 22:47:42 2014
@@ -84,11 +84,11 @@ cd /some/working/dir/
if [[ "${buildTool}" == "maven" ]]
then
rm -rf /some/working/dir/maven/org/apache/hive
- mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven $mavenArgs
- mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy $mavenArgs
+ mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven -X -Phadoop-2
+ mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy -X -Phadoop-1
cd itests
- mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven $mavenArgs
- mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy $mavenArgs
+ mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven -X -Phadoop-2
+ mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy -X -Phadoop-1
elif [[ "${buildTool}" == "ant" ]]
then
ant -Dant=arg1 -Divy.default.ivy.user.dir=/some/working/dir/ivy \
Modified: hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepNone.approved.txt
URL: http://svn.apache.org/viewvc/hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepNone.approved.txt?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepNone.approved.txt (original)
+++ hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepNone.approved.txt Wed Jan 1 22:47:42 2014
@@ -84,11 +84,11 @@ cd /some/working/dir/
if [[ "ant" == "maven" ]]
then
rm -rf /some/working/dir/maven/org/apache/hive
- mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven $mavenArgs
- mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy $mavenArgs
+ mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven $mavenArgs $mavenBuildArgs
+ mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy $mavenArgs $mavenTestArgs
cd itests
- mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven $mavenArgs
- mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy $mavenArgs
+ mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven $mavenArgs $mavenBuildArgs
+ mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy $mavenArgs $mavenTestArgs
elif [[ "ant" == "ant" ]]
then
ant -Dant=arg1 -Divy.default.ivy.user.dir=/some/working/dir/ivy \
Modified: hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepSvn.approved.txt
URL: http://svn.apache.org/viewvc/hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepSvn.approved.txt?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepSvn.approved.txt (original)
+++ hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepSvn.approved.txt Wed Jan 1 22:47:42 2014
@@ -84,11 +84,11 @@ cd /some/working/dir/
if [[ "maven" == "maven" ]]
then
rm -rf /some/working/dir/maven/org/apache/hive
- mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven $mavenArgs
- mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy $mavenArgs
+ mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven $mavenArgs $mavenBuildArgs
+ mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy $mavenArgs $mavenTestArgs
cd itests
- mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven $mavenArgs
- mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy $mavenArgs
+ mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven $mavenArgs $mavenBuildArgs
+ mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy $mavenArgs $mavenTestArgs
elif [[ "maven" == "ant" ]]
then
ant -Dant=arg1 -Divy.default.ivy.user.dir=/some/working/dir/ivy \
Modified: hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/context/TestCloudComputeService.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/context/TestCloudComputeService.java?rev=1554693&r1=1554692&r2=1554693&view=diff
==============================================================================
--- hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/context/TestCloudComputeService.java (original)
+++ hive/branches/tez/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/context/TestCloudComputeService.java Wed Jan 1 22:47:42 2014
@@ -1,3 +1,21 @@
+/*
+ * 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.hive.ptest.execution.context;
import java.util.Set;