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

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

agozhiy commented on pull request #1833: DRILL-6961: Handle exceptions during 
queries to information_schema
URL: https://github.com/apache/drill/pull/1833#discussion_r311018709
 
 

 ##########
 File path: 
contrib/storage-opentsdb/src/test/java/org/apache/drill/store/openTSDB/TestOpenTSDBPlugin.java
 ##########
 @@ -185,4 +190,46 @@ public void testDescribe() throws Exception {
     test("describe `warp.speed.test`");
     Assert.assertEquals(1, testSql("show tables"));
   }
+
+  @Test
+  public void testInformationSchemaWrongPluginConfig() throws Exception {
+    ClusterFixture cluster = ClusterFixture.bareBuilder(dirTestWatcher)
+        .build();
+    int portNumber = QueryTestUtil.getFreePortNumber(10_000, 200);
+    final StoragePluginRegistry pluginRegistry = 
cluster.drillbit().getContext().getStorage();
+    OpenTSDBStoragePluginConfig storagePluginConfig =
+        new OpenTSDBStoragePluginConfig(String.format("http://localhost:%s/";, 
portNumber));
+    storagePluginConfig.setEnabled(true);
+    pluginRegistry.createOrUpdate(OpenTSDBStoragePluginConfig.NAME, 
storagePluginConfig, true);
+    test("select * from information_schema.`views`", cluster);
+  }
+
+  private void test(String query) throws Exception {
+    test(query, cluster);
+  }
+
+  private void test(String query, ClusterFixture cluster) throws Exception {
+    cluster.clientFixture().runQueriesAndLog(query);
+  }
+
+  private int testSql(String query) throws Exception {
+    return (int) cluster.clientFixture()
+        .queryBuilder()
+        .sql(query)
+        .print();
+  }
+
+  private String getPlan(String query) throws Exception {
+    return cluster.clientFixture()
+        .queryBuilder()
+        .sql(query)
+        .explainJson();
+  }
+
+  private void testPhysicalPlanExecution(String plan) throws Exception {
 
 Review comment:
   Done.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


> Error Occurred: Cannot connect to the db. query INFORMATION_SCHEMA.VIEWS : 
> Maybe you have incorrect connection params or db unavailable now (timeout)
> -----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DRILL-6961
>                 URL: https://issues.apache.org/jira/browse/DRILL-6961
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Storage - Information Schema
>    Affects Versions: 1.13.0
>            Reporter: Khurram Faraaz
>            Assignee: Anton Gozhiy
>            Priority: Major
>              Labels: ready-to-commit
>             Fix For: 1.17.0
>
>
> Trying to query drill information_schema.views table returns error. Disabling 
> openTSDB plugin resolves the problem.
> Drill 1.13.0
> Failing query :
> {noformat}
> SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, VIEW_DEFINITION FROM 
> INFORMATION_SCHEMA.`VIEWS` where VIEW_DEFINITION not like 'kraken';
> {noformat}
> Stack Trace from drillbit.log
> {noformat}
> 2019-01-07 15:36:21,975 [23cc39aa-2618-e9f0-e77e-4fafa6edc314:foreman] INFO 
> o.a.drill.exec.work.foreman.Foreman - Query text for query id 
> 23cc39aa-2618-e9f0-e77e-4fafa6edc314: SELECT TABLE_CATALOG, TABLE_SCHEMA, 
> TABLE_NAME, VIEW_DEFINITION FROM INFORMATION_SCHEMA.`VIEWS` where 
> VIEW_DEFINITION not like 'kraken'
> 2019-01-07 15:36:35,221 [23cc39aa-2618-e9f0-e77e-4fafa6edc314:frag:0:0] INFO 
> o.a.d.e.s.o.c.services.ServiceImpl - User Error Occurred: Cannot connect to 
> the db. Maybe you have incorrect connection params or db unavailable now 
> (timeout)
> org.apache.drill.common.exceptions.UserException: CONNECTION ERROR: Cannot 
> connect to the db. Maybe you have incorrect connection params or db 
> unavailable now
> [Error Id: f8b4c074-ba62-4691-b142-a8ea6e4f6b2a ]
> at 
> org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:633)
>  ~[drill-common-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.store.openTSDB.client.services.ServiceImpl.getTableNames(ServiceImpl.java:107)
>  [drill-opentsdb-storage-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.store.openTSDB.client.services.ServiceImpl.getAllMetricNames(ServiceImpl.java:70)
>  [drill-opentsdb-storage-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.store.openTSDB.schema.OpenTSDBSchemaFactory$OpenTSDBSchema.getTableNames(OpenTSDBSchemaFactory.java:78)
>  [drill-opentsdb-storage-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.calcite.jdbc.SimpleCalciteSchema.addImplicitTableToBuilder(SimpleCalciteSchema.java:106)
>  [calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
> at 
> org.apache.calcite.jdbc.CalciteSchema.getTableNames(CalciteSchema.java:318) 
> [calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
> at 
> org.apache.calcite.jdbc.CalciteSchema$SchemaPlusImpl.getTableNames(CalciteSchema.java:587)
>  [calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
> at 
> org.apache.calcite.jdbc.CalciteSchema$SchemaPlusImpl.getTableNames(CalciteSchema.java:548)
>  [calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
> at 
> org.apache.drill.exec.store.ischema.InfoSchemaRecordGenerator.visitTables(InfoSchemaRecordGenerator.java:227)
>  [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.store.ischema.InfoSchemaRecordGenerator.scanSchema(InfoSchemaRecordGenerator.java:216)
>  [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.store.ischema.InfoSchemaRecordGenerator.scanSchema(InfoSchemaRecordGenerator.java:209)
>  [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.store.ischema.InfoSchemaRecordGenerator.scanSchema(InfoSchemaRecordGenerator.java:196)
>  [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.store.ischema.InfoSchemaTableType.getRecordReader(InfoSchemaTableType.java:58)
>  [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.store.ischema.InfoSchemaBatchCreator.getBatch(InfoSchemaBatchCreator.java:34)
>  [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.store.ischema.InfoSchemaBatchCreator.getBatch(InfoSchemaBatchCreator.java:30)
>  [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.physical.impl.ImplCreator$2.run(ImplCreator.java:146) 
> [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.physical.impl.ImplCreator$2.run(ImplCreator.java:142) 
> [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at java.security.AccessController.doPrivileged(Native Method) [na:1.8.0_144]
> at javax.security.auth.Subject.doAs(Subject.java:422) [na:1.8.0_144]
> at 
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1633)
>  [hadoop-common-2.7.0-mapr-1710.jar:na]
> at 
> org.apache.drill.exec.physical.impl.ImplCreator.getRecordBatch(ImplCreator.java:142)
>  [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.physical.impl.ImplCreator.getChildren(ImplCreator.java:182)
>  [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.physical.impl.ImplCreator.getRecordBatch(ImplCreator.java:137)
>  [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.physical.impl.ImplCreator.getChildren(ImplCreator.java:182)
>  [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.physical.impl.ImplCreator.getRecordBatch(ImplCreator.java:137)
>  [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.physical.impl.ImplCreator.getChildren(ImplCreator.java:182)
>  [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.physical.impl.ImplCreator.getRecordBatch(ImplCreator.java:137)
>  [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.physical.impl.ImplCreator.getChildren(ImplCreator.java:182)
>  [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.physical.impl.ImplCreator.getRootExec(ImplCreator.java:110)
>  [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.physical.impl.ImplCreator.getExec(ImplCreator.java:87) 
> [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:206)
>  [drill-java-exec-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> org.apache.drill.common.SelfCleaningRunnable.run(SelfCleaningRunnable.java:38)
>  [drill-common-1.13.0-mapr.jar:1.13.0-mapr]
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>  [na:1.8.0_144]
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>  [na:1.8.0_144]
> at java.lang.Thread.run(Thread.java:748) [na:1.8.0_144]
> Caused by: java.net.SocketTimeoutException: timeout
> at okio.Okio$3.newTimeoutException(Okio.java:212) ~[okio-1.8.0.jar:na]
> at okio.AsyncTimeout.exit(AsyncTimeout.java:288) ~[okio-1.8.0.jar:na]
> at okio.AsyncTimeout$2.read(AsyncTimeout.java:242) ~[okio-1.8.0.jar:na]
> at okio.RealBufferedSource.indexOf(RealBufferedSource.java:325) 
> ~[okio-1.8.0.jar:na]
> at okio.RealBufferedSource.indexOf(RealBufferedSource.java:314) 
> ~[okio-1.8.0.jar:na]
> at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:210) 
> ~[okio-1.8.0.jar:na]
> at okhttp3.internal.http.Http1xStream.readResponse(Http1xStream.java:184) 
> ~[okhttp-3.3.0.jar:na]
> at 
> okhttp3.internal.http.Http1xStream.readResponseHeaders(Http1xStream.java:125) 
> ~[okhttp-3.3.0.jar:na]
> at okhttp3.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:775) 
> ~[okhttp-3.3.0.jar:na]
> at okhttp3.internal.http.HttpEngine.access$200(HttpEngine.java:86) 
> ~[okhttp-3.3.0.jar:na]
> at 
> okhttp3.internal.http.HttpEngine$NetworkInterceptorChain.proceed(HttpEngine.java:760)
>  ~[okhttp-3.3.0.jar:na]
> at okhttp3.internal.http.HttpEngine.readResponse(HttpEngine.java:613) 
> ~[okhttp-3.3.0.jar:na]
> at okhttp3.RealCall.getResponse(RealCall.java:244) ~[okhttp-3.3.0.jar:na]
> at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:201) 
> ~[okhttp-3.3.0.jar:na]
> at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:163) 
> ~[okhttp-3.3.0.jar:na]
> at okhttp3.RealCall.execute(RealCall.java:57) ~[okhttp-3.3.0.jar:na]
> at retrofit2.OkHttpCall.execute(OkHttpCall.java:174) ~[retrofit-2.1.0.jar:na]
> at 
> org.apache.drill.exec.store.openTSDB.client.services.ServiceImpl.getTableNames(ServiceImpl.java:102)
>  [drill-opentsdb-storage-1.13.0-mapr.jar:1.13.0-mapr]
> ... 33 common frames omitted
> Caused by: java.net.SocketException: Socket closed
> at java.net.SocketInputStream.read(SocketInputStream.java:204) ~[na:1.8.0_144]
> at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[na:1.8.0_144]
> at okio.Okio$2.read(Okio.java:140) ~[okio-1.8.0.jar:na]
> at okio.AsyncTimeout$2.read(AsyncTimeout.java:238) ~[okio-1.8.0.jar:na]
> ... 48 common frames omitted
> 2019-01-07 15:36:35,221 [23cc39aa-2618-e9f0-e77e-4fafa6edc314:frag:0:0] INFO 
> o.a.d.e.w.fragment.FragmentExecutor - 
> 23cc39aa-2618-e9f0-e77e-4fafa6edc314:0:0: State change requested 
> AWAITING_ALLOCATION --> FAILED
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to