[GitHub] drill pull request #684: DRILL-5070: Code gen: create methods in fixed order...

2016-12-07 Thread paul-rogers
GitHub user paul-rogers opened a pull request:

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

DRILL-5070: Code gen: create methods in fixed order to allow test 
verification  

A handy technique in testing is to compare generated code against a 
"golden" copy that defines the expected results. However, at present, Drill 
generates code using the method order returned by Class.getDeclaredMethods, but 
this method makes no guarantee about the order of the methods. The order varies 
from one run to the next. There is some evidence this link that order can vary 
even within a single run, though a quick test was unable to reproduce this case.

The fix is simple, in the SignatureHolder constructor, sort methods by name 
after retrieving them from the class. The sort ensures that method order is 
deterministic. Fortunately, the number of methods is small, so the sort step 
adds little cost.

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

$ git pull https://github.com/paul-rogers/drill DRILL-5070

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

https://github.com/apache/drill/pull/684.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 #684


commit 63d9b5aaffb6982355c785efe26dfede81c0a66a
Author: Paul Rogers 
Date:   2016-11-28T05:51:02Z

DRILL-5070: Actual fix

The fix: order methods by name in the “signature” so that generated
methods occur in the same order every time.

commit b25bbf5c25c23c196710af0e72b79cc97acff0e9
Author: Paul Rogers 
Date:   2016-11-28T05:52:41Z

DRILL-5070: Test cases

Modifies the existing ExpressionTest to capture generated code and
compare it to a “golden” copy. Provides the mechanism to do the
comparison.

Before the fix, comparisons randomly fail due to random method order.
After the fix, the comparisons consistently work, showing that code is
generated in the same order each time.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill issue #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread paul-rogers
Github user paul-rogers commented on the issue:

https://github.com/apache/drill/pull/676
  
Failure is a Maven transfer failure. How to reset?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #638: DRILL-4982: Separate Hive reader classes for differ...

2016-12-07 Thread paul-rogers
Github user paul-rogers commented on a diff in the pull request:

https://github.com/apache/drill/pull/638#discussion_r91446474
  
