You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by ad...@apache.org on 2015/01/07 12:07:42 UTC
[1/3] drill git commit: DRILL-1919: Running DRILL with JRE results in
failure with ambiguous errors
Repository: drill
Updated Branches:
refs/heads/master 363d30b54 -> 5cdd71986
DRILL-1919: Running DRILL with JRE results in failure with ambiguous errors
Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/8a9f02a0
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/8a9f02a0
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/8a9f02a0
Branch: refs/heads/master
Commit: 8a9f02a084a7faab503692c7271803cd88ce05fb
Parents: 363d30b
Author: Aditya Kishore <ad...@apache.org>
Authored: Thu Jan 1 23:48:14 2015 -0800
Committer: Aditya Kishore <ad...@apache.org>
Committed: Wed Jan 7 02:29:48 2015 -0800
----------------------------------------------------------------------
.../apache/drill/exec/compile/JDKClassCompiler.java | 14 ++++++++++----
.../apache/drill/exec/compile/QueryClassLoader.java | 5 +++--
2 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/drill/blob/8a9f02a0/exec/java-exec/src/main/java/org/apache/drill/exec/compile/JDKClassCompiler.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/compile/JDKClassCompiler.java b/exec/java-exec/src/main/java/org/apache/drill/exec/compile/JDKClassCompiler.java
index 2e101dc..ecd222d 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/compile/JDKClassCompiler.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/compile/JDKClassCompiler.java
@@ -41,12 +41,18 @@ class JDKClassCompiler extends AbstractClassCompiler {
private final JavaCompiler compiler;
private final DrillJavaFileManager fileManager;
- public JDKClassCompiler(ClassLoader classLoader, boolean debug) {
- super(debug);
- this.compiler = ToolProvider.getSystemJavaCompiler();
+ public static JDKClassCompiler newInstance(ClassLoader classLoader, boolean debug) {
+ JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
if (compiler == null) {
- throw new UnsupportedOperationException("JDK Java compiler not available - probably you're running a JRE, not a JDK");
+ logger.warn("JDK Java compiler not available - probably you're running Drill with a JRE and not a JDK");
+ return null;
}
+ return new JDKClassCompiler(compiler, classLoader, debug);
+ }
+
+ private JDKClassCompiler(JavaCompiler compiler, ClassLoader classLoader, boolean debug) {
+ super(debug);
+ this.compiler = compiler;
this.listener = new DrillDiagnosticListener();
this.fileManager = new DrillJavaFileManager(compiler.getStandardFileManager(listener, null, Charsets.UTF_8), classLoader);
this.compilerOptions = Lists.newArrayList(this.debug ? "-g:source,lines,vars" : "-g:none");
http://git-wip-us.apache.org/repos/asf/drill/blob/8a9f02a0/exec/java-exec/src/main/java/org/apache/drill/exec/compile/QueryClassLoader.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/compile/QueryClassLoader.java b/exec/java-exec/src/main/java/org/apache/drill/exec/compile/QueryClassLoader.java
index e1ac7a8..065c3c8 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/compile/QueryClassLoader.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/compile/QueryClassLoader.java
@@ -125,13 +125,14 @@ public class QueryClassLoader extends URLClassLoader {
boolean debug = (value != null) ? value.bool_val : config.getBoolean(JAVA_COMPILER_DEBUG_CONFIG);
this.janinoClassCompiler = (policy == CompilerPolicy.JANINO || policy == CompilerPolicy.DEFAULT) ? new JaninoClassCompiler(QueryClassLoader.this, debug) : null;
- this.jdkClassCompiler = (policy == CompilerPolicy.JDK || policy == CompilerPolicy.DEFAULT) ? new JDKClassCompiler(QueryClassLoader.this, debug) : null;
+ this.jdkClassCompiler = (policy == CompilerPolicy.JDK || policy == CompilerPolicy.DEFAULT) ? JDKClassCompiler.newInstance(QueryClassLoader.this, debug) : null;
}
private byte[][] getClassByteCode(ClassNames className, String sourceCode)
throws CompileException, ClassNotFoundException, ClassTransformationException, IOException {
AbstractClassCompiler classCompiler;
- if (policy == CompilerPolicy.JDK || (policy == CompilerPolicy.DEFAULT && sourceCode.length() > janinoThreshold)) {
+ if (jdkClassCompiler != null &&
+ (policy == CompilerPolicy.JDK || (policy == CompilerPolicy.DEFAULT && sourceCode.length() > janinoThreshold))) {
classCompiler = jdkClassCompiler;
} else {
classCompiler = janinoClassCompiler;
[3/3] drill git commit: DRILL-1935: Use single quote around encoding
type in ExpressionStringBuilder.visitConvertExpression()
Posted by ad...@apache.org.
DRILL-1935: Use single quote around encoding type in ExpressionStringBuilder.visitConvertExpression()
Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/5cdd7198
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/5cdd7198
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/5cdd7198
Branch: refs/heads/master
Commit: 5cdd71986e4589c1a3f95a3c3c4200722e562dae
Parents: eced8bb
Author: Aditya Kishore <ad...@apache.org>
Authored: Mon Jan 5 21:59:05 2015 -0800
Committer: Aditya Kishore <ad...@apache.org>
Committed: Wed Jan 7 02:30:42 2015 -0800
----------------------------------------------------------------------
.../apache/drill/common/expression/ExpressionStringBuilder.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/drill/blob/5cdd7198/common/src/main/java/org/apache/drill/common/expression/ExpressionStringBuilder.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/expression/ExpressionStringBuilder.java b/common/src/main/java/org/apache/drill/common/expression/ExpressionStringBuilder.java
index 405ac06..d3839ed 100644
--- a/common/src/main/java/org/apache/drill/common/expression/ExpressionStringBuilder.java
+++ b/common/src/main/java/org/apache/drill/common/expression/ExpressionStringBuilder.java
@@ -223,7 +223,7 @@ public class ExpressionStringBuilder extends AbstractExprVisitor<Void, StringBui
public Void visitConvertExpression(ConvertExpression e, StringBuilder sb) throws RuntimeException {
sb.append(e.getConvertFunction()).append("(");
e.getInput().accept(this, sb);
- sb.append(", \"").append(e.getEncodingType()).append("\")");
+ sb.append(", '").append(e.getEncodingType()).append("')");
return null;
}
[2/3] drill git commit: DRILL-1931: byte_substr() does not set the
'start' field of output holder correctly
Posted by ad...@apache.org.
DRILL-1931: byte_substr() does not set the 'start' field of output holder correctly
Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/eced8bbd
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/eced8bbd
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/eced8bbd
Branch: refs/heads/master
Commit: eced8bbdbd6f8f6a7d884a6ff00d09e8e888d319
Parents: 8a9f02a
Author: Aditya Kishore <ad...@apache.org>
Authored: Mon Jan 5 14:39:31 2015 -0800
Committer: Aditya Kishore <ad...@apache.org>
Committed: Wed Jan 7 02:30:20 2015 -0800
----------------------------------------------------------------------
.../drill/exec/expr/fn/impl/ByteSubstring.java | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/drill/blob/eced8bbd/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ByteSubstring.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ByteSubstring.java b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ByteSubstring.java
index 55dc35a..8831d98 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ByteSubstring.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/ByteSubstring.java
@@ -46,7 +46,7 @@ import org.apache.drill.exec.record.RecordBatch;
nulls = FunctionTemplate.NullHandling.NULL_IF_NULL)
public class ByteSubstring implements DrillSimpleFunc {
- @Param VarBinaryHolder string;
+ @Param VarBinaryHolder in;
@Param BigIntHolder offset;
@Param BigIntHolder length;
@Output VarBinaryHolder out;
@@ -56,30 +56,25 @@ public class ByteSubstring implements DrillSimpleFunc {
@Override
public void eval() {
- out.buffer = string.buffer;
+ out.buffer = in.buffer;
// handle invalid values; e.g. SUBSTRING(value, 0, x) or SUBSTRING(value, x, 0)
if (offset.value == 0 || length.value <= 0) {
-
out.start = 0;
out.end = 0;
-
} else {
-
// handle negative and positive offset values
if (offset.value < 0) {
- out.start = string.end + (int)offset.value;
+ out.start = in.end + (int)offset.value;
} else {
- out.start = (int)offset.value - 1;
+ out.start = in.start + (int)offset.value - 1;
}
-
// calculate end position from length and truncate to upper value bounds
- if (out.start + length.value > string.end) {
- out.end = string.end;
+ if (out.start + length.value > in.end) {
+ out.end = in.end;
} else {
out.end = out.start + (int)length.value;
}
-
}
}