[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16473231#comment-16473231
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

amansinha100 closed pull request #1225: DRILL-6272: Refactor dynamic UDFs and 
function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/common/src/test/java/org/apache/drill/test/TestTools.java 
b/common/src/test/java/org/apache/drill/test/TestTools.java
index 8cf7ca7c42..2735c54379 100644
--- a/common/src/test/java/org/apache/drill/test/TestTools.java
+++ b/common/src/test/java/org/apache/drill/test/TestTools.java
@@ -47,7 +47,7 @@
 .indexOf("-agentlib:jdwp") > 0;
 
   public static TestRule getTimeoutRule(int timeout) {
-return IS_DEBUG ? new TestName() : new Timeout(timeout);
+return IS_DEBUG ? new TestName() : Timeout.millis(timeout);
   }
 
   /**
diff --git a/exec/java-exec/pom.xml b/exec/java-exec/pom.xml
index cbc3a02aa6..345e240143 100644
--- a/exec/java-exec/pom.xml
+++ b/exec/java-exec/pom.xml
@@ -584,6 +584,54 @@
   netty-tcnative
   ${netty.tcnative.classifier}
 
+
+  org.apache.maven
+  maven-embedder
+  3.5.3
+  test
+
+
+  org.apache.maven
+  maven-compat
+  3.5.3
+  test
+
+
+  org.eclipse.aether
+  aether-connector-basic
+  1.1.0
+  test
+
+
+  org.eclipse.aether
+  aether-transport-wagon
+  1.1.0
+  test
+
+
+  org.apache.maven.wagon
+  wagon-http
+  3.0.0
+  test
+  
+
+  commons-logging
+  commons-logging
+
+  
+
+
+  org.apache.maven.wagon
+  wagon-provider-api
+  3.0.0
+  test
+  
+
+  commons-logging
+  commons-logging
+
+  
+
   
 
   
diff --git 
a/exec/java-exec/src/test/java/org/apache/drill/TestTpchDistributedConcurrent.java
 
b/exec/java-exec/src/test/java/org/apache/drill/TestTpchDistributedConcurrent.java
index 8991b8b10a..74b9a5ceb6 100644
--- 
a/exec/java-exec/src/test/java/org/apache/drill/TestTpchDistributedConcurrent.java
+++ 
b/exec/java-exec/src/test/java/org/apache/drill/TestTpchDistributedConcurrent.java
@@ -33,6 +33,7 @@
 import org.apache.drill.test.BaseTestQuery;
 import org.apache.drill.test.QueryTestUtil;
 import org.junit.Rule;
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.rules.TestRule;
 
@@ -176,7 +177,7 @@ public void run() {
 }
   }
 
-  //@Test
+  @Test
   public void testConcurrentQueries() throws Exception {
 QueryTestUtil.testRunAndPrint(client, UserBitShared.QueryType.SQL, 
alterSession);
 
diff --git 
a/exec/java-exec/src/test/java/org/apache/drill/exec/coord/zk/TestZookeeperClient.java
 
b/exec/java-exec/src/test/java/org/apache/drill/exec/coord/zk/TestZookeeperClient.java
index 87cf72d30f..e0e6c79905 100644
--- 
a/exec/java-exec/src/test/java/org/apache/drill/exec/coord/zk/TestZookeeperClient.java
+++ 
b/exec/java-exec/src/test/java/org/apache/drill/exec/coord/zk/TestZookeeperClient.java
@@ -125,7 +125,7 @@ public void testHasPathThrowsDrillRuntimeException() {
 
 Mockito
 .when(client.getCache().getCurrentData(absPath))
-.thenThrow(Exception.class);
+.thenThrow(RuntimeException.class);
 
 client.hasPath(path);
   }
diff --git 
a/exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/FunctionInitializerTest.java
 
b/exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/FunctionInitializerTest.java
index 7c10bd3ca9..2ecb8a0c75 100644
--- 
a/exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/FunctionInitializerTest.java
+++ 
b/exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/FunctionInitializerTest.java
@@ -19,20 +19,20 @@
 
 import com.google.common.collect.Lists;
 import org.apache.drill.categories.SqlFunctionTest;
-import org.apache.drill.test.TestTools;
+import org.apache.drill.exec.udf.dynamic.JarBuilder;
 import org.apache.drill.exec.util.JarUtil;
 import org.codehaus.janino.Java.CompilationUnit;
 import org.junit.BeforeClass;
+import org.junit.ClassRule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.runners.MockitoJUnitRunner;
-import org.mockito.stubbing.Answer;
+import org.junit.rules.TemporaryFolder;
 
+import java.io.File;
+import java.io.IOException;
 import java.net.URL;
 import java.net.URLClassLoader;
-import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.Collections;
 import 

[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16473165#comment-16473165
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

arina-ielchiieva commented on a change in pull request #1225: DRILL-6272: 
Refactor dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r187776634
 
 

 ##
 File path: common/src/test/java/org/apache/drill/test/TestTools.java
 ##
 @@ -47,7 +48,7 @@
 .indexOf("-agentlib:jdwp") > 0;
 
   public static TestRule getTimeoutRule(int timeout) {
-return IS_DEBUG ? new TestName() : new Timeout(timeout);
+return IS_DEBUG ? new TestName() : new Timeout(timeout, 
TimeUnit.MILLISECONDS);
 
 Review comment:
   Sure, 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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
>  Labels: ready-to-commit
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16473153#comment-16473153
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r187775637
 
 

 ##
 File path: common/src/test/java/org/apache/drill/test/TestTools.java
 ##
 @@ -47,7 +48,7 @@
 .indexOf("-agentlib:jdwp") > 0;
 
   public static TestRule getTimeoutRule(int timeout) {
-return IS_DEBUG ? new TestName() : new Timeout(timeout);
+return IS_DEBUG ? new TestName() : new Timeout(timeout, 
TimeUnit.MILLISECONDS);
 
 Review comment:
   `Timeout.millis(timeout)`?


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
>  Labels: ready-to-commit
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16473152#comment-16473152
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r187775637
 
 

 ##
 File path: common/src/test/java/org/apache/drill/test/TestTools.java
 ##
 @@ -47,7 +48,7 @@
 .indexOf("-agentlib:jdwp") > 0;
 
   public static TestRule getTimeoutRule(int timeout) {
-return IS_DEBUG ? new TestName() : new Timeout(timeout);
+return IS_DEBUG ? new TestName() : new Timeout(timeout, 
TimeUnit.MILLISECONDS);
 
 Review comment:
   'Timeout.millis(timeout)`?


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
>  Labels: ready-to-commit
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16473126#comment-16473126
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

arina-ielchiieva commented on issue #1225: DRILL-6272: Refactor dynamic UDFs 
and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#issuecomment-388560653
 
 
   @amansinha100 done.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
>  Labels: ready-to-commit
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16472758#comment-16472758
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

amansinha100 commented on issue #1225: DRILL-6272: Refactor dynamic UDFs and 
function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#issuecomment-388500821
 
 
   @arina-ielchiieva I encountered some merge conflicts.  Can you pls rebase on 
master ? 


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
>  Labels: ready-to-commit
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-07 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16466145#comment-16466145
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

arina-ielchiieva commented on a change in pull request #1225: DRILL-6272: 
Refactor dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r186472412
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/rpc/user/TemporaryTablesAutomaticDropTest.java
 ##
 @@ -19,39 +19,53 @@
 
 import mockit.Mock;
 import mockit.MockUp;
+import org.apache.drill.exec.store.StorageStrategy;
 import org.apache.drill.test.BaseTestQuery;
 import org.apache.drill.common.config.DrillConfig;
-import org.apache.drill.exec.ExecConstants;
 import org.apache.drill.exec.store.StoragePluginRegistry;
 import org.apache.drill.exec.util.StoragePluginTestUtils;
 import org.apache.drill.test.DirTestWatcher;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.LocatedFileStatus;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.RemoteIterator;
+import org.apache.hadoop.fs.permission.FsPermission;
 import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 import java.io.File;
-import java.util.Properties;
 import java.util.UUID;
 
 import static org.apache.drill.exec.util.StoragePluginTestUtils.DFS_TMP_SCHEMA;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 public class TemporaryTablesAutomaticDropTest extends BaseTestQuery {
 
   private static final String session_id = "sessionId";
 
+  private static FileSystem fs;
 
 Review comment:
   Nope, they are defined in `@BeforeClass` and the same for all tests.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-07 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16466147#comment-16466147
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

arina-ielchiieva commented on a change in pull request #1225: DRILL-6272: 
Refactor dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r186471096
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/udf/dynamic/JarBuilder.java
 ##
 @@ -0,0 +1,97 @@
+/*
+ * 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.drill.exec.udf.dynamic;
+
+import org.apache.maven.cli.MavenCli;
+import org.apache.maven.cli.logging.Slf4jLogger;
+import org.codehaus.plexus.DefaultPlexusContainer;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.logging.BaseLoggerManager;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+
+public class JarBuilder {
+
+  private static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(JarBuilder.class);
+  private static final String MAVEN_MULTI_MODULE_PROJECT_DIRECTORY = 
"maven.multiModuleProjectDirectory";
+
+  private final MavenCli cli;
+  private final String projectDirectory;
+
+  public JarBuilder(String projectDirectory) {
+this.cli = new MavenCli() {
+  @Override
+  protected void customizeContainer(PlexusContainer container) {
+((DefaultPlexusContainer) container).setLoggerManager(new 
BaseLoggerManager() {
+  @Override
+  protected org.codehaus.plexus.logging.Logger createLogger(String s) {
+return new Slf4jLogger(logger);
+  }
+});
+  }
+};
+this.projectDirectory = projectDirectory;
+  }
+
+  /**
+   * Builds jars using embedded maven in provided build directory.
+   * Includes files / resources based given pattern, otherwise using defaults 
provided in pom.xml.
+   * Checks if build exit code is 0, i.e. build was successful.
+   *
+   * @param jarName jar name
+   * @param buildDirectory build directory
+   * @param includeFiles pattern indicating which files should be included
+   * @param includeResources pattern indicating which resources should be 
included
+   *
+   * @return binary jar name with jar extension (my-jar.jar)
+   */
+  public String build(String jarName, String buildDirectory, String 
includeFiles, String includeResources) {
+String originalPropertyValue = null;
+try {
+  originalPropertyValue = 
System.setProperty(MAVEN_MULTI_MODULE_PROJECT_DIRECTORY, projectDirectory);
 
 Review comment:
   Done.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-07 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16466146#comment-16466146
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

arina-ielchiieva commented on a change in pull request #1225: DRILL-6272: 
Refactor dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r186472868
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/udf/dynamic/JarBuilder.java
 ##
 @@ -0,0 +1,97 @@
+/*
+ * 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.drill.exec.udf.dynamic;
+
+import org.apache.maven.cli.MavenCli;
+import org.apache.maven.cli.logging.Slf4jLogger;
+import org.codehaus.plexus.DefaultPlexusContainer;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.logging.BaseLoggerManager;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+
+public class JarBuilder {
+
+  private static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(JarBuilder.class);
+  private static final String MAVEN_MULTI_MODULE_PROJECT_DIRECTORY = 
"maven.multiModuleProjectDirectory";
+
+  private final MavenCli cli;
+  private final String projectDirectory;
+
+  public JarBuilder(String projectDirectory) {
+this.cli = new MavenCli() {
+  @Override
+  protected void customizeContainer(PlexusContainer container) {
+((DefaultPlexusContainer) container).setLoggerManager(new 
BaseLoggerManager() {
+  @Override
+  protected org.codehaus.plexus.logging.Logger createLogger(String s) {
+return new Slf4jLogger(logger);
+  }
+});
+  }
+};
+this.projectDirectory = projectDirectory;
+  }
+
+  /**
+   * Builds jars using embedded maven in provided build directory.
+   * Includes files / resources based given pattern, otherwise using defaults 
provided in pom.xml.
+   * Checks if build exit code is 0, i.e. build was successful.
+   *
+   * @param jarName jar name
+   * @param buildDirectory build directory
+   * @param includeFiles pattern indicating which files should be included
+   * @param includeResources pattern indicating which resources should be 
included
+   *
+   * @return binary jar name with jar extension (my-jar.jar)
+   */
+  public String build(String jarName, String buildDirectory, String 
includeFiles, String includeResources) {
+String originalPropertyValue = null;
+try {
+  originalPropertyValue = 
System.setProperty(MAVEN_MULTI_MODULE_PROJECT_DIRECTORY, projectDirectory);
+  List params = new LinkedList<>();
+  params.add("clean");
+  params.add("package");
+  params.add("-DskipTests");
+  // uncomment to build with current Drill version
+  // params.add("-Ddrill.version=" + DrillVersionInfo.getVersion());
+  params.add("-Djar.finalName=" + jarName);
+  params.add("-Dcustom.buildDirectory=" + buildDirectory);
+  if (includeFiles != null) {
+params.add("-Dinclude.files=" + includeFiles);
+  }
+  if (includeResources != null) {
+params.add("-Dinclude.resources=" + includeResources);
+  }
+  int result = cli.doMain(params.toArray(new String[params.size()]), 
projectDirectory, System.out, System.err);
+  assertEquals("Build should be successful.", 0, result);
+  return jarName + ".jar";
+} finally {
+   if (originalPropertyValue != null) {
 
 Review comment:
   Done.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina 

[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-07 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16466144#comment-16466144
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

arina-ielchiieva commented on a change in pull request #1225: DRILL-6272: 
Refactor dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r186471937
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/rpc/user/TemporaryTablesAutomaticDropTest.java
 ##
 @@ -19,39 +19,53 @@
 
 import mockit.Mock;
 import mockit.MockUp;
+import org.apache.drill.exec.store.StorageStrategy;
 import org.apache.drill.test.BaseTestQuery;
 import org.apache.drill.common.config.DrillConfig;
-import org.apache.drill.exec.ExecConstants;
 import org.apache.drill.exec.store.StoragePluginRegistry;
 import org.apache.drill.exec.util.StoragePluginTestUtils;
 import org.apache.drill.test.DirTestWatcher;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.LocatedFileStatus;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.RemoteIterator;
+import org.apache.hadoop.fs.permission.FsPermission;
 import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 import java.io.File;
-import java.util.Properties;
 import java.util.UUID;
 
 import static org.apache.drill.exec.util.StoragePluginTestUtils.DFS_TMP_SCHEMA;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 public class TemporaryTablesAutomaticDropTest extends BaseTestQuery {
 
   private static final String session_id = "sessionId";
 
 Review comment:
   Replaced it to `UUID.randomUUID()`.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-07 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16466148#comment-16466148
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

arina-ielchiieva commented on a change in pull request #1225: DRILL-6272: 
Refactor dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r186472632
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/rpc/user/TemporaryTablesAutomaticDropTest.java
 ##
 @@ -19,39 +19,53 @@
 
 import mockit.Mock;
 import mockit.MockUp;
+import org.apache.drill.exec.store.StorageStrategy;
 import org.apache.drill.test.BaseTestQuery;
 import org.apache.drill.common.config.DrillConfig;
-import org.apache.drill.exec.ExecConstants;
 import org.apache.drill.exec.store.StoragePluginRegistry;
 import org.apache.drill.exec.util.StoragePluginTestUtils;
 import org.apache.drill.test.DirTestWatcher;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.LocatedFileStatus;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.RemoteIterator;
+import org.apache.hadoop.fs.permission.FsPermission;
 import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 import java.io.File;
-import java.util.Properties;
 import java.util.UUID;
 
 import static org.apache.drill.exec.util.StoragePluginTestUtils.DFS_TMP_SCHEMA;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 public class TemporaryTablesAutomaticDropTest extends BaseTestQuery {
 
   private static final String session_id = "sessionId";
 
+  private static FileSystem fs;
+  private static FsPermission expectedFolderPermission;
+  private static FsPermission expectedFilePermission;
+
+  @BeforeClass
+  public static void init() throws Exception {
+fs = getLocalFileSystem();
+expectedFolderPermission = new 
FsPermission(StorageStrategy.TEMPORARY.getFolderPermission());
+expectedFilePermission = new 
FsPermission(StorageStrategy.TEMPORARY.getFilePermission());
+  }
+
   @Before
-  public void setup() throws Exception {
+  public void setup() {
 
 Review comment:
   Unfortunately, yes. It turned out that there is no good way to retrieve 
session information in tests. Sorry for confusion.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16465358#comment-16465358
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r186313443
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/udf/dynamic/JarBuilder.java
 ##
 @@ -0,0 +1,97 @@
+/*
+ * 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.drill.exec.udf.dynamic;
+
+import org.apache.maven.cli.MavenCli;
+import org.apache.maven.cli.logging.Slf4jLogger;
+import org.codehaus.plexus.DefaultPlexusContainer;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.logging.BaseLoggerManager;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+
+public class JarBuilder {
+
+  private static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(JarBuilder.class);
+  private static final String MAVEN_MULTI_MODULE_PROJECT_DIRECTORY = 
"maven.multiModuleProjectDirectory";
+
+  private final MavenCli cli;
+  private final String projectDirectory;
+
+  public JarBuilder(String projectDirectory) {
+this.cli = new MavenCli() {
+  @Override
+  protected void customizeContainer(PlexusContainer container) {
+((DefaultPlexusContainer) container).setLoggerManager(new 
BaseLoggerManager() {
+  @Override
+  protected org.codehaus.plexus.logging.Logger createLogger(String s) {
+return new Slf4jLogger(logger);
+  }
+});
+  }
+};
+this.projectDirectory = projectDirectory;
+  }
+
+  /**
+   * Builds jars using embedded maven in provided build directory.
+   * Includes files / resources based given pattern, otherwise using defaults 
provided in pom.xml.
+   * Checks if build exit code is 0, i.e. build was successful.
+   *
+   * @param jarName jar name
+   * @param buildDirectory build directory
+   * @param includeFiles pattern indicating which files should be included
+   * @param includeResources pattern indicating which resources should be 
included
+   *
+   * @return binary jar name with jar extension (my-jar.jar)
+   */
+  public String build(String jarName, String buildDirectory, String 
includeFiles, String includeResources) {
+String originalPropertyValue = null;
+try {
+  originalPropertyValue = 
System.setProperty(MAVEN_MULTI_MODULE_PROJECT_DIRECTORY, projectDirectory);
 
 Review comment:
   Do not split into two assignments. Move `System.setProperty()` call outside 
of try/finally block.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16465357#comment-16465357
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r186313035
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/udf/dynamic/JarBuilder.java
 ##
 @@ -0,0 +1,97 @@
+/*
+ * 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.drill.exec.udf.dynamic;
+
+import org.apache.maven.cli.MavenCli;
+import org.apache.maven.cli.logging.Slf4jLogger;
+import org.codehaus.plexus.DefaultPlexusContainer;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.logging.BaseLoggerManager;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+
+public class JarBuilder {
+
+  private static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(JarBuilder.class);
+  private static final String MAVEN_MULTI_MODULE_PROJECT_DIRECTORY = 
"maven.multiModuleProjectDirectory";
+
+  private final MavenCli cli;
+  private final String projectDirectory;
+
+  public JarBuilder(String projectDirectory) {
+this.cli = new MavenCli() {
+  @Override
+  protected void customizeContainer(PlexusContainer container) {
+((DefaultPlexusContainer) container).setLoggerManager(new 
BaseLoggerManager() {
+  @Override
+  protected org.codehaus.plexus.logging.Logger createLogger(String s) {
+return new Slf4jLogger(logger);
+  }
+});
+  }
+};
+this.projectDirectory = projectDirectory;
+  }
+
+  /**
+   * Builds jars using embedded maven in provided build directory.
+   * Includes files / resources based given pattern, otherwise using defaults 
provided in pom.xml.
+   * Checks if build exit code is 0, i.e. build was successful.
+   *
+   * @param jarName jar name
+   * @param buildDirectory build directory
+   * @param includeFiles pattern indicating which files should be included
+   * @param includeResources pattern indicating which resources should be 
included
+   *
+   * @return binary jar name with jar extension (my-jar.jar)
+   */
+  public String build(String jarName, String buildDirectory, String 
includeFiles, String includeResources) {
+String originalPropertyValue = null;
+try {
+  originalPropertyValue = 
System.setProperty(MAVEN_MULTI_MODULE_PROJECT_DIRECTORY, projectDirectory);
+  List params = new LinkedList<>();
+  params.add("clean");
+  params.add("package");
+  params.add("-DskipTests");
+  // uncomment to build with current Drill version
+  // params.add("-Ddrill.version=" + DrillVersionInfo.getVersion());
+  params.add("-Djar.finalName=" + jarName);
+  params.add("-Dcustom.buildDirectory=" + buildDirectory);
+  if (includeFiles != null) {
+params.add("-Dinclude.files=" + includeFiles);
+  }
+  if (includeResources != null) {
+params.add("-Dinclude.resources=" + includeResources);
+  }
+  int result = cli.doMain(params.toArray(new String[params.size()]), 
projectDirectory, System.out, System.err);
+  assertEquals("Build should be successful.", 0, result);
+  return jarName + ".jar";
+} finally {
+   if (originalPropertyValue != null) {
 
 Review comment:
   Please fix indentation.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina 

[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16465352#comment-16465352
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r186311741
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/rpc/user/TemporaryTablesAutomaticDropTest.java
 ##
 @@ -19,39 +19,53 @@
 
 import mockit.Mock;
 import mockit.MockUp;
+import org.apache.drill.exec.store.StorageStrategy;
 import org.apache.drill.test.BaseTestQuery;
 import org.apache.drill.common.config.DrillConfig;
-import org.apache.drill.exec.ExecConstants;
 import org.apache.drill.exec.store.StoragePluginRegistry;
 import org.apache.drill.exec.util.StoragePluginTestUtils;
 import org.apache.drill.test.DirTestWatcher;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.LocatedFileStatus;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.RemoteIterator;
+import org.apache.hadoop.fs.permission.FsPermission;
 import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 import java.io.File;
-import java.util.Properties;
 import java.util.UUID;
 
 import static org.apache.drill.exec.util.StoragePluginTestUtils.DFS_TMP_SCHEMA;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 public class TemporaryTablesAutomaticDropTest extends BaseTestQuery {
 
   private static final String session_id = "sessionId";
 
 Review comment:
   In case mocking is required, consider replacing String with UUID: `uuid = 
UUID.nameUUIDFromBytes(session_id.getBytes())`


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16465353#comment-16465353
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r186311239
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/rpc/user/TemporaryTablesAutomaticDropTest.java
 ##
 @@ -19,39 +19,53 @@
 
 import mockit.Mock;
 import mockit.MockUp;
+import org.apache.drill.exec.store.StorageStrategy;
 import org.apache.drill.test.BaseTestQuery;
 import org.apache.drill.common.config.DrillConfig;
-import org.apache.drill.exec.ExecConstants;
 import org.apache.drill.exec.store.StoragePluginRegistry;
 import org.apache.drill.exec.util.StoragePluginTestUtils;
 import org.apache.drill.test.DirTestWatcher;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.LocatedFileStatus;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.RemoteIterator;
+import org.apache.hadoop.fs.permission.FsPermission;
 import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 import java.io.File;
-import java.util.Properties;
 import java.util.UUID;
 
 import static org.apache.drill.exec.util.StoragePluginTestUtils.DFS_TMP_SCHEMA;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 public class TemporaryTablesAutomaticDropTest extends BaseTestQuery {
 
   private static final String session_id = "sessionId";
 
+  private static FileSystem fs;
 
 Review comment:
   Can `fs` and permissions be declared as local variables?


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16465351#comment-16465351
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r186311664
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/rpc/user/TemporaryTablesAutomaticDropTest.java
 ##
 @@ -19,39 +19,53 @@
 
 import mockit.Mock;
 import mockit.MockUp;
+import org.apache.drill.exec.store.StorageStrategy;
 import org.apache.drill.test.BaseTestQuery;
 import org.apache.drill.common.config.DrillConfig;
-import org.apache.drill.exec.ExecConstants;
 import org.apache.drill.exec.store.StoragePluginRegistry;
 import org.apache.drill.exec.util.StoragePluginTestUtils;
 import org.apache.drill.test.DirTestWatcher;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.LocatedFileStatus;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.RemoteIterator;
+import org.apache.hadoop.fs.permission.FsPermission;
 import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 import java.io.File;
-import java.util.Properties;
 import java.util.UUID;
 
 import static org.apache.drill.exec.util.StoragePluginTestUtils.DFS_TMP_SCHEMA;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 public class TemporaryTablesAutomaticDropTest extends BaseTestQuery {
 
   private static final String session_id = "sessionId";
 
+  private static FileSystem fs;
+  private static FsPermission expectedFolderPermission;
+  private static FsPermission expectedFilePermission;
+
+  @BeforeClass
+  public static void init() throws Exception {
+fs = getLocalFileSystem();
+expectedFolderPermission = new 
FsPermission(StorageStrategy.TEMPORARY.getFolderPermission());
+expectedFilePermission = new 
FsPermission(StorageStrategy.TEMPORARY.getFilePermission());
+  }
+
   @Before
-  public void setup() throws Exception {
+  public void setup() {
 
 Review comment:
   Is it necessary to mock `UUID`?. You mentioned that there is a way to get 
sessionId from UserSession.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-05 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16464828#comment-16464828
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

arina-ielchiieva commented on issue #1225: DRILL-6272: Refactor dynamic UDFs 
and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#issuecomment-386817536
 
 
   @vrozov done all the changes. One point regarding using current drill 
snapshot version as dependency when building jars. I decided to leave it 
hard-coded to 1.13.0  because `mvn clean install` with clean local maven repo 
succeeds since 1.13.0 is downloaded from central mvn repo. If we use 
1.14.0-SNAPSHOT, build fails because this version is absent in central maven 
repo and in local, in other words to run unit tests on new snapshot version, we 
would have to build the project first which is not acceptable especially  since 
currently we are not obliged to it.
   Left the following comment in code, in case somebody what to build jars with 
current version:
   ```
 // uncomment to build with current Drill version
 // params.add("-Ddrill.version=" + DrillVersionInfo.getVersion());
   ```


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16463183#comment-16463183
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185960865
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/udf/dynamic/TestDynamicUDFSupport.java
 ##
 @@ -76,23 +73,35 @@
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 
-@RunWith(MockitoJUnitRunner.class)
 @Category({SlowTest.class, SqlFunctionTest.class})
 public class TestDynamicUDFSupport extends BaseTestQuery {
+  private static final String DEFAULT_JAR_NAME = "drill-custom-lower";
 
-  private static final Path jars = TestTools.WORKING_PATH
-.resolve(TestTools.TEST_RESOURCES)
-.resolve("jars");
-  private static final String default_binary_name = "DrillUDF-1.0.jar";
-  private static final String UDF_SUB_DIR = "udf";
-  private static final String default_source_name = 
JarUtil.getSourceName(default_binary_name);
   private static URI fsUri;
   private static File udfDir;
+  private static File jarsDir;
+  private static File buildDirectory;
+  private static JarBuilder jarBuilder;
+
+  private static String defaultBinaryJar;
+  private static String defaultSourceJar;
 
   @BeforeClass
-  public static void setup() throws IOException {
-udfDir = dirTestWatcher.makeSubDir(Paths.get(UDF_SUB_DIR));
+  public static void buildAndStoreDefaultJars() throws IOException {
+jarsDir = dirTestWatcher.makeSubDir(Paths.get("jars"));
+buildDirectory = dirTestWatcher.makeSubDir(Paths.get("drill-udf"));
+
+jarBuilder = new JarBuilder("src/test/resources/drill-udf");
+defaultBinaryJar = buildJars(DEFAULT_JAR_NAME, 
"**/CustomLowerFunction.java", null);
+defaultSourceJar = JarUtil.getSourceName(defaultBinaryJar);
+
+FileUtils.copyFileToDirectory(new File(buildDirectory, defaultBinaryJar), 
jarsDir);
+FileUtils.copyFileToDirectory(new File(buildDirectory, defaultSourceJar), 
jarsDir);
+  }
 
+  @BeforeClass
 
 Review comment:
   Consider `@Before` instead of calling it from `reset()`.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16463185#comment-16463185
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185938976
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestCTTAS.java
 ##
 @@ -164,121 +161,92 @@ public void 
testResolveTemporaryTableWithPartialSchema() throws Exception {
   @Test
   public void testPartitionByWithTemporaryTables() throws Exception {
 String temporaryTableName = "temporary_table_with_partitions";
-mockRandomUUID(UUID.nameUUIDFromBytes(temporaryTableName.getBytes()));
 test("create TEMPORARY table %s partition by (c1) as select * from (" +
 "select 'A' as c1 from (values(1)) union all select 'B' as c1 from 
(values(1))) t", temporaryTableName);
 checkPermission(temporaryTableName);
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreationOutsideOfDefaultTemporaryWorkspace() throws 
Exception {
-try {
-  String temporaryTableName = 
"temporary_table_outside_of_default_workspace";
-  test("create TEMPORARY table %s.%s as select 'A' as c1 from 
(values(1))", temp2_schema, temporaryTableName);
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
-  "VALIDATION ERROR: Temporary tables are not allowed to be created / 
dropped " +
-  "outside of default temporary workspace [%s].", 
DFS_TMP_SCHEMA)));
-  throw e;
-}
+String temporaryTableName = "temporary_table_outside_of_default_workspace";
+
+expectUserRemoteExceptionWithMessage(String.format(
+  "VALIDATION ERROR: Temporary tables are not allowed to be created / 
dropped " +
+"outside of default temporary workspace [%s].", DFS_TMP_SCHEMA));
+
+test("create TEMPORARY table %s.%s as select 'A' as c1 from (values(1))", 
temp2_schema, temporaryTableName);
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreateWhenTemporaryTableExistsWithoutSchema() throws 
Exception {
 String temporaryTableName = "temporary_table_exists_without_schema";
-try {
-  test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
-  test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
- "VALIDATION ERROR: A table or view with given name [%s]" +
- " already exists in schema [%s]", temporaryTableName, 
DFS_TMP_SCHEMA)));
-  throw e;
-}
+test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
+
+expectUserRemoteExceptionWithTableExistsMessage(temporaryTableName, 
DFS_TMP_SCHEMA);
+
+test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreateWhenTemporaryTableExistsCaseInsensitive() throws 
Exception {
-String temporaryTableName = "temporary_table_exists_without_schema";
-try {
-  test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
-  test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName.toUpperCase());
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
-  "VALIDATION ERROR: A table or view with given name [%s]" +
-  " already exists in schema [%s]", 
temporaryTableName.toUpperCase(), DFS_TMP_SCHEMA)));
-  throw e;
-}
+String temporaryTableName = "temporary_table_exists_case_insensitive";
+test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
+
+
expectUserRemoteExceptionWithTableExistsMessage(temporaryTableName.toUpperCase(),
 DFS_TMP_SCHEMA);
+
+test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName.toUpperCase());
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreateWhenTemporaryTableExistsWithSchema() throws Exception {
 String temporaryTableName = "temporary_table_exists_with_schema";
-try {
-  test("create TEMPORARY table %s.%s as select 'A' as c1 from 
(values(1))", DFS_TMP_SCHEMA, temporaryTableName);
-  test("create TEMPORARY table %s.%s as select 'A' as c1 from 
(values(1))", DFS_TMP_SCHEMA, temporaryTableName);
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
-  "VALIDATION ERROR: A table or view with given name [%s]" +
-  " already 

[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16463184#comment-16463184
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185940559
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/udf/dynamic/JarBuilder.java
 ##
 @@ -0,0 +1,97 @@
+/*
+ * 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.drill.exec.udf.dynamic;
+
+import org.apache.drill.common.util.DrillVersionInfo;
+import org.apache.maven.cli.MavenCli;
+import org.apache.maven.cli.logging.Slf4jLogger;
+import org.codehaus.plexus.DefaultPlexusContainer;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.logging.BaseLoggerManager;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+
+public class JarBuilder {
+
+  private static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(JarBuilder.class);
+  private static final String MAVEN_MULTI_MODULE_PROJECT_DIRECTORY = 
"maven.multiModuleProjectDirectory";
+
+  private final MavenCli cli;
+  private final String drillVersion;
+  private final String projectDirectory;
+
+  public JarBuilder(String projectDirectory) {
+this.cli = new MavenCli() {
+  @Override
+  protected void customizeContainer(PlexusContainer container) {
+((DefaultPlexusContainer) container).setLoggerManager(new 
BaseLoggerManager() {
+  @Override
+  protected org.codehaus.plexus.logging.Logger createLogger(String s) {
+return new Slf4jLogger(logger);
+  }
+});
+  }
+};
+this.drillVersion = DrillVersionInfo.getVersion();
+this.projectDirectory = projectDirectory;
+  }
+
+  /**
+   * Builds jars using embedded maven in provided build directory.
+   * Includes files / resources based given pattern, otherwise using defaults 
provided in pom.xml.
+   * Checks if build exit code is 0, i.e. build was successful.
+   *
+   * @param jarName jar name
+   * @param buildDirectory build directory
+   * @param includeFiles pattern indicating which files should be included
+   * @param includeResources pattern indicating which resources should be 
included
+   *
+   * @return binary jar name with jar extension (my-jar.jar)
+   */
+  public String build(String jarName, String buildDirectory, String 
includeFiles, String includeResources) {
+String originalPropertyValue = 
System.getProperty(MAVEN_MULTI_MODULE_PROJECT_DIRECTORY);
+
+try {
+  System.setProperty(MAVEN_MULTI_MODULE_PROJECT_DIRECTORY, 
projectDirectory);
+  List params = new LinkedList<>();
+  params.add("clean");
+  params.add("package");
+  params.add("-DskipTests");
+  params.add("-Ddrill.version=" + drillVersion);
+  params.add("-Djar.finalName=" + jarName);
+  params.add("-Dcustom.buildDirectory=" + buildDirectory);
+  if (includeFiles != null) {
+params.add("-Dinclude.files=" + includeFiles);
+  }
+  if (includeResources != null) {
+params.add("-Dinclude.resources=" + includeResources);
+  }
+  int result = cli.doMain(params.toArray(new String[params.size()]), 
projectDirectory, System.out, System.err);
+  assertEquals("Build should be successful.", 0, result);
+  return jarName + ".jar";
+} finally {
+  if (originalPropertyValue != null) {
 
 Review comment:
   Consider `originalPropertyValue != null ? 
System.setProperty(MAVEN_MULTI_MODULE_PROJECT_DIRECTORY, originalPropertyValue) 
: System.clearProperty(MAVEN_MULTI_MODULE_PROJECT_DIRECTORY);`.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> 

[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16463186#comment-16463186
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185949798
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/udf/dynamic/TestDynamicUDFSupport.java
 ##
 @@ -101,6 +110,9 @@ public static void setup() throws IOException {
 fsUri = getLocalFileSystem().getUri();
   }
 
+  @Rule
+  public ExpectedException thrown = ExpectedException.none();
+
   @Rule
 
 Review comment:
   Is the rule necessary? Can `@After` provide the same functionality? If yes, 
please file JIRA.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16462734#comment-16462734
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

arina-ielchiieva commented on issue #1225: DRILL-6272: Refactor dynamic UDFs 
and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#issuecomment-386357042
 
 
   @vrozov addressed code review comments in two new commits. Please review.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16462733#comment-16462733
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

arina-ielchiieva commented on a change in pull request #1225: DRILL-6272: 
Refactor dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185863032
 
 

 ##
 File path: exec/java-exec/src/test/resources/drill-udf/pom.xml
 ##
 @@ -0,0 +1,90 @@
+
+
+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;>
+  4.0.0
+
+  org.apache.drill.udf
+  drill-udf
+  1.0
+
+  
+${project.name}
+1.13.0
 
 Review comment:
   Used `DrillVersionInfo.getVersion()` to pas current Drill project version to 
the build.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16462727#comment-16462727
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

arina-ielchiieva commented on a change in pull request #1225: DRILL-6272: 
Refactor dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185862112
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/udf/dynamic/JarBuilder.java
 ##
 @@ -0,0 +1,90 @@
+/*
+ * 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.drill.exec.udf.dynamic;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.Logger;
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.ConsoleAppender;
+import org.apache.maven.cli.MavenCli;
+import org.apache.maven.cli.logging.Slf4jLogger;
+import org.codehaus.plexus.DefaultPlexusContainer;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.logging.BaseLoggerManager;
+import org.slf4j.LoggerFactory;
+
+import java.util.LinkedList;
+import java.util.List;
+
+public class JarBuilder {
+
+  private final MavenCli cli;
+
+  public JarBuilder() {
+this.cli = new MavenCli() {
+  @Override
+  protected void customizeContainer(PlexusContainer container) {
+((DefaultPlexusContainer) container).setLoggerManager(new 
BaseLoggerManager() {
+  @Override
+  protected org.codehaus.plexus.logging.Logger createLogger(String s) {
+return new Slf4jLogger(setupLogger(JarBuilder.class.getName(), 
Level.INFO));
+  }
+});
+  }
+};
+  }
+
+  /**
+   * Builds jars using embedded maven. Includes files / resources based given 
pattern,
+   * otherwise using defaults provided in pom.xml.
+   *
+   * @param jarName jar name
+   * @param projectDir project dir
+   * @param includeFiles pattern indicating which files should be included
+   * @param includeResources pattern indicating which resources should be 
included
+   *
+   * @return build exit code, 0 if build was successful
+   */
+  public int build(String jarName, String projectDir, String includeFiles, 
String includeResources) {
+System.setProperty("maven.multiModuleProjectDirectory", projectDir);
+List params = new LinkedList<>();
+params.add("clean");
+params.add("package");
+params.add("-DskipTests");
+params.add("-Djar.finalName=" + jarName);
+if (includeFiles != null) {
+  params.add("-Dinclude.files=" + includeFiles);
+}
+if (includeResources != null) {
+  params.add("-Dinclude.resources=" + includeResources);
+}
+return cli.doMain(params.toArray(new String[params.size()]), projectDir, 
System.out, System.err);
+  }
+
+  private static Logger setupLogger(String string, Level logLevel) {
 
 Review comment:
   Agree, removed.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16462716#comment-16462716
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

arina-ielchiieva commented on a change in pull request #1225: DRILL-6272: 
Refactor dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185824258
 
 

 ##
 File path: exec/java-exec/src/test/resources/drill-udf/pom.xml
 ##
 @@ -0,0 +1,92 @@
+
+
+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;>
+  4.0.0
+
+  org.apache.drill.udf
+  drill-udf
+  1.0
+
+  
+${project.name}
+${project.basedir}/target
+1.13.0
+**/*.java
+**/*.conf
+  
+
+  
+
+  org.apache.drill.exec
+  drill-java-exec
+  ${drill.version}
+  compile
 
 Review comment:
   Done.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16462719#comment-16462719
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

arina-ielchiieva commented on a change in pull request #1225: DRILL-6272: 
Refactor dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185838873
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/udf/dynamic/JarBuilder.java
 ##
 @@ -0,0 +1,93 @@
+/*
+ * 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.drill.exec.udf.dynamic;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.Logger;
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.ConsoleAppender;
+import org.apache.maven.cli.MavenCli;
+import org.apache.maven.cli.logging.Slf4jLogger;
+import org.codehaus.plexus.DefaultPlexusContainer;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.logging.BaseLoggerManager;
+import org.slf4j.LoggerFactory;
+
+import java.util.LinkedList;
+import java.util.List;
+
+public class JarBuilder {
+
+  private final MavenCli cli;
+  private final String projectDirectory;
+
+  public JarBuilder(String projectDirectory) {
+this.cli = new MavenCli() {
+  @Override
+  protected void customizeContainer(PlexusContainer container) {
+((DefaultPlexusContainer) container).setLoggerManager(new 
BaseLoggerManager() {
+  @Override
+  protected org.codehaus.plexus.logging.Logger createLogger(String s) {
+return new Slf4jLogger(setupLogger(JarBuilder.class.getName(), 
Level.INFO));
+  }
+});
+  }
+};
+this.projectDirectory = projectDirectory;
+  }
+
+  /**
+   * Builds jars using embedded maven in provided build directory.
+   * Includes files / resources based given pattern, otherwise using defaults 
provided in pom.xml.
+   *
+   * @param jarName jar name
+   * @param buildDirectory build directory
+   * @param includeFiles pattern indicating which files should be included
+   * @param includeResources pattern indicating which resources should be 
included
+   *
+   * @return build exit code, 0 if build was successful
+   */
+  public int build(String jarName, String buildDirectory, String includeFiles, 
String includeResources) {
+System.setProperty("maven.multiModuleProjectDirectory", projectDirectory);
 
 Review comment:
   Done.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16462718#comment-16462718
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

arina-ielchiieva commented on a change in pull request #1225: DRILL-6272: 
Refactor dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185845102
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestCTTAS.java
 ##
 @@ -164,121 +165,93 @@ public void 
testResolveTemporaryTableWithPartialSchema() throws Exception {
   @Test
   public void testPartitionByWithTemporaryTables() throws Exception {
 String temporaryTableName = "temporary_table_with_partitions";
-mockRandomUUID(UUID.nameUUIDFromBytes(temporaryTableName.getBytes()));
+cleanSessionDirectory();
 test("create TEMPORARY table %s partition by (c1) as select * from (" +
 "select 'A' as c1 from (values(1)) union all select 'B' as c1 from 
(values(1))) t", temporaryTableName);
-checkPermission(temporaryTableName);
+checkPermission();
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreationOutsideOfDefaultTemporaryWorkspace() throws 
Exception {
-try {
-  String temporaryTableName = 
"temporary_table_outside_of_default_workspace";
-  test("create TEMPORARY table %s.%s as select 'A' as c1 from 
(values(1))", temp2_schema, temporaryTableName);
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
-  "VALIDATION ERROR: Temporary tables are not allowed to be created / 
dropped " +
-  "outside of default temporary workspace [%s].", 
DFS_TMP_SCHEMA)));
-  throw e;
-}
+String temporaryTableName = "temporary_table_outside_of_default_workspace";
+
+expectUserRemoteExceptionWithMessage(String.format(
+  "VALIDATION ERROR: Temporary tables are not allowed to be created / 
dropped " +
+"outside of default temporary workspace [%s].", DFS_TMP_SCHEMA));
+
+test("create TEMPORARY table %s.%s as select 'A' as c1 from (values(1))", 
temp2_schema, temporaryTableName);
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreateWhenTemporaryTableExistsWithoutSchema() throws 
Exception {
 String temporaryTableName = "temporary_table_exists_without_schema";
-try {
-  test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
-  test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
- "VALIDATION ERROR: A table or view with given name [%s]" +
- " already exists in schema [%s]", temporaryTableName, 
DFS_TMP_SCHEMA)));
-  throw e;
-}
+
+expectUserRemoteExceptionWithTableExistsMessage(temporaryTableName, 
DFS_TMP_SCHEMA);
 
 Review comment:
   Agree, 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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16462717#comment-16462717
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

arina-ielchiieva commented on a change in pull request #1225: DRILL-6272: 
Refactor dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185851129
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestCTTAS.java
 ##
 @@ -35,41 +39,46 @@
 import org.apache.hadoop.fs.RemoteIterator;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.junit.BeforeClass;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.ExpectedException;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.List;
+import java.util.Optional;
 import java.util.Properties;
-import java.util.UUID;
 
 import static 
org.apache.drill.exec.util.StoragePluginTestUtils.DFS_PLUGIN_NAME;
 import static org.apache.drill.exec.util.StoragePluginTestUtils.DFS_TMP_SCHEMA;
 import static org.hamcrest.CoreMatchers.containsString;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 
 @Category(SqlTest.class)
 public class TestCTTAS extends BaseTestQuery {
 
-  private static final UUID session_id = 
UUID.nameUUIDFromBytes("sessionId".getBytes());
   private static final String temp2_wk = "tmp2";
   private static final String temp2_schema = String.format("%s.%s", 
DFS_PLUGIN_NAME, temp2_wk);
 
+  private static String sessionId;
   private static FileSystem fs;
   private static FsPermission expectedFolderPermission;
   private static FsPermission expectedFilePermission;
 
+  @Rule
+  public ExpectedException thrown = ExpectedException.none();
+
   @BeforeClass
   public static void init() throws Exception {
-MockUp uuidMockUp = mockRandomUUID(session_id);
 
 Review comment:
   Yes, from user session: `userSession.resolveTemporaryTableName(tableName)`.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16461364#comment-16461364
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185578685
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/udf/dynamic/JarBuilder.java
 ##
 @@ -0,0 +1,93 @@
+/*
+ * 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.drill.exec.udf.dynamic;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.Logger;
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.ConsoleAppender;
+import org.apache.maven.cli.MavenCli;
+import org.apache.maven.cli.logging.Slf4jLogger;
+import org.codehaus.plexus.DefaultPlexusContainer;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.logging.BaseLoggerManager;
+import org.slf4j.LoggerFactory;
+
+import java.util.LinkedList;
+import java.util.List;
+
+public class JarBuilder {
+
+  private final MavenCli cli;
+  private final String projectDirectory;
+
+  public JarBuilder(String projectDirectory) {
+this.cli = new MavenCli() {
+  @Override
+  protected void customizeContainer(PlexusContainer container) {
+((DefaultPlexusContainer) container).setLoggerManager(new 
BaseLoggerManager() {
+  @Override
+  protected org.codehaus.plexus.logging.Logger createLogger(String s) {
+return new Slf4jLogger(setupLogger(JarBuilder.class.getName(), 
Level.INFO));
+  }
+});
+  }
+};
+this.projectDirectory = projectDirectory;
+  }
+
+  /**
+   * Builds jars using embedded maven in provided build directory.
+   * Includes files / resources based given pattern, otherwise using defaults 
provided in pom.xml.
+   *
+   * @param jarName jar name
+   * @param buildDirectory build directory
+   * @param includeFiles pattern indicating which files should be included
+   * @param includeResources pattern indicating which resources should be 
included
+   *
+   * @return build exit code, 0 if build was successful
+   */
+  public int build(String jarName, String buildDirectory, String includeFiles, 
String includeResources) {
+System.setProperty("maven.multiModuleProjectDirectory", projectDirectory);
 
 Review comment:
   Check if the property already set. It probably will be good to restore the 
property to it's original value.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16461346#comment-16461346
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185576063
 
 

 ##
 File path: exec/java-exec/src/test/resources/drill-udf/pom.xml
 ##
 @@ -0,0 +1,92 @@
+
+
+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;>
+  4.0.0
+
+  org.apache.drill.udf
+  drill-udf
+  1.0
+
+  
+${project.name}
+${project.basedir}/target
+1.13.0
+**/*.java
+**/*.conf
+  
+
+  
+
+  org.apache.drill.exec
+  drill-java-exec
+  ${drill.version}
+  compile
 
 Review comment:
   Should it be provided?


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16461342#comment-16461342
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185575373
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/udf/dynamic/JarBuilder.java
 ##
 @@ -0,0 +1,90 @@
+/*
+ * 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.drill.exec.udf.dynamic;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.Logger;
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.ConsoleAppender;
+import org.apache.maven.cli.MavenCli;
+import org.apache.maven.cli.logging.Slf4jLogger;
+import org.codehaus.plexus.DefaultPlexusContainer;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.logging.BaseLoggerManager;
+import org.slf4j.LoggerFactory;
+
+import java.util.LinkedList;
+import java.util.List;
+
+public class JarBuilder {
+
+  private final MavenCli cli;
+
+  public JarBuilder() {
+this.cli = new MavenCli() {
+  @Override
+  protected void customizeContainer(PlexusContainer container) {
+((DefaultPlexusContainer) container).setLoggerManager(new 
BaseLoggerManager() {
+  @Override
+  protected org.codehaus.plexus.logging.Logger createLogger(String s) {
+return new Slf4jLogger(setupLogger(JarBuilder.class.getName(), 
Level.INFO));
+  }
+});
+  }
+};
+  }
+
+  /**
+   * Builds jars using embedded maven. Includes files / resources based given 
pattern,
+   * otherwise using defaults provided in pom.xml.
+   *
+   * @param jarName jar name
+   * @param projectDir project dir
+   * @param includeFiles pattern indicating which files should be included
+   * @param includeResources pattern indicating which resources should be 
included
+   *
+   * @return build exit code, 0 if build was successful
+   */
+  public int build(String jarName, String projectDir, String includeFiles, 
String includeResources) {
+System.setProperty("maven.multiModuleProjectDirectory", projectDir);
+List params = new LinkedList<>();
+params.add("clean");
+params.add("package");
+params.add("-DskipTests");
+params.add("-Djar.finalName=" + jarName);
+if (includeFiles != null) {
+  params.add("-Dinclude.files=" + includeFiles);
+}
+if (includeResources != null) {
+  params.add("-Dinclude.resources=" + includeResources);
+}
+return cli.doMain(params.toArray(new String[params.size()]), projectDir, 
System.out, System.err);
+  }
+
+  private static Logger setupLogger(String string, Level logLevel) {
 
 Review comment:
   It should depend on log level and not be forcefully overridden. To debug, 
you have two options, either add "-X" to maven arguments or change log level 
for that logger in `logback-test.xml`.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16461322#comment-16461322
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185569901
 
 

 ##
 File path: exec/java-exec/src/test/resources/drill-udf/pom.xml
 ##
 @@ -0,0 +1,90 @@
+
+
+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;>
+  4.0.0
+
+  org.apache.drill.udf
+  drill-udf
+  1.0
+
+  
+${project.name}
+1.13.0
 
 Review comment:
   What is a reason not to use the SNAPSHOT version? Let's say somebody wants 
to introduce a new API for UDF and test it.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16461312#comment-16461312
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185568164
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestCTTAS.java
 ##
 @@ -164,121 +165,93 @@ public void 
testResolveTemporaryTableWithPartialSchema() throws Exception {
   @Test
   public void testPartitionByWithTemporaryTables() throws Exception {
 String temporaryTableName = "temporary_table_with_partitions";
-mockRandomUUID(UUID.nameUUIDFromBytes(temporaryTableName.getBytes()));
+cleanSessionDirectory();
 test("create TEMPORARY table %s partition by (c1) as select * from (" +
 "select 'A' as c1 from (values(1)) union all select 'B' as c1 from 
(values(1))) t", temporaryTableName);
-checkPermission(temporaryTableName);
+checkPermission();
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreationOutsideOfDefaultTemporaryWorkspace() throws 
Exception {
-try {
-  String temporaryTableName = 
"temporary_table_outside_of_default_workspace";
-  test("create TEMPORARY table %s.%s as select 'A' as c1 from 
(values(1))", temp2_schema, temporaryTableName);
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
-  "VALIDATION ERROR: Temporary tables are not allowed to be created / 
dropped " +
-  "outside of default temporary workspace [%s].", 
DFS_TMP_SCHEMA)));
-  throw e;
-}
+String temporaryTableName = "temporary_table_outside_of_default_workspace";
+
+expectUserRemoteExceptionWithMessage(String.format(
+  "VALIDATION ERROR: Temporary tables are not allowed to be created / 
dropped " +
+"outside of default temporary workspace [%s].", DFS_TMP_SCHEMA));
+
+test("create TEMPORARY table %s.%s as select 'A' as c1 from (values(1))", 
temp2_schema, temporaryTableName);
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreateWhenTemporaryTableExistsWithoutSchema() throws 
Exception {
 String temporaryTableName = "temporary_table_exists_without_schema";
-try {
-  test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
-  test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
- "VALIDATION ERROR: A table or view with given name [%s]" +
- " already exists in schema [%s]", temporaryTableName, 
DFS_TMP_SCHEMA)));
-  throw e;
-}
+
+expectUserRemoteExceptionWithTableExistsMessage(temporaryTableName, 
DFS_TMP_SCHEMA);
 
 Review comment:
   Likely the same pattern applies to other unit tests with mulitple calls to 
`test`.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16461307#comment-16461307
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185567423
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestCTTAS.java
 ##
 @@ -164,121 +165,93 @@ public void 
testResolveTemporaryTableWithPartialSchema() throws Exception {
   @Test
   public void testPartitionByWithTemporaryTables() throws Exception {
 String temporaryTableName = "temporary_table_with_partitions";
-mockRandomUUID(UUID.nameUUIDFromBytes(temporaryTableName.getBytes()));
+cleanSessionDirectory();
 test("create TEMPORARY table %s partition by (c1) as select * from (" +
 "select 'A' as c1 from (values(1)) union all select 'B' as c1 from 
(values(1))) t", temporaryTableName);
-checkPermission(temporaryTableName);
+checkPermission();
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreationOutsideOfDefaultTemporaryWorkspace() throws 
Exception {
-try {
-  String temporaryTableName = 
"temporary_table_outside_of_default_workspace";
-  test("create TEMPORARY table %s.%s as select 'A' as c1 from 
(values(1))", temp2_schema, temporaryTableName);
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
-  "VALIDATION ERROR: Temporary tables are not allowed to be created / 
dropped " +
-  "outside of default temporary workspace [%s].", 
DFS_TMP_SCHEMA)));
-  throw e;
-}
+String temporaryTableName = "temporary_table_outside_of_default_workspace";
+
+expectUserRemoteExceptionWithMessage(String.format(
+  "VALIDATION ERROR: Temporary tables are not allowed to be created / 
dropped " +
+"outside of default temporary workspace [%s].", DFS_TMP_SCHEMA));
+
+test("create TEMPORARY table %s.%s as select 'A' as c1 from (values(1))", 
temp2_schema, temporaryTableName);
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreateWhenTemporaryTableExistsWithoutSchema() throws 
Exception {
 String temporaryTableName = "temporary_table_exists_without_schema";
-try {
-  test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
-  test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
- "VALIDATION ERROR: A table or view with given name [%s]" +
- " already exists in schema [%s]", temporaryTableName, 
DFS_TMP_SCHEMA)));
-  throw e;
-}
+
+expectUserRemoteExceptionWithTableExistsMessage(temporaryTableName, 
DFS_TMP_SCHEMA);
 
 Review comment:
   Move it between `test` calls. My understanding the first one should succeed 
without exception.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16461303#comment-16461303
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185566720
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestCTTAS.java
 ##
 @@ -35,41 +39,46 @@
 import org.apache.hadoop.fs.RemoteIterator;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.junit.BeforeClass;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.ExpectedException;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.List;
+import java.util.Optional;
 import java.util.Properties;
-import java.util.UUID;
 
 import static 
org.apache.drill.exec.util.StoragePluginTestUtils.DFS_PLUGIN_NAME;
 import static org.apache.drill.exec.util.StoragePluginTestUtils.DFS_TMP_SCHEMA;
 import static org.hamcrest.CoreMatchers.containsString;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 
 @Category(SqlTest.class)
 public class TestCTTAS extends BaseTestQuery {
 
-  private static final UUID session_id = 
UUID.nameUUIDFromBytes("sessionId".getBytes());
   private static final String temp2_wk = "tmp2";
   private static final String temp2_schema = String.format("%s.%s", 
DFS_PLUGIN_NAME, temp2_wk);
 
+  private static String sessionId;
   private static FileSystem fs;
   private static FsPermission expectedFolderPermission;
   private static FsPermission expectedFilePermission;
 
+  @Rule
+  public ExpectedException thrown = ExpectedException.none();
+
   @BeforeClass
   public static void init() throws Exception {
-MockUp uuidMockUp = mockRandomUUID(session_id);
 
 Review comment:
   `UUID.randomUUID()` was mocked both for session id and temporary table name. 
Can you get temporary table name the same way you do it for session id?


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16461268#comment-16461268
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185562192
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/FunctionInitializerTest.java
 ##
 @@ -45,25 +45,29 @@
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.spy;
 
-@RunWith(MockitoJUnitRunner.class)
 @Category(SqlFunctionTest.class)
 public class FunctionInitializerTest {
 
-  private static final String CLASS_NAME = "com.drill.udf.CustomLowerFunction";
+  @ClassRule
+  public static final TemporaryFolder temporaryFolder = new TemporaryFolder();
+
+  private static final String CLASS_NAME = 
"org.apache.drill.udf.dynamic.CustomLowerFunction";
   private static URLClassLoader classLoader;
 
   @BeforeClass
   public static void init() throws Exception {
-Path jars = TestTools.WORKING_PATH
-  .resolve(TestTools.TEST_RESOURCES)
-  .resolve("jars");
-String binaryName = "DrillUDF-1.0.jar";
-String sourceName = JarUtil.getSourceName(binaryName);
-URL[] urls = {jars.resolve(binaryName).toUri().toURL(), 
jars.resolve(sourceName).toUri().toURL()};
+File buildDirectory = temporaryFolder.getRoot();
+String binaryName = "drill-custom-lower";
+
+JarBuilder jarBuilder = new JarBuilder("src/test/resources/drill-udf");
+int result = jarBuilder.build(binaryName, 
buildDirectory.getAbsolutePath(), "**/CustomLowerFunction.java", null);
+assertEquals("Build should be successful.", 0, result);
 
 Review comment:
   Consider moving `assertEquals` inside `JarBuilder.build()` and returning 
name of the binary jar instead.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16461256#comment-16461256
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

arina-ielchiieva commented on a change in pull request #1225: DRILL-6272: 
Refactor dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185556872
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/FunctionInitializerTest.java
 ##
 @@ -45,25 +45,29 @@
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.spy;
 
-@RunWith(MockitoJUnitRunner.class)
 @Category(SqlFunctionTest.class)
 public class FunctionInitializerTest {
 
-  private static final String CLASS_NAME = "com.drill.udf.CustomLowerFunction";
+  @ClassRule
+  public static final BaseDirTestWatcher dirTestWatcher = new 
BaseDirTestWatcher();
 
 Review comment:
   Makes sense, 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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16461245#comment-16461245
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185554121
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/FunctionInitializerTest.java
 ##
 @@ -45,25 +45,29 @@
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.spy;
 
-@RunWith(MockitoJUnitRunner.class)
 @Category(SqlFunctionTest.class)
 public class FunctionInitializerTest {
 
-  private static final String CLASS_NAME = "com.drill.udf.CustomLowerFunction";
+  @ClassRule
+  public static final BaseDirTestWatcher dirTestWatcher = new 
BaseDirTestWatcher();
 
 Review comment:
   Sorry, missed that in my previous review. Consider using `TemporaryFolder` 
rule instead of `BaseDirTestWatcher`.


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:
us...@infra.apache.org


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16461074#comment-16461074
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185507108
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/coord/zk/TestZookeeperClient.java
 ---
@@ -125,7 +125,7 @@ public void testHasPathThrowsDrillRuntimeException() {
 
 Mockito
 .when(client.getCache().getCurrentData(absPath))
-.thenThrow(Exception.class);
+.thenThrow(RuntimeException.class);
--- End diff --

Let's do it in different PR.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16461040#comment-16461040
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user vrozov commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185497944
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/coord/zk/TestZookeeperClient.java
 ---
@@ -125,7 +125,7 @@ public void testHasPathThrowsDrillRuntimeException() {
 
 Mockito
 .when(client.getCache().getCurrentData(absPath))
-.thenThrow(Exception.class);
+.thenThrow(RuntimeException.class);
--- End diff --

IMO, this method needs to be changed to test 
`ZookeeperClient.hasPath(String path, boolean consistent)`. It is OK to do it 
in this PR or in a separate commit/JIRA/PR. If you decide to do it in a 
separate commit, please file JIRA.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460948#comment-16460948
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user arina-ielchiieva commented on the issue:

https://github.com/apache/drill/pull/1225
  
@vrozov addressed code review comments in the new commit. Please review.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460898#comment-16460898
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185452673
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestCTTAS.java ---
@@ -35,41 +39,46 @@
 import org.apache.hadoop.fs.RemoteIterator;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.junit.BeforeClass;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.ExpectedException;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.List;
+import java.util.Optional;
 import java.util.Properties;
-import java.util.UUID;
 
 import static 
org.apache.drill.exec.util.StoragePluginTestUtils.DFS_PLUGIN_NAME;
 import static 
org.apache.drill.exec.util.StoragePluginTestUtils.DFS_TMP_SCHEMA;
 import static org.hamcrest.CoreMatchers.containsString;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 
 @Category(SqlTest.class)
 public class TestCTTAS extends BaseTestQuery {
 
-  private static final UUID session_id = 
UUID.nameUUIDFromBytes("sessionId".getBytes());
   private static final String temp2_wk = "tmp2";
   private static final String temp2_schema = String.format("%s.%s", 
DFS_PLUGIN_NAME, temp2_wk);
 
+  private static String sessionId;
   private static FileSystem fs;
   private static FsPermission expectedFolderPermission;
   private static FsPermission expectedFilePermission;
 
+  @Rule
+  public ExpectedException thrown = ExpectedException.none();
+
   @BeforeClass
   public static void init() throws Exception {
-MockUp uuidMockUp = mockRandomUUID(session_id);
--- End diff --

I had to re-write this part since `MockUp.tearDown()` is not present in 
newer jmockit version. Now we don't mock session id at all.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460897#comment-16460897
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185456207
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestCTTAS.java ---
@@ -164,121 +166,113 @@ public void 
testResolveTemporaryTableWithPartialSchema() throws Exception {
   @Test
   public void testPartitionByWithTemporaryTables() throws Exception {
 String temporaryTableName = "temporary_table_with_partitions";
-mockRandomUUID(UUID.nameUUIDFromBytes(temporaryTableName.getBytes()));
+cleanSessionDirectory();
 test("create TEMPORARY table %s partition by (c1) as select * from (" +
 "select 'A' as c1 from (values(1)) union all select 'B' as c1 from 
(values(1))) t", temporaryTableName);
-checkPermission(temporaryTableName);
+checkPermission();
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreationOutsideOfDefaultTemporaryWorkspace() throws 
Exception {
-try {
-  String temporaryTableName = 
"temporary_table_outside_of_default_workspace";
-  test("create TEMPORARY table %s.%s as select 'A' as c1 from 
(values(1))", temp2_schema, temporaryTableName);
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
-  "VALIDATION ERROR: Temporary tables are not allowed to be 
created / dropped " +
-  "outside of default temporary workspace [%s].", 
DFS_TMP_SCHEMA)));
-  throw e;
-}
+String temporaryTableName = 
"temporary_table_outside_of_default_workspace";
+
+thrown.expect(UserRemoteException.class);
--- End diff --

Done.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460895#comment-16460895
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185450679
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/udf/dynamic/JarBuilder.java 
---
@@ -0,0 +1,90 @@
+/*
+ * 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.drill.exec.udf.dynamic;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.Logger;
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.ConsoleAppender;
+import org.apache.maven.cli.MavenCli;
+import org.apache.maven.cli.logging.Slf4jLogger;
+import org.codehaus.plexus.DefaultPlexusContainer;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.logging.BaseLoggerManager;
+import org.slf4j.LoggerFactory;
+
+import java.util.LinkedList;
+import java.util.List;
+
+public class JarBuilder {
+
+  private final MavenCli cli;
+
+  public JarBuilder() {
+this.cli = new MavenCli() {
+  @Override
+  protected void customizeContainer(PlexusContainer container) {
+((DefaultPlexusContainer) container).setLoggerManager(new 
BaseLoggerManager() {
+  @Override
+  protected org.codehaus.plexus.logging.Logger createLogger(String 
s) {
+return new Slf4jLogger(setupLogger(JarBuilder.class.getName(), 
Level.INFO));
+  }
+});
+  }
+};
+  }
+
+  /**
+   * Builds jars using embedded maven. Includes files / resources based 
given pattern,
+   * otherwise using defaults provided in pom.xml.
+   *
+   * @param jarName jar name
+   * @param projectDir project dir
+   * @param includeFiles pattern indicating which files should be included
+   * @param includeResources pattern indicating which resources should be 
included
+   *
+   * @return build exit code, 0 if build was successful
+   */
+  public int build(String jarName, String projectDir, String includeFiles, 
String includeResources) {
+System.setProperty("maven.multiModuleProjectDirectory", projectDir);
+List params = new LinkedList<>();
+params.add("clean");
+params.add("package");
+params.add("-DskipTests");
+params.add("-Djar.finalName=" + jarName);
+if (includeFiles != null) {
+  params.add("-Dinclude.files=" + includeFiles);
+}
+if (includeResources != null) {
+  params.add("-Dinclude.resources=" + includeResources);
+}
+return cli.doMain(params.toArray(new String[params.size()]), 
projectDir, System.out, System.err);
+  }
+
+  private static Logger setupLogger(String string, Level logLevel) {
--- End diff --

Yes, since I want to output info level logging when creating jars. 
Otherwise, no logs on how jars were created will appear.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460893#comment-16460893
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185450442
  
--- Diff: exec/java-exec/src/test/resources/drill-udf/pom.xml ---
@@ -0,0 +1,90 @@
+
+
+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;>
+  4.0.0
+
+  org.apache.drill.udf
+  drill-udf
+  1.0
+
+  
+${project.name}
+1.13.0
--- End diff --

My previous jars used 1.8.0. for example, since I created them when that 
only version was available. API for Drill UDFs is public so we should not 
change it. There is no enforcement though. 


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460900#comment-16460900
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185456183
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestCTTAS.java ---
@@ -164,121 +166,113 @@ public void 
testResolveTemporaryTableWithPartialSchema() throws Exception {
   @Test
   public void testPartitionByWithTemporaryTables() throws Exception {
 String temporaryTableName = "temporary_table_with_partitions";
-mockRandomUUID(UUID.nameUUIDFromBytes(temporaryTableName.getBytes()));
+cleanSessionDirectory();
 test("create TEMPORARY table %s partition by (c1) as select * from (" +
 "select 'A' as c1 from (values(1)) union all select 'B' as c1 from 
(values(1))) t", temporaryTableName);
-checkPermission(temporaryTableName);
+checkPermission();
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreationOutsideOfDefaultTemporaryWorkspace() throws 
Exception {
-try {
-  String temporaryTableName = 
"temporary_table_outside_of_default_workspace";
-  test("create TEMPORARY table %s.%s as select 'A' as c1 from 
(values(1))", temp2_schema, temporaryTableName);
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
-  "VALIDATION ERROR: Temporary tables are not allowed to be 
created / dropped " +
-  "outside of default temporary workspace [%s].", 
DFS_TMP_SCHEMA)));
-  throw e;
-}
+String temporaryTableName = 
"temporary_table_outside_of_default_workspace";
+
+thrown.expect(UserRemoteException.class);
+thrown.expectMessage(containsString(String.format(
+"VALIDATION ERROR: Temporary tables are not allowed to be created 
/ dropped " +
+"outside of default temporary workspace [%s].", 
DFS_TMP_SCHEMA)));
+
+test("create TEMPORARY table %s.%s as select 'A' as c1 from 
(values(1))", temp2_schema, temporaryTableName);
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreateWhenTemporaryTableExistsWithoutSchema() throws 
Exception {
 String temporaryTableName = "temporary_table_exists_without_schema";
-try {
-  test("create TEMPORARY table %s as select 'A' as c1 from 
(values(1))", temporaryTableName);
-  test("create TEMPORARY table %s as select 'A' as c1 from 
(values(1))", temporaryTableName);
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
- "VALIDATION ERROR: A table or view with given name [%s]" +
- " already exists in schema [%s]", temporaryTableName, 
DFS_TMP_SCHEMA)));
-  throw e;
-}
+
+thrown.expect(UserRemoteException.class);
+thrown.expectMessage(containsString(String.format(
+"VALIDATION ERROR: A table or view with given name [%s]" +
+" already exists in schema [%s]", temporaryTableName, 
DFS_TMP_SCHEMA)));
+
+test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
+test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreateWhenTemporaryTableExistsCaseInsensitive() throws 
Exception {
 String temporaryTableName = "temporary_table_exists_without_schema";
-try {
-  test("create TEMPORARY table %s as select 'A' as c1 from 
(values(1))", temporaryTableName);
-  test("create TEMPORARY table %s as select 'A' as c1 from 
(values(1))", temporaryTableName.toUpperCase());
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
-  "VALIDATION ERROR: A table or view with given name [%s]" +
-  " already exists in schema [%s]", 
temporaryTableName.toUpperCase(), DFS_TMP_SCHEMA)));
-  throw e;
-}
+
+thrown.expect(UserRemoteException.class);
+thrown.expectMessage(containsString(String.format(
+"VALIDATION ERROR: A table or view with given name [%s]" +
--- End diff --

Done.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>  

[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460896#comment-16460896
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185452897
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestCTTAS.java ---
@@ -498,47 +489,50 @@ public void 
testDropTemporaryTableAsViewWithoutException() throws Exception {
 .go();
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testDropTemporaryTableAsViewWithException() throws Exception 
{
 String temporaryTableName = 
"temporary_table_to_drop_like_view_with_exception";
 test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
 
-try {
-  test("drop view %s.%s", DFS_TMP_SCHEMA, temporaryTableName);
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
-  "VALIDATION ERROR: Unknown view [%s] in schema [%s]", 
temporaryTableName, DFS_TMP_SCHEMA)));
-  throw e;
+thrown.expect(UserRemoteException.class);
+thrown.expectMessage(containsString(String.format(
+"VALIDATION ERROR: Unknown view [%s] in schema [%s]", 
temporaryTableName, DFS_TMP_SCHEMA)));
+
+test("drop view %s.%s", DFS_TMP_SCHEMA, temporaryTableName);
+  }
+
+  private static String getSessionId() throws Exception {
--- End diff --

Re-written, it turned out I have access to `UserSession` through 
`DrillbitContext`, so no mock is required at all.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460894#comment-16460894
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185449014
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/TestTpchDistributedConcurrent.java
 ---
@@ -177,7 +177,7 @@ public void run() {
 }
   }
 
-  //@Test
--- End diff --

I have accidentally disabled in my previous PR. Did not want to create 
separate Jira for one line fix so included it here.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460899#comment-16460899
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185459187
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/FunctionInitializerTest.java
 ---
@@ -43,27 +44,32 @@
 import java.util.concurrent.Future;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import static org.apache.drill.test.TestTools.getResourceFile;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.spy;
 
-@RunWith(MockitoJUnitRunner.class)
 @Category(SqlFunctionTest.class)
 public class FunctionInitializerTest {
 
-  private static final String CLASS_NAME = 
"com.drill.udf.CustomLowerFunction";
+  @ClassRule
+  public static final BaseDirTestWatcher dirTestWatcher = new 
BaseDirTestWatcher();
+
+  private static final String CLASS_NAME = 
"org.apache.drill.udf.dynamic.CustomLowerFunction";
   private static URLClassLoader classLoader;
 
   @BeforeClass
   public static void init() throws Exception {
-Path jars = TestTools.WORKING_PATH
-  .resolve(TestTools.TEST_RESOURCES)
-  .resolve("jars");
-String binaryName = "DrillUDF-1.0.jar";
-String sourceName = JarUtil.getSourceName(binaryName);
-URL[] urls = {jars.resolve(binaryName).toUri().toURL(), 
jars.resolve(sourceName).toUri().toURL()};
+File projectDir = dirTestWatcher.makeSubDir(Paths.get("drill-udf"));
+
FileUtils.copyDirectory(getResourceFile(Paths.get(projectDir.getName())), 
projectDir);
--- End diff --

Done, thanks.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460892#comment-16460892
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185449640
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/coord/zk/TestZookeeperClient.java
 ---
@@ -125,7 +125,7 @@ public void testHasPathThrowsDrillRuntimeException() {
 
 Mockito
 .when(client.getCache().getCurrentData(absPath))
-.thenThrow(Exception.class);
+.thenThrow(RuntimeException.class);
--- End diff --

I just fixed this test to work with new mockito lib version. I suspect this 
test checks if exception thrown from 
`client.getCache().getCurrentData(absPath)` method will be wrapped in 
DrillRuntimeException.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460476#comment-16460476
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user vrozov commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185383432
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/udf/dynamic/JarBuilder.java 
---
@@ -0,0 +1,90 @@
+/*
+ * 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.drill.exec.udf.dynamic;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.Logger;
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.ConsoleAppender;
+import org.apache.maven.cli.MavenCli;
+import org.apache.maven.cli.logging.Slf4jLogger;
+import org.codehaus.plexus.DefaultPlexusContainer;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.logging.BaseLoggerManager;
+import org.slf4j.LoggerFactory;
+
+import java.util.LinkedList;
+import java.util.List;
+
+public class JarBuilder {
+
+  private final MavenCli cli;
+
+  public JarBuilder() {
+this.cli = new MavenCli() {
+  @Override
+  protected void customizeContainer(PlexusContainer container) {
+((DefaultPlexusContainer) container).setLoggerManager(new 
BaseLoggerManager() {
+  @Override
+  protected org.codehaus.plexus.logging.Logger createLogger(String 
s) {
+return new Slf4jLogger(setupLogger(JarBuilder.class.getName(), 
Level.INFO));
+  }
+});
+  }
+};
+  }
+
+  /**
+   * Builds jars using embedded maven. Includes files / resources based 
given pattern,
+   * otherwise using defaults provided in pom.xml.
+   *
+   * @param jarName jar name
+   * @param projectDir project dir
+   * @param includeFiles pattern indicating which files should be included
+   * @param includeResources pattern indicating which resources should be 
included
+   *
+   * @return build exit code, 0 if build was successful
+   */
+  public int build(String jarName, String projectDir, String includeFiles, 
String includeResources) {
+System.setProperty("maven.multiModuleProjectDirectory", projectDir);
+List params = new LinkedList<>();
+params.add("clean");
+params.add("package");
+params.add("-DskipTests");
+params.add("-Djar.finalName=" + jarName);
+if (includeFiles != null) {
+  params.add("-Dinclude.files=" + includeFiles);
+}
+if (includeResources != null) {
+  params.add("-Dinclude.resources=" + includeResources);
+}
+return cli.doMain(params.toArray(new String[params.size()]), 
projectDir, System.out, System.err);
+  }
+
+  private static Logger setupLogger(String string, Level logLevel) {
--- End diff --

Is this necessary?


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460474#comment-16460474
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user vrozov commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185384630
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/FunctionInitializerTest.java
 ---
@@ -43,27 +44,32 @@
 import java.util.concurrent.Future;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import static org.apache.drill.test.TestTools.getResourceFile;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.spy;
 
-@RunWith(MockitoJUnitRunner.class)
 @Category(SqlFunctionTest.class)
 public class FunctionInitializerTest {
 
-  private static final String CLASS_NAME = 
"com.drill.udf.CustomLowerFunction";
+  @ClassRule
+  public static final BaseDirTestWatcher dirTestWatcher = new 
BaseDirTestWatcher();
+
+  private static final String CLASS_NAME = 
"org.apache.drill.udf.dynamic.CustomLowerFunction";
   private static URLClassLoader classLoader;
 
   @BeforeClass
   public static void init() throws Exception {
-Path jars = TestTools.WORKING_PATH
-  .resolve(TestTools.TEST_RESOURCES)
-  .resolve("jars");
-String binaryName = "DrillUDF-1.0.jar";
-String sourceName = JarUtil.getSourceName(binaryName);
-URL[] urls = {jars.resolve(binaryName).toUri().toURL(), 
jars.resolve(sourceName).toUri().toURL()};
+File projectDir = dirTestWatcher.makeSubDir(Paths.get("drill-udf"));
+
FileUtils.copyDirectory(getResourceFile(Paths.get(projectDir.getName())), 
projectDir);
--- End diff --

Consider using `` in pom.xml if the goal here is to avoid 
creating files in the `src` path.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460475#comment-16460475
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user vrozov commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185385028
  
--- Diff: exec/java-exec/src/test/resources/drill-udf/pom.xml ---
@@ -0,0 +1,90 @@
+
+
+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;>
+  4.0.0
+
+  org.apache.drill.udf
+  drill-udf
+  1.0
+
+  
+${project.name}
+1.13.0
--- End diff --

Is it OK to use old version? Does Drill support semver API compatibility 
for UDFs? If yes, how is it enforced? If no, compilation may fail.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460374#comment-16460374
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user vrozov commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185375540
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestCTTAS.java ---
@@ -498,47 +489,50 @@ public void 
testDropTemporaryTableAsViewWithoutException() throws Exception {
 .go();
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testDropTemporaryTableAsViewWithException() throws Exception 
{
 String temporaryTableName = 
"temporary_table_to_drop_like_view_with_exception";
 test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
 
-try {
-  test("drop view %s.%s", DFS_TMP_SCHEMA, temporaryTableName);
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
-  "VALIDATION ERROR: Unknown view [%s] in schema [%s]", 
temporaryTableName, DFS_TMP_SCHEMA)));
-  throw e;
+thrown.expect(UserRemoteException.class);
+thrown.expectMessage(containsString(String.format(
+"VALIDATION ERROR: Unknown view [%s] in schema [%s]", 
temporaryTableName, DFS_TMP_SCHEMA)));
+
+test("drop view %s.%s", DFS_TMP_SCHEMA, temporaryTableName);
+  }
+
+  private static String getSessionId() throws Exception {
--- End diff --

Consider mocking getSessionId() in the `UserSession`. This method needs to 
be tested by itself.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460375#comment-16460375
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user vrozov commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185369981
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/coord/zk/TestZookeeperClient.java
 ---
@@ -125,7 +125,7 @@ public void testHasPathThrowsDrillRuntimeException() {
 
 Mockito
 .when(client.getCache().getCurrentData(absPath))
-.thenThrow(Exception.class);
+.thenThrow(RuntimeException.class);
--- End diff --

OK, but I am not sure what does this method test. 
`ZookeeperClient.hasPath(String path)` is not used in production.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460376#comment-16460376
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user vrozov commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185374205
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestCTTAS.java ---
@@ -164,121 +166,113 @@ public void 
testResolveTemporaryTableWithPartialSchema() throws Exception {
   @Test
   public void testPartitionByWithTemporaryTables() throws Exception {
 String temporaryTableName = "temporary_table_with_partitions";
-mockRandomUUID(UUID.nameUUIDFromBytes(temporaryTableName.getBytes()));
+cleanSessionDirectory();
 test("create TEMPORARY table %s partition by (c1) as select * from (" +
 "select 'A' as c1 from (values(1)) union all select 'B' as c1 from 
(values(1))) t", temporaryTableName);
-checkPermission(temporaryTableName);
+checkPermission();
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreationOutsideOfDefaultTemporaryWorkspace() throws 
Exception {
-try {
-  String temporaryTableName = 
"temporary_table_outside_of_default_workspace";
-  test("create TEMPORARY table %s.%s as select 'A' as c1 from 
(values(1))", temp2_schema, temporaryTableName);
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
-  "VALIDATION ERROR: Temporary tables are not allowed to be 
created / dropped " +
-  "outside of default temporary workspace [%s].", 
DFS_TMP_SCHEMA)));
-  throw e;
-}
+String temporaryTableName = 
"temporary_table_outside_of_default_workspace";
+
+thrown.expect(UserRemoteException.class);
--- End diff --

Consider introducing a new method to set `thrown` and message, something 
like `void expectUserRemoteExceptionWithMessage(String message)`.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460371#comment-16460371
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user vrozov commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185374827
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestCTTAS.java ---
@@ -164,121 +166,113 @@ public void 
testResolveTemporaryTableWithPartialSchema() throws Exception {
   @Test
   public void testPartitionByWithTemporaryTables() throws Exception {
 String temporaryTableName = "temporary_table_with_partitions";
-mockRandomUUID(UUID.nameUUIDFromBytes(temporaryTableName.getBytes()));
+cleanSessionDirectory();
 test("create TEMPORARY table %s partition by (c1) as select * from (" +
 "select 'A' as c1 from (values(1)) union all select 'B' as c1 from 
(values(1))) t", temporaryTableName);
-checkPermission(temporaryTableName);
+checkPermission();
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreationOutsideOfDefaultTemporaryWorkspace() throws 
Exception {
-try {
-  String temporaryTableName = 
"temporary_table_outside_of_default_workspace";
-  test("create TEMPORARY table %s.%s as select 'A' as c1 from 
(values(1))", temp2_schema, temporaryTableName);
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
-  "VALIDATION ERROR: Temporary tables are not allowed to be 
created / dropped " +
-  "outside of default temporary workspace [%s].", 
DFS_TMP_SCHEMA)));
-  throw e;
-}
+String temporaryTableName = 
"temporary_table_outside_of_default_workspace";
+
+thrown.expect(UserRemoteException.class);
+thrown.expectMessage(containsString(String.format(
+"VALIDATION ERROR: Temporary tables are not allowed to be created 
/ dropped " +
+"outside of default temporary workspace [%s].", 
DFS_TMP_SCHEMA)));
+
+test("create TEMPORARY table %s.%s as select 'A' as c1 from 
(values(1))", temp2_schema, temporaryTableName);
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreateWhenTemporaryTableExistsWithoutSchema() throws 
Exception {
 String temporaryTableName = "temporary_table_exists_without_schema";
-try {
-  test("create TEMPORARY table %s as select 'A' as c1 from 
(values(1))", temporaryTableName);
-  test("create TEMPORARY table %s as select 'A' as c1 from 
(values(1))", temporaryTableName);
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
- "VALIDATION ERROR: A table or view with given name [%s]" +
- " already exists in schema [%s]", temporaryTableName, 
DFS_TMP_SCHEMA)));
-  throw e;
-}
+
+thrown.expect(UserRemoteException.class);
+thrown.expectMessage(containsString(String.format(
+"VALIDATION ERROR: A table or view with given name [%s]" +
+" already exists in schema [%s]", temporaryTableName, 
DFS_TMP_SCHEMA)));
+
+test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
+test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreateWhenTemporaryTableExistsCaseInsensitive() throws 
Exception {
 String temporaryTableName = "temporary_table_exists_without_schema";
-try {
-  test("create TEMPORARY table %s as select 'A' as c1 from 
(values(1))", temporaryTableName);
-  test("create TEMPORARY table %s as select 'A' as c1 from 
(values(1))", temporaryTableName.toUpperCase());
-} catch (UserRemoteException e) {
-  assertThat(e.getMessage(), containsString(String.format(
-  "VALIDATION ERROR: A table or view with given name [%s]" +
-  " already exists in schema [%s]", 
temporaryTableName.toUpperCase(), DFS_TMP_SCHEMA)));
-  throw e;
-}
+
+thrown.expect(UserRemoteException.class);
+thrown.expectMessage(containsString(String.format(
+"VALIDATION ERROR: A table or view with given name [%s]" +
--- End diff --

and possibly `expectUserRemoteExceptionWithTableExistsMessage(String 
tableName, String schemaName)`.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue 

[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460372#comment-16460372
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user vrozov commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185373456
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestCTTAS.java ---
@@ -35,41 +39,46 @@
 import org.apache.hadoop.fs.RemoteIterator;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.junit.BeforeClass;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.ExpectedException;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.List;
+import java.util.Optional;
 import java.util.Properties;
-import java.util.UUID;
 
 import static 
org.apache.drill.exec.util.StoragePluginTestUtils.DFS_PLUGIN_NAME;
 import static 
org.apache.drill.exec.util.StoragePluginTestUtils.DFS_TMP_SCHEMA;
 import static org.hamcrest.CoreMatchers.containsString;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 
 @Category(SqlTest.class)
 public class TestCTTAS extends BaseTestQuery {
 
-  private static final UUID session_id = 
UUID.nameUUIDFromBytes("sessionId".getBytes());
   private static final String temp2_wk = "tmp2";
   private static final String temp2_schema = String.format("%s.%s", 
DFS_PLUGIN_NAME, temp2_wk);
 
+  private static String sessionId;
   private static FileSystem fs;
   private static FsPermission expectedFolderPermission;
   private static FsPermission expectedFilePermission;
 
+  @Rule
+  public ExpectedException thrown = ExpectedException.none();
+
   @BeforeClass
   public static void init() throws Exception {
-MockUp uuidMockUp = mockRandomUUID(session_id);
--- End diff --

 It is hard to say whether you want to change test logic or need a 
workaround for the removed `MockUp.tearDown()` method. In the latter case 
consider adding `getTemporaryName()` method to the `UserSession` class. The 
method can delegate to `UUID.randomUUID()` in production and can be mocked to 
return a predefined value in tests like this one. It will allow not to mock 
`UUID.randomUUID()` at all.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-05-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460373#comment-16460373
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user vrozov commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r185353418
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/TestTpchDistributedConcurrent.java
 ---
@@ -177,7 +177,7 @@ public void run() {
 }
   }
 
-  //@Test
--- End diff --

What is the reason the test was disabled before?


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-04-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16456657#comment-16456657
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user arina-ielchiieva commented on the issue:

https://github.com/apache/drill/pull/1225
  
@vrozov now PR contains two commits: 
1. jmockit and mockito upgrade (DRILL-6363);
2. maven-embedder usage for unit tests (used latest version as you 
suggested) (DRILL-6272).
Please review.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-04-26 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16454669#comment-16454669
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user vrozov commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r184245358
  
--- Diff: pom.xml ---
@@ -798,7 +798,7 @@
   
   com.googlecode.jmockit
   jmockit
-  1.3
+  1.7
--- End diff --

Can it be done as a precursor PR? 1.7 version is quite old too. Can it be 
upgraded to the latest (org.jmockit:jmockit:1.39)?


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-04-26 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16454670#comment-16454670
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user vrozov commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r184411700
  
--- Diff: exec/java-exec/pom.xml ---
@@ -593,6 +593,48 @@
   netty-tcnative
   ${netty.tcnative.classifier}
 
+
+  org.apache.maven
+  maven-embedder
+  3.3.9
--- End diff --

Consider using the latest release available.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-04-25 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16452961#comment-16452961
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user arina-ielchiieva commented on the issue:

https://github.com/apache/drill/pull/1225
  
@vrozov re-implemented using maven embedder. Had to upgrade jmokcit lib to 
the latest version since it caused  NPE with maven embedder (NPE from jmockit 
even if no mocks are used, fixed in newer version). Please review.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-04-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16447836#comment-16447836
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user arina-ielchiieva commented on the issue:

https://github.com/apache/drill/pull/1225
  
@vrozov I'll re-work PR with maven embedder, thanks for the idea. I'll ping 
you when changes are done.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-04-20 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16445746#comment-16445746
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user vrozov commented on the issue:

https://github.com/apache/drill/pull/1225
  
@arina-ielchiieva I don't see why using [maven 
embedder](http://maven.apache.org/ref/3.5.2/maven-embedder) is a less 
preferable option. Using maven it is possible to create source jars using 
standard maven plugin. IMO, it will be easier to modify test UDF project if 
necessary and it is still possible to debug and run tests using IDE or maven. 
There will be no dependency on a build tool, it is a dependency on an external 
jar similar to any other external jar dependency.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-04-20 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16445661#comment-16445661
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user arina-ielchiieva commented on the issue:

https://github.com/apache/drill/pull/1225
  
@vrozov addressed code review comments.
Regarding embedded maven, I have considered this option but using native 
Java to generate jars is more convenient. First of all, for the tests we need 
different jars, with and without resource file, classes. Doing it in Java 
allows to store less config and template files. Also we do not depend from any 
build tool. Plus it much easier to debug and run test using IDE or maven. I 
suggest we leave the current approach.



> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-04-19 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16444956#comment-16444956
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user vrozov commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r182902723
  
--- Diff: 
exec/java-exec/src/test/resources/udf/dynamic/CustomAbsFunctionTemplate ---
@@ -0,0 +1,45 @@
+package org.apache.drill.udf.dynamic;
+
+import io.netty.buffer.DrillBuf;
+import org.apache.drill.exec.expr.DrillSimpleFunc;
+import org.apache.drill.exec.expr.annotations.FunctionTemplate;
+import org.apache.drill.exec.expr.annotations.Output;
+import org.apache.drill.exec.expr.annotations.Param;
+import org.apache.drill.exec.expr.holders.VarCharHolder;
+
+import javax.inject.Inject;
+
+@FunctionTemplate(
+name="abs",
+scope= FunctionTemplate.FunctionScope.SIMPLE,
+nulls = FunctionTemplate.NullHandling.NULL_IF_NULL
+)
+public class Abs implements DrillSimpleFunc {
+
+  @Param
+  VarCharHolder input1;
+
+  @Param
+  VarCharHolder input2;
+
+  @Output
+  VarCharHolder out;
+
+  @Inject
+  DrillBuf buffer;
+
+  public void setup() {
+
+  }
+
+  public void eval() {
+String inputString1 = 
org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(input1.start,
 input1.end, input1.buffer);
+String inputString2 = 
org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(input2.start,
 input2.end, input2.buffer);
+String outputValue = String.format("ABS was overloaded. Input: %s, 
%s", inputString1, inputString2);
+
+out.buffer = buffer;
+out.start = 0;
+out.end = outputValue.getBytes().length;
+buffer.setBytes(0, outputValue.getBytes());
+  }
+}
--- End diff --

LF


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-04-19 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16444955#comment-16444955
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user vrozov commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r182902596
  
--- Diff: 
exec/java-exec/src/test/resources/udf/dynamic/CustomAbsFunctionTemplate ---
@@ -0,0 +1,45 @@
+package org.apache.drill.udf.dynamic;
--- End diff --

Apache license


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-04-19 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16444954#comment-16444954
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user vrozov commented on a diff in the pull request:

https://github.com/apache/drill/pull/1225#discussion_r182902184
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/FunctionInitializerTest.java
 ---
@@ -53,17 +56,27 @@
 @Category(SqlFunctionTest.class)
 public class FunctionInitializerTest {
 
-  private static final String CLASS_NAME = 
"com.drill.udf.CustomLowerFunction";
+  private static final String CLASS_NAME = 
"org.apache.drill.udf.dynamic.CustomLowerFunction";
   private static URLClassLoader classLoader;
 
+  @ClassRule
+  public static TemporaryFolder temporaryFolder = new TemporaryFolder();
+
   @BeforeClass
   public static void init() throws Exception {
-Path jars = TestTools.WORKING_PATH
-  .resolve(TestTools.TEST_RESOURCES)
-  .resolve("jars");
-String binaryName = "DrillUDF-1.0.jar";
-String sourceName = JarUtil.getSourceName(binaryName);
-URL[] urls = {jars.resolve(binaryName).toUri().toURL(), 
jars.resolve(sourceName).toUri().toURL()};
+String binaryName = "DrillUDF-1.0";
+URL template = 
ClassLoader.getSystemClassLoader().getResource("udf/dynamic/CustomLowerFunctionTemplate");
+assert template != null;
--- End diff --

use junit assert in unit tests.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-04-19 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=1653#comment-1653
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

Github user arina-ielchiieva commented on the issue:

https://github.com/apache/drill/pull/1225
  
@vrozov please review.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-04-19 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=1652#comment-1652
 ] 

ASF GitHub Bot commented on DRILL-6272:
---

GitHub user arina-ielchiieva opened a pull request:

https://github.com/apache/drill/pull/1225

DRILL-6272: Refactor dynamic UDFs and function initializer tests to g…

…enerate needed binary and source jars at runtime

Details in [DRILL-6272](https://issues.apache.org/jira/browse/DRILL-6272).

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/arina-ielchiieva/drill DRILL-6272

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/drill/pull/1225.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1225


commit b31ffa39330c4e39531132a2abec1dab17fb97b0
Author: Arina Ielchiieva 
Date:   2018-04-05T15:33:55Z

DRILL-6272: Refactor dynamic UDFs and function initializer tests to 
generate needed binary and source jars at runtime




> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-04-02 Thread Vlad Rozov (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16423315#comment-16423315
 ] 

Vlad Rozov commented on DRILL-6272:
---

[~volodymyr.tkach] There is a difference between a json and a jar file. A json 
file represents original source submitted to ASF, while a jar file is a 
compilation from a source code.

> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-04-02 Thread Volodymyr Tkach (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16422931#comment-16422931
 ] 

Volodymyr Tkach commented on DRILL-6272:


[~vrozov] those binaries serve us as data input for testing purposes, they are 
not intended to be executed/compiled by users. I think that this paragraph 
[http://www.apache.org/legal/release-policy.html#compiled-packages] is saying 
about binaries that users will execute manually or programmatically, but that 
is not our case, for us those files just raw data, like json files for testing 
purposes.

> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-04-02 Thread Vlad Rozov (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16422629#comment-16422629
 ] 

Vlad Rozov commented on DRILL-6272:
---

[~arina] Please see http://www.apache.org/dev/release-publishing.html#valid: 
??The Apache Software Foundation exists to create open source software. Thus, 
the fundamental requirement for a release is that it consist of the necessary 
*source code* to build the project. Optionally, a release may also be 
accompanied by *compiled binaries* for the convenience of users.??

> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Arina Ielchiieva
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-04-02 Thread Arina Ielchiieva (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16421975#comment-16421975
 ] 

Arina Ielchiieva commented on DRILL-6272:
-

[~vrozov] these files are needed for Dynamic UDF support tests (when we 
dynamically load functions into Drill). For that purpose we need both source 
and binary files present. We cannot compile them during Drill build since they 
are created from separate project, neither they can be pulled from maven repo, 
since this project is not published.
Example of the project: https://github.com/arina-ielchiieva/drillUDF. 
Also can you please point to Apache documentation where it is indicated that we 
cannot have such files in release.


> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Volodymyr Tkach
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-03-31 Thread Vlad Rozov (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16421362#comment-16421362
 ] 

Vlad Rozov commented on DRILL-6272:
---

Binary files, especially jar files that are created by compiling a source code 
into binaries should not be part of Apache *source* release. Either pull them 
from maven repository or compile them during the Drill build.

> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Volodymyr Tkach
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6272) Remove binary jars files from source distribution

2018-03-31 Thread Volodymyr Tkach (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16421289#comment-16421289
 ] 

Volodymyr Tkach commented on DRILL-6272:


[~vrozov] currently those jars binaries are used in TestDynamicUDFSupport  
tests.

> Remove binary jars files from source distribution
> -
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
>  Issue Type: Task
>Reporter: Vlad Rozov
>Assignee: Volodymyr Tkach
>Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)