Re: -ERROR [HY000] [MapR][Drill] (1040) Drill failed to execute the query

2016-06-28 Thread Neeraja Rentachintala
Drill doesn't support SELECT INTO syntax currently.
You need to use Create Table As.

On Tue, Jun 28, 2016 at 11:30 PM, Omkar Pathallapalli 
wrote:

> Hi team,
>
> When i issued query in apache drill iam getting this error how can i
> resolve this
>
> ERROR [HY000] [MapR][Drill] (1040) Drill failed to execute the query:
> select distinct ani,calldate,count(distinct(did))
> Count_of_did,destcode,trffclass,sum(talktime)/60.mo_talktime,custcode into
> rpttmp_final  from dfs.tmp.r_fa_cdr_tmp where  destcode not like
> '%voicemail%'
> and destcode not like '%customerservice%' and destcode not
> like '%topup%'
> group by ani,calldatetrffclass,destcode,custcode
>
>
> [30027]Query execution error. Details:[
> PARSE ERROR: Encountered "into" at line 1, column 121.
> Was expecting one of:
> "FROM" ...
> "," ...
> "AS" ...
>  ...
>  ...
>  ...
>  ...
>  ...
> "." ...
> "[" ...
> "(" ...
> "NOT" ...
> "IN" ...
> "BETWEEN" ...
> "LIKE" ...
> "SIMILAR" ...
> "=" ...
> ">" ...
> "<" ...
> "<=" ...
> ">=" ...
> "<>" ...
> "+" ...
> "-" ...
> "*" ...
> "/" ...
> "||" ...
> ...
>
>
> Regards,
> omkar
>
>


Re:-ERROR [HY000] [MapR][Drill] (1040) Drill failed to execute the query

2016-06-28 Thread Omkar Pathallapalli
Hi team,

When i issued query in apache drill iam getting this error how can i resolve 
this

ERROR [HY000] [MapR][Drill] (1040) Drill failed to execute the query: select 
distinct ani,calldate,count(distinct(did)) 
Count_of_did,destcode,trffclass,sum(talktime)/60.mo_talktime,custcode into 
rpttmp_final  from dfs.tmp.r_fa_cdr_tmp where  destcode not like '%voicemail%'
and destcode not like '%customerservice%' and destcode not like 
'%topup%'
group by ani,calldatetrffclass,destcode,custcode


[30027]Query execution error. Details:[
PARSE ERROR: Encountered "into" at line 1, column 121.
Was expecting one of:
"FROM" ...
"," ...
"AS" ...
 ...
 ...
 ...
 ...
 ...
"." ...
"[" ...
"(" ...
"NOT" ...
"IN" ...
"BETWEEN" ...
"LIKE" ...
"SIMILAR" ...
"=" ...
">" ...
"<" ...
"<=" ...
">=" ...
"<>" ...
"+" ...
"-" ...
"*" ...
"/" ...
"||" ...
...


Regards,
omkar



[jira] [Created] (DRILL-4756) JPAM library required by Drill does not work for Mac; provide alternative

2016-06-28 Thread Paul Rogers (JIRA)
Paul Rogers created DRILL-4756:
--

 Summary: JPAM library required by Drill does not work for Mac; 
provide alternative
 Key: DRILL-4756
 URL: https://issues.apache.org/jira/browse/DRILL-4756
 Project: Apache Drill
  Issue Type: Improvement
Affects Versions: 1.6.0
Reporter: Paul Rogers
Priority: Minor


As described in the documentation 
(http://drill.apache.org/docs/configuring-user-authentication/) Drill uses the 
JPAM library (https://sourceforge.net/projects/jpam/files/jpam/jpam-1.1/) to 
integrate with PAM for security.

Many people use Macs to prototype, develop and test Drill prior to deployment. 
However, the jpam native library provided by the above project is from 2007 and 
does not work on modern Macs. Instead, we get the following error:

Caused by: java.lang.UnsatisfiedLinkError: 
/Users/fred/play/drill-site/lib/libjpam.jnilib: 
dlopen(/Users/fred/play/drill-site/lib/libjpam.jnilib, 1): no suitable image 
found.  Did find:
/Users/fred/play/drill-site/lib/libjpam.jnilib: mach-o, but wrong 
architecture

One can recompile the code, but the code itself is outdated with respect to the 
modern Mac.

Drill should provide a working build of the library for the Mac to help with 
pre-deployment efforts.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[ANNOUNCE] Apache Drill 1.7.0 released

2016-06-28 Thread Aman Sinha
On behalf of the Apache Drill community, I am happy to announce the
release of Apache Drill 1.7.0.

The source and binary artifacts are available at [1]
Review a complete list of fixes and enhancements at [2]

This release of Drill fixes many issues and introduces a number of
enhancements, including JMX enablement for monitoring, support for Hive
CHAR type and HBase 1.x support.

Thanks to everyone in the community who contributed to this release.

[1] https://drill.apache.org/download/
[2] https://drill.apache.org/docs/apache-drill-1-7-0-release-notes/


-Aman


[GitHub] drill pull request #527: DRILL-4728: Add support for new metadata fetch APIs

2016-06-28 Thread sudheeshkatkam
Github user sudheeshkatkam commented on a diff in the pull request:

https://github.com/apache/drill/pull/527#discussion_r68865600
  
--- Diff: exec/jdbc-all/pom.xml ---
@@ -441,7 +441,7 @@
   This is likely due to you adding new dependencies to a 
java-exec and not updating the excludes in this module. This is important as it 
minimizes the size of the dependency of Drill application users.
   
   
-  2000
+  2100
--- End diff --

Is this intended?


---
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 #527: DRILL-4728: Add support for new metadata fetch APIs

2016-06-28 Thread sudheeshkatkam
Github user sudheeshkatkam commented on a diff in the pull request:

https://github.com/apache/drill/pull/527#discussion_r68865590
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/work/metadata/MetadataProvider.java
 ---
@@ -0,0 +1,451 @@
+/**
+ * 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.work.metadata;
+
+import static 
org.apache.drill.exec.store.ischema.InfoSchemaConstants.CATS_COL_CATALOG_NAME;
+import static 
org.apache.drill.exec.store.ischema.InfoSchemaConstants.SCHS_COL_SCHEMA_NAME;
+import static 
org.apache.drill.exec.store.ischema.InfoSchemaConstants.SHRD_COL_TABLE_NAME;
+import static 
org.apache.drill.exec.store.ischema.InfoSchemaConstants.SHRD_COL_TABLE_SCHEMA;
+import static 
org.apache.drill.exec.store.ischema.InfoSchemaTableType.CATALOGS;
+import static 
org.apache.drill.exec.store.ischema.InfoSchemaTableType.COLUMNS;
+import static 
org.apache.drill.exec.store.ischema.InfoSchemaTableType.SCHEMATA;
+import static 
org.apache.drill.exec.store.ischema.InfoSchemaTableType.TABLES;
+
+import java.util.UUID;
+
+import org.apache.calcite.schema.SchemaPlus;
+import org.apache.drill.common.exceptions.ErrorHelper;
+import org.apache.drill.exec.ops.ViewExpansionContext;
+import org.apache.drill.exec.proto.UserBitShared.DrillPBError;
+import org.apache.drill.exec.proto.UserBitShared.DrillPBError.ErrorType;
+import org.apache.drill.exec.proto.UserProtos.CatalogMetadata;
+import org.apache.drill.exec.proto.UserProtos.ColumnMetadata;
+import org.apache.drill.exec.proto.UserProtos.GetCatalogsResp;
+import org.apache.drill.exec.proto.UserProtos.GetCatalogsReq;
+import org.apache.drill.exec.proto.UserProtos.GetColumnsReq;
+import org.apache.drill.exec.proto.UserProtos.GetColumnsResp;
+import org.apache.drill.exec.proto.UserProtos.GetSchemasReq;
+import org.apache.drill.exec.proto.UserProtos.GetSchemasResp;
+import org.apache.drill.exec.proto.UserProtos.GetTablesReq;
+import org.apache.drill.exec.proto.UserProtos.GetTablesResp;
+import org.apache.drill.exec.proto.UserProtos.LikeFilter;
+import org.apache.drill.exec.proto.UserProtos.RequestStatus;
+import org.apache.drill.exec.proto.UserProtos.RpcType;
+import org.apache.drill.exec.proto.UserProtos.SchemaMetadata;
+import org.apache.drill.exec.proto.UserProtos.TableMetadata;
+import org.apache.drill.exec.rpc.Response;
+import org.apache.drill.exec.rpc.ResponseSender;
+import org.apache.drill.exec.rpc.user.UserServer.UserClientConnection;
+import org.apache.drill.exec.rpc.user.UserSession;
+import org.apache.drill.exec.server.DrillbitContext;
+import org.apache.drill.exec.server.options.OptionValue;
+import org.apache.drill.exec.store.SchemaConfig.SchemaConfigInfoProvider;
+import org.apache.drill.exec.store.SchemaTreeProvider;
+import org.apache.drill.exec.store.ischema.InfoSchemaConstants;
+import org.apache.drill.exec.store.ischema.InfoSchemaFilter;
+import 
org.apache.drill.exec.store.ischema.InfoSchemaFilter.ConstantExprNode;
+import org.apache.drill.exec.store.ischema.InfoSchemaFilter.ExprNode;
+import org.apache.drill.exec.store.ischema.InfoSchemaFilter.FieldExprNode;
+import 
org.apache.drill.exec.store.ischema.InfoSchemaFilter.FunctionExprNode;
+import org.apache.drill.exec.store.ischema.InfoSchemaTableType;
+import org.apache.drill.exec.store.ischema.Records.Catalog;
+import org.apache.drill.exec.store.ischema.Records.Column;
+import org.apache.drill.exec.store.ischema.Records.Schema;
+import org.apache.drill.exec.store.ischema.Records.Table;
+import org.apache.drill.exec.store.pojo.PojoRecordReader;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableList;
+
+/**
+ * Contains worker {@link Runnable} classes for providing the metadata and 
related helper methods.
+ */
+public class MetadataProvider {
+  private static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(Meta

[GitHub] drill pull request #527: DRILL-4728: Add support for new metadata fetch APIs

2016-06-28 Thread sudheeshkatkam
Github user sudheeshkatkam commented on a diff in the pull request:

https://github.com/apache/drill/pull/527#discussion_r68865614
  
--- Diff: protocol/src/main/protobuf/User.proto ---
@@ -98,3 +106,141 @@ message BitToUserHandshake {
   optional string errorId = 4;
   optional string errorMessage = 5;
 }
+
+/*
+ * Enum indicating the request status.
+ */
+enum RequestStatus {
--- End diff --

Although we haven't done this previously, I think we should use "UNKNOWN = 
0" for enums to avoid problems [mentioned 
here](http://androiddevblog.com/protocol-buffers-pitfall-adding-enum-values/).


---
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 #527: DRILL-4728: Add support for new metadata fetch APIs

2016-06-28 Thread sudheeshkatkam
Github user sudheeshkatkam commented on a diff in the pull request:

https://github.com/apache/drill/pull/527#discussion_r68865535
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/SchemaTreeProvider.java
 ---
@@ -0,0 +1,105 @@
+/**
+ * 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.store;
+
+import org.apache.calcite.jdbc.SimpleCalciteSchema;
+import org.apache.calcite.schema.SchemaPlus;
+import org.apache.drill.common.AutoCloseables;
+import org.apache.drill.common.exceptions.DrillRuntimeException;
+import org.apache.drill.exec.ExecConstants;
+import org.apache.drill.exec.server.DrillbitContext;
+import org.apache.drill.exec.store.SchemaConfig.SchemaConfigInfoProvider;
+import org.apache.drill.exec.util.ImpersonationUtil;
+
+import com.google.common.collect.Lists;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Class which creates new schema trees. It keeps track of newly created 
schema trees and closes them safely as
+ * part of {@link #close()}.
+ */
+public class SchemaTreeProvider implements AutoCloseable {
+  private static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(SchemaTreeProvider.class);
+
+  private final DrillbitContext dContext;
+  private final List schemaTreesToClose;
+  private final boolean isImpersonationEnabled;
+
+  public SchemaTreeProvider(final DrillbitContext dContext) {
+this.dContext = dContext;
+schemaTreesToClose = Lists.newArrayList();
+isImpersonationEnabled = 
dContext.getConfig().getBoolean(ExecConstants.IMPERSONATION_ENABLED);
+  }
+
+  /**
+   * Return root schema with schema owner as the given user.
+   *
+   * @param userName Name of the user who is accessing the storage sources.
+   * @param provider {@link SchemaConfigInfoProvider} instance
+   * @return Root of the schema tree.
+   */
+  public SchemaPlus getRootSchema(final String userName, final 
SchemaConfigInfoProvider provider) {
--- End diff --

createRootSchema(...)?


---
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 #527: DRILL-4728: Add support for new metadata fetch APIs

2016-06-28 Thread sudheeshkatkam
Github user sudheeshkatkam commented on a diff in the pull request:

https://github.com/apache/drill/pull/527#discussion_r68865548
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/work/metadata/MetadataProvider.java
 ---
@@ -0,0 +1,451 @@
+/**
+ * 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.work.metadata;
+
+import static 
org.apache.drill.exec.store.ischema.InfoSchemaConstants.CATS_COL_CATALOG_NAME;
+import static 
org.apache.drill.exec.store.ischema.InfoSchemaConstants.SCHS_COL_SCHEMA_NAME;
+import static 
org.apache.drill.exec.store.ischema.InfoSchemaConstants.SHRD_COL_TABLE_NAME;
+import static 
org.apache.drill.exec.store.ischema.InfoSchemaConstants.SHRD_COL_TABLE_SCHEMA;
+import static 
org.apache.drill.exec.store.ischema.InfoSchemaTableType.CATALOGS;
+import static 
org.apache.drill.exec.store.ischema.InfoSchemaTableType.COLUMNS;
+import static 
org.apache.drill.exec.store.ischema.InfoSchemaTableType.SCHEMATA;
+import static 
org.apache.drill.exec.store.ischema.InfoSchemaTableType.TABLES;
+
+import java.util.UUID;
+
+import org.apache.calcite.schema.SchemaPlus;
+import org.apache.drill.common.exceptions.ErrorHelper;
+import org.apache.drill.exec.ops.ViewExpansionContext;
+import org.apache.drill.exec.proto.UserBitShared.DrillPBError;
+import org.apache.drill.exec.proto.UserBitShared.DrillPBError.ErrorType;
+import org.apache.drill.exec.proto.UserProtos.CatalogMetadata;
+import org.apache.drill.exec.proto.UserProtos.ColumnMetadata;
+import org.apache.drill.exec.proto.UserProtos.GetCatalogsResp;
+import org.apache.drill.exec.proto.UserProtos.GetCatalogsReq;
+import org.apache.drill.exec.proto.UserProtos.GetColumnsReq;
+import org.apache.drill.exec.proto.UserProtos.GetColumnsResp;
+import org.apache.drill.exec.proto.UserProtos.GetSchemasReq;
+import org.apache.drill.exec.proto.UserProtos.GetSchemasResp;
+import org.apache.drill.exec.proto.UserProtos.GetTablesReq;
+import org.apache.drill.exec.proto.UserProtos.GetTablesResp;
+import org.apache.drill.exec.proto.UserProtos.LikeFilter;
+import org.apache.drill.exec.proto.UserProtos.RequestStatus;
+import org.apache.drill.exec.proto.UserProtos.RpcType;
+import org.apache.drill.exec.proto.UserProtos.SchemaMetadata;
+import org.apache.drill.exec.proto.UserProtos.TableMetadata;
+import org.apache.drill.exec.rpc.Response;
+import org.apache.drill.exec.rpc.ResponseSender;
+import org.apache.drill.exec.rpc.user.UserServer.UserClientConnection;
+import org.apache.drill.exec.rpc.user.UserSession;
+import org.apache.drill.exec.server.DrillbitContext;
+import org.apache.drill.exec.server.options.OptionValue;
+import org.apache.drill.exec.store.SchemaConfig.SchemaConfigInfoProvider;
+import org.apache.drill.exec.store.SchemaTreeProvider;
+import org.apache.drill.exec.store.ischema.InfoSchemaConstants;
+import org.apache.drill.exec.store.ischema.InfoSchemaFilter;
+import 
org.apache.drill.exec.store.ischema.InfoSchemaFilter.ConstantExprNode;
+import org.apache.drill.exec.store.ischema.InfoSchemaFilter.ExprNode;
+import org.apache.drill.exec.store.ischema.InfoSchemaFilter.FieldExprNode;
+import 
org.apache.drill.exec.store.ischema.InfoSchemaFilter.FunctionExprNode;
+import org.apache.drill.exec.store.ischema.InfoSchemaTableType;
+import org.apache.drill.exec.store.ischema.Records.Catalog;
+import org.apache.drill.exec.store.ischema.Records.Column;
+import org.apache.drill.exec.store.ischema.Records.Schema;
+import org.apache.drill.exec.store.ischema.Records.Table;
+import org.apache.drill.exec.store.pojo.PojoRecordReader;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableList;
+
+/**
+ * Contains worker {@link Runnable} classes for providing the metadata and 
related helper methods.
+ */
+public class MetadataProvider {
+  private static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(Meta

[GitHub] drill pull request #527: DRILL-4728: Add support for new metadata fetch APIs

2016-06-28 Thread sudheeshkatkam
Github user sudheeshkatkam commented on a diff in the pull request:

https://github.com/apache/drill/pull/527#discussion_r68865539
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/SchemaTreeProvider.java
 ---
@@ -0,0 +1,105 @@
+/**
+ * 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.store;
+
+import org.apache.calcite.jdbc.SimpleCalciteSchema;
+import org.apache.calcite.schema.SchemaPlus;
+import org.apache.drill.common.AutoCloseables;
+import org.apache.drill.common.exceptions.DrillRuntimeException;
+import org.apache.drill.exec.ExecConstants;
+import org.apache.drill.exec.server.DrillbitContext;
+import org.apache.drill.exec.store.SchemaConfig.SchemaConfigInfoProvider;
+import org.apache.drill.exec.util.ImpersonationUtil;
+
+import com.google.common.collect.Lists;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Class which creates new schema trees. It keeps track of newly created 
schema trees and closes them safely as
+ * part of {@link #close()}.
+ */
+public class SchemaTreeProvider implements AutoCloseable {
+  private static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(SchemaTreeProvider.class);
+
+  private final DrillbitContext dContext;
+  private final List schemaTreesToClose;
+  private final boolean isImpersonationEnabled;
+
+  public SchemaTreeProvider(final DrillbitContext dContext) {
+this.dContext = dContext;
+schemaTreesToClose = Lists.newArrayList();
+isImpersonationEnabled = 
dContext.getConfig().getBoolean(ExecConstants.IMPERSONATION_ENABLED);
+  }
+
+  /**
+   * Return root schema with schema owner as the given user.
+   *
+   * @param userName Name of the user who is accessing the storage sources.
+   * @param provider {@link SchemaConfigInfoProvider} instance
+   * @return Root of the schema tree.
+   */
+  public SchemaPlus getRootSchema(final String userName, final 
SchemaConfigInfoProvider provider) {
+final String schemaUser = isImpersonationEnabled ? userName : 
ImpersonationUtil.getProcessUserName();
+final SchemaConfig schemaConfig = SchemaConfig.newBuilder(schemaUser, 
provider).build();
+return getRootSchema(schemaConfig);
+  }
+
+  /**
+   * Create and return a SchemaTree with given schemaConfig.
+   * @param schemaConfig
+   * @return
+   */
+  public SchemaPlus getRootSchema(SchemaConfig schemaConfig) {
--- End diff --

createRootSchema(...)?


---
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 #532: DRILL-4732: Update JDBC driver to use the new prepa...

2016-06-28 Thread parthchandra
Github user parthchandra commented on a diff in the pull request:

https://github.com/apache/drill/pull/532#discussion_r68863584
  
--- Diff: 
exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillConnectionImpl.java ---
@@ -362,12 +364,33 @@ public PreparedStatement prepareStatement(String sql, 
int resultSetType,
 int resultSetHoldability) 
throws SQLException {
 throwIfClosed();
 try {
-  DrillPrepareResult prepareResult = new DrillPrepareResult(sql);
+  DrillRpcFuture respFuture = 
client.createPreparedStatement(sql);
+
+  CreatePreparedStatementResp resp;
+  try {
+resp = respFuture.get();
+  } catch (InterruptedException e) {
+// Preserve evidence that the interruption occurred so that code 
higher up
+// on the call stack can learn of the interruption and respond to 
it if it
+// wants to.
+Thread.currentThread().interrupt();
+
+throw new SQLException( "Interrupted", e );
--- End diff --

Since the client connection is still alive, the query would continue to 
execute on the server and presumably still send back results. Where are the 
results consumed if an interrupt occurs here?



---
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 #536: DRILL-4699: Add description column to sys.options t...

2016-06-28 Thread sudheeshkatkam
GitHub user sudheeshkatkam opened a pull request:

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

DRILL-4699: Add description column to sys.options table

+ Add new constructor for each validator in TypeValidators with
  description field; deprecate old constructors
+ Add descriptions for some validators

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

$ git pull https://github.com/sudheeshkatkam/drill DRILL-4699

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

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


commit f8a78394423cca46aa3bfd63b2436c606df4b5b7
Author: Sudheesh Katkam 
Date:   2016-06-28T23:12:08Z

DRILL-4699: Add description column to sys.options table

+ Add new constructor for each validator in TypeValidators with
  description field; deprecate old constructors
+ Add descriptions for some validators




---
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 #530: DRILL-4729: Add support for prepared statement impl...

2016-06-28 Thread parthchandra
Github user parthchandra commented on a diff in the pull request:

https://github.com/apache/drill/pull/530#discussion_r68859742
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/work/prepare/PreparedStatementProvider.java
 ---
@@ -0,0 +1,419 @@
+/**
+ * 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.work.prepare;
+
+import org.apache.drill.common.exceptions.ErrorHelper;
+import org.apache.drill.common.types.TypeProtos.DataMode;
+import org.apache.drill.common.types.TypeProtos.MajorType;
+import org.apache.drill.common.types.TypeProtos.MinorType;
+import org.apache.drill.common.types.Types;
+import org.apache.drill.exec.physical.impl.materialize.QueryWritableBatch;
+import org.apache.drill.exec.proto.ExecProtos.ServerPreparedStatementState;
+import org.apache.drill.exec.proto.GeneralRPCProtos.Ack;
+import org.apache.drill.exec.proto.UserBitShared.DrillPBError;
+import org.apache.drill.exec.proto.UserBitShared.DrillPBError.ErrorType;
+import org.apache.drill.exec.proto.UserBitShared.QueryId;
+import org.apache.drill.exec.proto.UserBitShared.QueryResult;
+import org.apache.drill.exec.proto.UserBitShared.QueryResult.QueryState;
+import org.apache.drill.exec.proto.UserBitShared.QueryType;
+import org.apache.drill.exec.proto.UserBitShared.SerializedField;
+import org.apache.drill.exec.proto.UserProtos.ColumnSearchability;
+import org.apache.drill.exec.proto.UserProtos.ColumnUpdatability;
+import org.apache.drill.exec.proto.UserProtos.CreatePreparedStatementReq;
+import org.apache.drill.exec.proto.UserProtos.CreatePreparedStatementResp;
+import org.apache.drill.exec.proto.UserProtos.PreparedStatement;
+import org.apache.drill.exec.proto.UserProtos.PreparedStatementHandle;
+import org.apache.drill.exec.proto.UserProtos.RequestStatus;
+import org.apache.drill.exec.proto.UserProtos.ResultColumnMetadata;
+import org.apache.drill.exec.proto.UserProtos.RpcType;
+import org.apache.drill.exec.proto.UserProtos.RunQuery;
+import org.apache.drill.exec.rpc.Acks;
+import org.apache.drill.exec.rpc.Response;
+import org.apache.drill.exec.rpc.ResponseSender;
+import org.apache.drill.exec.rpc.RpcOutcomeListener;
+import org.apache.drill.exec.rpc.user.UserServer.UserClientConnection;
+import org.apache.drill.exec.rpc.user.UserSession;
+import org.apache.drill.exec.store.ischema.InfoSchemaConstants;
+import org.apache.drill.exec.work.user.UserWorker;
+import org.joda.time.Period;
+
+import com.google.common.collect.ImmutableMap;
+
+import io.netty.buffer.ByteBuf;
+import io.netty.channel.ChannelFuture;
+import java.math.BigDecimal;
+import java.net.SocketAddress;
+import java.sql.Date;
+import java.sql.ResultSetMetaData;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Contains worker {@link Runnable} for creating a prepared statement and 
helper methods.
+ */
+public class PreparedStatementProvider {
+  private static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(PreparedStatementProvider.class);
+
+  private static final int LIMIT_0_QUERY_TIMEOUT_MINS = 10;
--- End diff --

I would make this limit configurable. Ideally, the client should be able to 
cancel the prepare statement request. There is no way to get the query id for 
the prepare (i.e limit0) query, is there?


---
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 #535: DRILL-4695: Log error thrown from drillbit.run

2016-06-28 Thread sudheeshkatkam
Github user sudheeshkatkam commented on a diff in the pull request:

https://github.com/apache/drill/pull/535#discussion_r68858974
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/Drillbit.java ---
@@ -283,6 +284,7 @@ public static Drillbit start(final DrillConfig config, 
final RemoteServiceSet re
 try {
   bit.run();
 } catch (final Exception e) {
+  logger.error("Failure during initial startup of Drillbit.\n[{}]", 
ErrorHelper.buildCausesMessage(e));
--- End diff --

I'd suggest using `logger.error("Failure during initial startup of 
Drillbit.", e);` Log parsers like Lilith use the exception field, and changes 
to ErrorHelper aren't required.


---
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 #535: DRILL-4695: Log error thrown from drillbit.run

2016-06-28 Thread chunhui-shi
GitHub user chunhui-shi opened a pull request:

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

DRILL-4695: Log error thrown from drillbit.run



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

$ git pull https://github.com/chunhui-shi/drill errexit

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

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


commit fac6870302c5807ef37409385e481fd7ccf105a6
Author: chunhui-shi 
Date:   2016-06-28T22:22:13Z

DRILL-4695: Log error thrown from drillbit.run




---
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 #515: DRILL-4707: Fix memory leak or incorrect query result in c...

2016-06-28 Thread amansinha100
Github user amansinha100 commented on the issue:

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


Re: Drill Hangout Meeting Minutes - 6/28/16

2016-06-28 Thread Subbu Srinivasan
First, Congrats to team for the 1.7 release?

Can we revisit and look at DRILL-4653? I have made more changes as per
feedback.



On Tue, Jun 28, 2016 at 12:31 PM, Zelaine Fong  wrote:

> Attendees: Aman, Jinfeng, Sudheesh, Parth, Arina, Paul, John O, Padma,
> Gautam, Khurram, Zelaine
>
> 1) JDBC Storage Plugin Issues
>
> We discussed DRILL-4696.  Parth and Sudheesh suggested that even with the
> change suggested in DRILL-4177, this particular problem may still result in
> out of memory because the MySQL fetch size needs to be set at the statement
> level instead of in the connect string.  Parth added a comment with this
> suggestion in DRILL-4177.
>
> Aside from the memory problem, the fact that the 4-way join isn't being
> pushed completely to MySQL may be a limitation in the JDBC storage plugin.
> The plugin doesn't seem to be taking into consideration the actual
> underlying row count of the table.  Aman suggested possibly tweaking one of
> the optimizer parameters as a short-term workaround to force all plans to
> be fully pushed down.
>
> 2) 1.7 has been released in open source Apache!
>


Drill Hangout Meeting Minutes - 6/28/16

2016-06-28 Thread Zelaine Fong
Attendees: Aman, Jinfeng, Sudheesh, Parth, Arina, Paul, John O, Padma,
Gautam, Khurram, Zelaine

1) JDBC Storage Plugin Issues

We discussed DRILL-4696.  Parth and Sudheesh suggested that even with the
change suggested in DRILL-4177, this particular problem may still result in
out of memory because the MySQL fetch size needs to be set at the statement
level instead of in the connect string.  Parth added a comment with this
suggestion in DRILL-4177.

Aside from the memory problem, the fact that the 4-way join isn't being
pushed completely to MySQL may be a limitation in the JDBC storage plugin.
The plugin doesn't seem to be taking into consideration the actual
underlying row count of the table.  Aman suggested possibly tweaking one of
the optimizer parameters as a short-term workaround to force all plans to
be fully pushed down.

2) 1.7 has been released in open source Apache!


[GitHub] drill pull request #519: DRILL-4530: Optimize partition pruning with metadat...

2016-06-28 Thread jinfengni
Github user jinfengni commented on a diff in the pull request:

https://github.com/apache/drill/pull/519#discussion_r68814702
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSelection.java 
---
@@ -47,16 +47,25 @@
   private List statuses;
 
   public List files;
+  /**
+   * root path for the selections
+   */
   public final String selectionRoot;
+  /**
+   * root path for the metadata cache file (if any)
+   */
+  public final String cacheFileRoot;
--- End diff --

Thanks for the explanation. It makes sense and I do see why updating 
selectionRoot would cause problems for the queries you mentioned. 


---
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.
---


Hangout Starting Now

2016-06-28 Thread Sudheesh Katkam
Hangout starting now: 
https://hangouts.google.com/hangouts/_/event/ci4rdiju8bv04a64efj5fedd0lc 


Join us!

Thank you,
Sudheesh