Skip to content

Commit

Permalink
Merge latest trunk into branch. (Gunther Hagleitner)
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/hive/branches/tez@1538880 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
hagleitn committed Nov 5, 2013
2 parents a69e86b + 8bd3e9f commit 6bfef3d
Show file tree
Hide file tree
Showing 1,707 changed files with 21,902 additions and 22,070 deletions.
52 changes: 0 additions & 52 deletions ant/build.xml

This file was deleted.

32 changes: 0 additions & 32 deletions ant/ivy.xml

This file was deleted.

57 changes: 57 additions & 0 deletions ant/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.hive</groupId>
<artifactId>hive</artifactId>
<version>0.13.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>hive-ant</artifactId>
<packaging>jar</packaging>
<name>Hive Ant Utilities</name>

<properties>
<hive.path.to.root>..</hive.path.to.root>
</properties>

<dependencies>
<!-- inter-project -->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>${commons-lang.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>${ant.version}</version>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>${velocity.version}</version>
</dependency>
</dependencies>

<build>
<sourceDirectory>${basedir}/src</sourceDirectory>
</build>

</project>
50 changes: 48 additions & 2 deletions ant/src/org/apache/hadoop/hive/ant/GenVectorCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ public class GenVectorCode extends Task {
{"FilterStringColumnCompareScalar", "Greater", ">"},
{"FilterStringColumnCompareScalar", "GreaterEqual", ">="},

{"FilterStringColumnBetween", ""},
{"FilterStringColumnBetween", "!"},

{"StringColumnCompareScalar", "Equal", "=="},
{"StringColumnCompareScalar", "NotEqual", "!="},
{"StringColumnCompareScalar", "Less", "<"},
Expand Down Expand Up @@ -276,6 +279,11 @@ public class GenVectorCode extends Task {
{"FilterColumnCompareColumn", "GreaterEqual", "long", "long", ">="},
{"FilterColumnCompareColumn", "GreaterEqual", "double", "long", ">="},

{"FilterColumnBetween", "long", ""},
{"FilterColumnBetween", "double", ""},
{"FilterColumnBetween", "long", "!"},
{"FilterColumnBetween", "double", "!"},

{"ColumnCompareColumn", "Equal", "long", "double", "=="},
{"ColumnCompareColumn", "Equal", "double", "double", "=="},
{"ColumnCompareColumn", "NotEqual", "long", "double", "!="},
Expand Down Expand Up @@ -452,7 +460,7 @@ static String joinPath(String...parts) {
public void init(String templateBaseDir, String buildDir) {
File generationDirectory = new File(templateBaseDir);

String buildPath = joinPath(buildDir, "ql", "gen", "vector");
String buildPath = joinPath(buildDir, "generated-sources", "java");

File exprOutput = new File(joinPath(buildPath, "org", "apache", "hadoop",
"hive", "ql", "exec", "vector", "expressions", "gen"));
Expand All @@ -470,7 +478,7 @@ public void init(String templateBaseDir, String buildDir) {

File testCodeOutput =
new File(
joinPath(buildDir, "ql", "test", "src", "org",
joinPath(buildDir, "generated-test-sources", "java", "org",
"apache", "hadoop", "hive", "ql", "exec", "vector",
"expressions", "gen"));
testCodeGen = new GenVectorTestCode(testCodeOutput.getAbsolutePath(),
Expand Down Expand Up @@ -511,6 +519,8 @@ private void generate() throws Exception {
generateFilterColumnCompareScalar(tdesc);
} else if (tdesc[0].equals("FilterScalarCompareColumn")) {
generateFilterScalarCompareColumn(tdesc);
} else if (tdesc[0].equals("FilterColumnBetween")) {
generateFilterColumnBetween(tdesc);
} else if (tdesc[0].equals("ScalarArithmeticColumn")) {
generateScalarArithmeticColumn(tdesc);
} else if (tdesc[0].equals("FilterColumnCompareColumn")) {
Expand All @@ -535,6 +545,8 @@ private void generate() throws Exception {
generateVectorUDAFVar(tdesc);
} else if (tdesc[0].equals("FilterStringColumnCompareScalar")) {
generateFilterStringColumnCompareScalar(tdesc);
} else if (tdesc[0].equals("FilterStringColumnBetween")) {
generateFilterStringColumnBetween(tdesc);
} else if (tdesc[0].equals("StringColumnCompareScalar")) {
generateStringColumnCompareScalar(tdesc);
} else if (tdesc[0].equals("FilterStringScalarCompareColumn")) {
Expand All @@ -553,6 +565,40 @@ private void generate() throws Exception {
testCodeGen.generateTestSuites();
}

private void generateFilterStringColumnBetween(String[] tdesc) throws IOException {
String optionalNot = tdesc[1];
String className = "FilterStringColumn" + (optionalNot.equals("!") ? "Not" : "")
+ "Between";
String outputFile = joinPath(this.expressionOutputDirectory, className + ".java");

// Read the template into a string, expand it, and write it.
String templateFile = joinPath(this.expressionTemplateDirectory, tdesc[0] + ".txt");
String templateString = readFile(templateFile);
templateString = templateString.replaceAll("<ClassName>", className);
templateString = templateString.replaceAll("<OptionalNot>", optionalNot);
writeFile(outputFile, templateString);
}

private void generateFilterColumnBetween(String[] tdesc) throws IOException {
String operandType = tdesc[1];
String optionalNot = tdesc[2];

String className = "Filter" + getCamelCaseType(operandType) + "Column" +
(optionalNot.equals("!") ? "Not" : "") + "Between";
String inputColumnVectorType = getColumnVectorType(operandType);
String outputFile = joinPath(this.expressionOutputDirectory, className + ".java");

// Read the template into a string, expand it, and write it.
String templateFile = joinPath(this.expressionTemplateDirectory, tdesc[0] + ".txt");
String templateString = readFile(templateFile);
templateString = templateString.replaceAll("<ClassName>", className);
templateString = templateString.replaceAll("<InputColumnVectorType>", inputColumnVectorType);
templateString = templateString.replaceAll("<OperandType>", operandType);
templateString = templateString.replaceAll("<OptionalNot>", optionalNot);

writeFile(outputFile, templateString);
}

private void generateColumnCompareColumn(String[] tdesc) throws IOException {
//The variables are all same as ColumnCompareScalar except that
//this template doesn't need a return type. Pass anything as return type.
Expand Down
50 changes: 0 additions & 50 deletions beeline/build.xml

This file was deleted.

55 changes: 0 additions & 55 deletions beeline/ivy.xml

This file was deleted.

Loading

0 comments on commit 6bfef3d

Please sign in to comment.