--- Diff: 
contrib/storage-hive/core/src/main/codegen/templates/HiveRecordReaders.java ---
@@ -0,0 +1,300 @@
+/**
+ * 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.
+ */
+
+/**
+ * This template is used to generate different Hive record reader classes 
for different data formats
+ * to avoid JIT profile pullusion. These readers are derived from 
HiveAbstractReader which implements
+ * codes for init and setup stage, but the repeated - and performance 
critical part - next() method is
+ * separately implemented in the classes generated from this template. The 
internal SkipRecordReeader
+ * class is also separated as well due to the same reason.
+ *
+ * As to the performance gain with this change, please refer to:
+ * https://issues.apache.org/jira/browse/DRILL-4982
+ *
+ */
+<@pp.dropOutputFile />
+<#list hiveFormat.map as entry>
+<@pp.changeOutputFile 
name="/org/apache/drill/exec/store/hive/Hive${entry.hiveReader}Reader.java" />
+<#include "/@includes/license.ftl" />
+
+package org.apache.drill.exec.store.hive;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Properties;
+import org.apache.drill.common.exceptions.DrillRuntimeException;
+import org.apache.drill.common.exceptions.ExecutionSetupException;
+import org.apache.drill.common.expression.SchemaPath;
+import org.apache.drill.exec.ops.FragmentContext;
+import org.apache.drill.exec.vector.AllocationHelper;
+import org.apache.drill.exec.vector.ValueVector;
+import org.apache.hadoop.hive.metastore.api.Partition;
+import org.apache.hadoop.hive.metastore.api.Table;
+import org.apache.hadoop.io.Writable;
+import org.apache.hadoop.mapred.InputSplit;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.apache.hadoop.hive.conf.HiveConf;
+
+import org.apache.hadoop.hive.serde2.SerDeException;
+
+import org.apache.hadoop.mapred.RecordReader;
+<#if entry.hasHeaderFooter == true>
+import org.apache.hadoop.hive.serde2.SerDe;
+import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
+import com.google.common.collect.Lists;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Queue;
+import java.util.Set;
+import org.apache.hadoop.hive.metastore.api.hive_metastoreConstants;
+import org.apache.hadoop.hive.serde.serdeConstants;
+
+
+public class Hive${entry.hiveReader}Reader extends HiveAbstractReader {
+
+  Object key;
+<#if entry.hasHeaderFooter == true>
--- End diff --

Free marker allows simple boolean expressions:
`<#if entry.hasHeaderFooter>`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #638: DRILL-4982: Separate Hive reader classes for differ...

2016-12-07 Thread paul-rogers
Github user paul-rogers commented on a diff in the pull request:

https://github.com/apache/drill/pull/638#discussion_r91448234
  
--- Diff: contrib/storage-hive/core/src/main/codegen/data/HiveFormats.tdd 
---
@@ -0,0 +1,50 @@
+# 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.
+
+{
--- End diff --

Can we explain this a bit? We have 6 reader types. But, the only difference 
in generated code is has header/footer or not. Can we solve the Java 
optimization problem with a "classic" type hierarchy:

```
HiveAbstractReader
. HiveSimpleReader
. . HiveAvroReader
. . ...
. HiveHeaderFooterReader
. . HiveTextReader
. . ...
```

Names are just made up. The point is, can a much simpler Java hierarchy, 
with less duplicated code, solve the problem? If there is one function that is 
sub-optimized, can just that one function be generated in the subclass rather 
than generating duplicate code?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #638: DRILL-4982: Separate Hive reader classes for differ...

2016-12-07 Thread paul-rogers
Github user paul-rogers commented on a diff in the pull request:

https://github.com/apache/drill/pull/638#discussion_r91447926
  
--- Diff: 
contrib/storage-hive/core/src/main/codegen/templates/HiveRecordReaders.java ---
@@ -0,0 +1,300 @@
+/**
+ * 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.
+ */
+
+/**
+ * This template is used to generate different Hive record reader classes 
for different data formats
+ * to avoid JIT profile pullusion. These readers are derived from 
HiveAbstractReader which implements
+ * codes for init and setup stage, but the repeated - and performance 
critical part - next() method is
+ * separately implemented in the classes generated from this template. The 
internal SkipRecordReeader
+ * class is also separated as well due to the same reason.
+ *
+ * As to the performance gain with this change, please refer to:
+ * https://issues.apache.org/jira/browse/DRILL-4982
+ *
+ */
+<@pp.dropOutputFile />
+<#list hiveFormat.map as entry>
+<@pp.changeOutputFile 
name="/org/apache/drill/exec/store/hive/Hive${entry.hiveReader}Reader.java" />
+<#include "/@includes/license.ftl" />
+
+package org.apache.drill.exec.store.hive;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Properties;
+import org.apache.drill.common.exceptions.DrillRuntimeException;
+import org.apache.drill.common.exceptions.ExecutionSetupException;
+import org.apache.drill.common.expression.SchemaPath;
+import org.apache.drill.exec.ops.FragmentContext;
+import org.apache.drill.exec.vector.AllocationHelper;
+import org.apache.drill.exec.vector.ValueVector;
+import org.apache.hadoop.hive.metastore.api.Partition;
+import org.apache.hadoop.hive.metastore.api.Table;
+import org.apache.hadoop.io.Writable;
+import org.apache.hadoop.mapred.InputSplit;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.apache.hadoop.hive.conf.HiveConf;
+
+import org.apache.hadoop.hive.serde2.SerDeException;
+
+import org.apache.hadoop.mapred.RecordReader;
+<#if entry.hasHeaderFooter == true>
+import org.apache.hadoop.hive.serde2.SerDe;
+import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
+import com.google.common.collect.Lists;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Queue;
+import java.util.Set;
+import org.apache.hadoop.hive.metastore.api.hive_metastoreConstants;
+import org.apache.hadoop.hive.serde.serdeConstants;
+
+
+public class Hive${entry.hiveReader}Reader extends HiveAbstractReader {
+
+  Object key;
+<#if entry.hasHeaderFooter == true>
+  SkipRecordsInspector skipRecordsInspector;
+<#else>
+  Object value;
+
+
+  public Hive${entry.hiveReader}Reader(Table table, Partition partition, 
InputSplit inputSplit, List projectedColumns,
+   FragmentContext context, final HiveConf hiveConf,
+   UserGroupInformation proxyUgi) throws 
ExecutionSetupException {
+super(table, partition, inputSplit, projectedColumns, context, 
hiveConf, proxyUgi);
+  }
+
+  public  void internalInit(Properties tableProperties, 
RecordReader reader) {
+
+key = reader.createKey();
+<#if entry.hasHeaderFooter == true>
+skipRecordsInspector = new SkipRecordsInspector(tableProperties, 
reader);
+<#else>
+value = reader.createValue();
+
+
+  }
+  private void readHiveRecordAndInsertIntoRecordBatch(Object 
deSerializedValue, int outputRecordIndex) {
+for (int i = 0; i < selectedStructFieldRefs.size(); i++) {
+  Object hiveValue = finalOI.getStructFieldData(deSerializedValue, 
selectedStructFieldRefs.get(i));
+  if (hiveValue != null) {
+
selectedColumnFieldConverters.get(i).setSafeValue(selectedColumnObjInspectors.get(i),
 hiveValue,
+  vectors.get(i), outputRecordIndex);
+  }
+}
+  }
+
+<#if entr

[GitHub] drill pull request #638: DRILL-4982: Separate Hive reader classes for differ...

2016-12-07 Thread paul-rogers
Github user paul-rogers commented on a diff in the pull request:

https://github.com/apache/drill/pull/638#discussion_r91447651
  
--- Diff: 
contrib/storage-hive/core/src/main/codegen/templates/HiveRecordReaders.java ---
@@ -0,0 +1,300 @@
+/**
+ * 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.
+ */
+
+/**
+ * This template is used to generate different Hive record reader classes 
for different data formats
+ * to avoid JIT profile pullusion. These readers are derived from 
HiveAbstractReader which implements
+ * codes for init and setup stage, but the repeated - and performance 
critical part - next() method is
+ * separately implemented in the classes generated from this template. The 
internal SkipRecordReeader
+ * class is also separated as well due to the same reason.
+ *
+ * As to the performance gain with this change, please refer to:
+ * https://issues.apache.org/jira/browse/DRILL-4982
+ *
+ */
+<@pp.dropOutputFile />
+<#list hiveFormat.map as entry>
+<@pp.changeOutputFile 
name="/org/apache/drill/exec/store/hive/Hive${entry.hiveReader}Reader.java" />
+<#include "/@includes/license.ftl" />
+
+package org.apache.drill.exec.store.hive;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Properties;
+import org.apache.drill.common.exceptions.DrillRuntimeException;
+import org.apache.drill.common.exceptions.ExecutionSetupException;
+import org.apache.drill.common.expression.SchemaPath;
+import org.apache.drill.exec.ops.FragmentContext;
+import org.apache.drill.exec.vector.AllocationHelper;
+import org.apache.drill.exec.vector.ValueVector;
+import org.apache.hadoop.hive.metastore.api.Partition;
+import org.apache.hadoop.hive.metastore.api.Table;
+import org.apache.hadoop.io.Writable;
+import org.apache.hadoop.mapred.InputSplit;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.apache.hadoop.hive.conf.HiveConf;
+
+import org.apache.hadoop.hive.serde2.SerDeException;
+
+import org.apache.hadoop.mapred.RecordReader;
+<#if entry.hasHeaderFooter == true>
+import org.apache.hadoop.hive.serde2.SerDe;
+import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
+import com.google.common.collect.Lists;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Queue;
+import java.util.Set;
+import org.apache.hadoop.hive.metastore.api.hive_metastoreConstants;
+import org.apache.hadoop.hive.serde.serdeConstants;
+
+
+public class Hive${entry.hiveReader}Reader extends HiveAbstractReader {
+
+  Object key;
+<#if entry.hasHeaderFooter == true>
+  SkipRecordsInspector skipRecordsInspector;
+<#else>
+  Object value;
+
+
+  public Hive${entry.hiveReader}Reader(Table table, Partition partition, 
InputSplit inputSplit, List projectedColumns,
+   FragmentContext context, final HiveConf hiveConf,
+   UserGroupInformation proxyUgi) throws 
ExecutionSetupException {
+super(table, partition, inputSplit, projectedColumns, context, 
hiveConf, proxyUgi);
+  }
+
+  public  void internalInit(Properties tableProperties, 
RecordReader reader) {
+
+key = reader.createKey();
+<#if entry.hasHeaderFooter == true>
+skipRecordsInspector = new SkipRecordsInspector(tableProperties, 
reader);
+<#else>
+value = reader.createValue();
+
+
+  }
+  private void readHiveRecordAndInsertIntoRecordBatch(Object 
deSerializedValue, int outputRecordIndex) {
+for (int i = 0; i < selectedStructFieldRefs.size(); i++) {
+  Object hiveValue = finalOI.getStructFieldData(deSerializedValue, 
selectedStructFieldRefs.get(i));
+  if (hiveValue != null) {
+
selectedColumnFieldConverters.get(i).setSafeValue(selectedColumnObjInspectors.get(i),
 hiveValue,
+  vectors.get(i), outputRecordIndex);
+  }
+}
+  }
+
+<#if entr

[GitHub] drill issue #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread ppadma
Github user ppadma commented on the issue:

https://github.com/apache/drill/pull/676
  
+1. Thanks for fixing this and for some more cleanup. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread paul-rogers
Github user paul-rogers commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91426377
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java
 ---
@@ -543,6 +566,14 @@ else if (RuntimeException.class == cause.getClass()
 // Special good-enough case--we had to use RuntimeException for 
now.
 result = true;
   }
+  else if (  method.getName().equals("setObject")
--- End diff --

Same style issue as earlier.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread paul-rogers
Github user paul-rogers commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91429339
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/JdbcAssert.java ---
@@ -66,6 +66,11 @@ public static void setFactory(ConnectionFactory factory) 
{
   public static Properties getDefaultProperties() {
 final Properties properties = new Properties();
 properties.setProperty("drillJDBCUnitTests", "true");
+
+// Must set this to false to ensure that the tests ignore any existing
+// plugin configurations stored in /tmp/drill.
+
--- End diff --

I prefer extra lines around comments. Makes the flow less cluttered.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread paul-rogers
Github user paul-rogers commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91426330
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java
 ---
@@ -477,18 +477,32 @@ public void testClosedConnectionMethodsThrowRight() {
 }
 
 @Override
+protected boolean isOkayNonthrowingMethod(Method method) {
+  // Java 8 method
+  if ( "getLargeUpdateCount".equals(method.getName())) {
+return true; }
+  return super.isOkayNonthrowingMethod(method);
+}
+
+@Override
 protected boolean isOkaySpecialCaseException(Method method, Throwable 
cause) {
   final boolean result;
   if (super.isOkaySpecialCaseException(method, cause)) {
 result = true;
   }
+  else if (   method.getName().equals("executeLargeBatch")
--- End diff --

This one stays... The style in this file was to align the terms in the 
conditional. Following a pattern established elsewhere in the file.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread ppadma
Github user ppadma commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91421952
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java
 ---
@@ -477,18 +477,32 @@ public void testClosedConnectionMethodsThrowRight() {
 }
 
 @Override
+protected boolean isOkayNonthrowingMethod(Method method) {
+  // Java 8 method
+  if ( "getLargeUpdateCount".equals(method.getName())) {
+return true; }
--- End diff --

remove extra space after if ( .  
} in a separate line.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread ppadma
Github user ppadma commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91423240
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2769UnsupportedReportsUseSqlExceptionTest.java
 ---
@@ -280,6 +280,10 @@ else if (NullPointerException.class == cause.getClass()
   // code implements them.
   successLinesBuf.append(resultLine);
 }
+else if (isOkaySpecialCaseException(method, cause)) {
+  successLinesBuf.append(resultLine);
+}
+
--- End diff --

remove extra line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread ppadma
Github user ppadma commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91421707
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2769UnsupportedReportsUseSqlExceptionTest.java
 ---
@@ -397,10 +419,19 @@ public void testPlainStatementMethodsThrowRight() {
   this.factoryConnection = factoryConnection;
 }
 
+@Override
 protected PreparedStatement getJdbcObject() throws SQLException {
   return factoryConnection.prepareStatement("VALUES 1");
 }
 
+@Override
+protected boolean isOkaySpecialCaseException(Method method,
+ Throwable cause) {
+   // New Java 8 method not supported by Avatica
+
--- End diff --

remove the extra line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread ppadma
Github user ppadma commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91421638
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/JdbcAssert.java ---
@@ -66,6 +66,11 @@ public static void setFactory(ConnectionFactory factory) 
{
   public static Properties getDefaultProperties() {
 final Properties properties = new Properties();
 properties.setProperty("drillJDBCUnitTests", "true");
+
+// Must set this to false to ensure that the tests ignore any existing
+// plugin configurations stored in /tmp/drill.
+
--- End diff --

remove the extra line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread ppadma
Github user ppadma commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91422697
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2769UnsupportedReportsUseSqlExceptionTest.java
 ---
@@ -368,10 +381,19 @@ public void testConnectionMethodsThrowRight() {
   this.factoryConnection = factoryConnection;
 }
 
+@Override
 protected Statement getJdbcObject() throws SQLException {
   return factoryConnection.createStatement();
 }
 
+@Override
+protected boolean isOkaySpecialCaseException(Method method,
+ Throwable cause) {
+   // New Java 8 method not supported by Avatica
+
--- End diff --

remove the extra line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread ppadma
Github user ppadma commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91422511
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java
 ---
@@ -543,6 +566,14 @@ else if (RuntimeException.class == cause.getClass()
 // Special good-enough case--we had to use RuntimeException for 
now.
 result = true;
   }
+  else if (  method.getName().equals("setObject")
--- End diff --

remove extra space after if


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread ppadma
Github user ppadma commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91422118
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java
 ---
@@ -477,18 +477,32 @@ public void testClosedConnectionMethodsThrowRight() {
 }
 
 @Override
+protected boolean isOkayNonthrowingMethod(Method method) {
+  // Java 8 method
+  if ( "getLargeUpdateCount".equals(method.getName())) {
+return true; }
+  return super.isOkayNonthrowingMethod(method);
+}
+
+@Override
 protected boolean isOkaySpecialCaseException(Method method, Throwable 
cause) {
   final boolean result;
   if (super.isOkaySpecialCaseException(method, cause)) {
 result = true;
   }
+  else if (   method.getName().equals("executeLargeBatch")
--- End diff --

remove extra space after if. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread ppadma
Github user ppadma commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91422620
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java
 ---
@@ -587,6 +618,12 @@ else if (RuntimeException.class == cause.getClass()
 // Special good-enough case--we had to use RuntimeException for 
now.
 result = true;
   }
+  else if (SQLFeatureNotSupportedException.class == cause.getClass()
+  && (   method.getName().equals("updateObject")
--- End diff --

extra space after ( .   move && to line above. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill issue #671: DRILL-4347: Propagate distinct row count for joins from lo...

2016-12-07 Thread jinfengni
Github user jinfengni commented on the issue:

https://github.com/apache/drill/pull/671
  
Agreed with your comment about the importance of doing calcite rebasing.  
AFAIK, someone(s) else in Ukraine have been working on calcite rebasing for a 
while. Last time I heard is they managed to get a rebased calcite branch and 
are dealing with regressions on Drill side.
 

 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Drill-Arrow integration

2016-12-07 Thread Julian Hyde
Can we please talk about what we want for Drill-Arrow integration?

There was a patch several months ago[1] and it just got stuck.

Julian

[1] https://issues.apache.org/jira/browse/DRILL-4455 




[GitHub] drill issue #671: DRILL-4347: Propagate distinct row count for joins from lo...

2016-12-07 Thread julianhyde
Github user julianhyde commented on the issue:

https://github.com/apache/drill/pull/671
  
Rebasing onto Calcite is like running after a train: you can't just stop 
and take a rest. :)

And by the way, the state of Drill-Arrow integration makes me very sad. Now 
Drill has fallen behind there, I doubt whether it will ever catch up.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #671: DRILL-4347: Propagate distinct row count for joins ...

2016-12-07 Thread jinfengni
Github user jinfengni commented on a diff in the pull request:

https://github.com/apache/drill/pull/671#discussion_r91389995
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillRelMdDistinctRowCount.java
 ---
@@ -43,6 +48,30 @@ public Double getDistinctRowCount(RelNode rel, 
ImmutableBitSet groupKey, RexNode
 }
   }
 
+  @Override
+  public Double getDistinctRowCount(Join rel, ImmutableBitSet groupKey, 
RexNode predicate) {
+Double count = null;
+if (rel != null) {
+  if (rel instanceof JoinPrel) {
+// for Drill physical joins, don't recompute the distinct row 
count since it was already done
+// during logical planning; retrieve the cached value.
+count = ((JoinPrel)rel).getDistinctRowCount();
+if (count.doubleValue() < 0) {
+  logger.warn("Invalid cached distinct row count for {}; 
recomputing..", rel.getDescription());
+  count = super.getDistinctRowCount(rel, groupKey, predicate);
+}
+  } else {
+count = super.getDistinctRowCount(rel, groupKey, predicate);
--- End diff --

The API of RelMdDistinctRowCount seems to indicate the distinct rowcount 
depends on input of groupKey and predicate. However, the cached value in 
DrillJoinRel does not differentiate based on groupKey / predicate. Will it 
cause issue in the cases this getDistinctRowCount() is called multiple times 
with different groupKey / predicate? 




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill issue #671: DRILL-4347: Propagate distinct row count for joins from lo...

2016-12-07 Thread jinfengni
Github user jinfengni commented on the issue:

https://github.com/apache/drill/pull/671
  
@jacques-n , CachingRelMetadataProvider provides caching capability per 
meta-method / rel node [1]. Since Drill logical rel (DrillJoinRel) and Drill 
physical rel (JoinPrel) are different rels, CachingRelMetadataProvider probably 
would not help avoiding the first meta data call for the physical rel nodes, 
even the meta data for logical rels are in the cache. 

@julianhyde , I probably once tried to cherry-pick CALCITE-604 to Drill's 
calcite fork, and I aborted that effort after seeing many merging conflicts (If 
I remember correctly).  Since there has been ongoing effort to rebase Drill 
onto latest Calcite,  it might make sense to see if the rebase work could be 
done shortly. At that time, Drill will benefit from CALCITE-604.

 
1. 
https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/rel/metadata/CachingRelMetadataProvider.java#L113-L120



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #680: DRILL-5108: Reduce output from Maven git-commit-id-...

2016-12-07 Thread Ben-Zvi
Github user Ben-Zvi commented on a diff in the pull request:

https://github.com/apache/drill/pull/680#discussion_r91358221
  
--- Diff: pom.xml ---
@@ -383,7 +383,7 @@
 
 
   dd.MM. '@' HH:mm:ss z
-  true
+  false
--- End diff --

Can this be undone by giving the mvn command line option  -Dverbose  ?



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #683: DRILL-5114: Rationalize use of Logback logging in u...

2016-12-07 Thread paul-rogers
GitHub user paul-rogers opened a pull request:

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

DRILL-5114: Rationalize use of Logback logging in unit tests

Cleans up the Drill test Logback config files to reduce unnecessary
logging in tests and avoid Logback complaints about missing or
duplicate log config files.

Does not affect production logging.

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

$ git pull https://github.com/paul-rogers/drill DRILL-5114

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

https://github.com/apache/drill/pull/683.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 #683


commit bbd5ceb4f1c61bfa844701d18220cbd019e1b700
Author: Paul Rogers 
Date:   2016-12-07T18:33:48Z

DRILL-5114: Rationalize use of Logback logging in unit tests

Cleans up the Drill test Logback config files to reduce unnecessary
logging in tests and avoid Logback complaints about missing or
duplicate log config files.

Does not affect production logging.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill issue #654: DRILL-5032: Drill query on hive parquet table failed with ...

2016-12-07 Thread chunhui-shi
Github user chunhui-shi commented on the issue:

https://github.com/apache/drill/pull/654
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #654: DRILL-5032: Drill query on hive parquet table faile...

2016-12-07 Thread Serhii-Harnyk
Github user Serhii-Harnyk commented on a diff in the pull request:

https://github.com/apache/drill/pull/654#discussion_r91351247
  
--- Diff: 
contrib/storage-hive/core/src/test/java/org/apache/drill/exec/store/hive/schema/TestColumnListCache.java
 ---
@@ -0,0 +1,78 @@
+/*
--- End diff --

Done


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---