You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2018/11/07 14:12:12 UTC

[GitHub] lushuifeng commented on a change in pull request #1519: DRILL-6760: Retain original exception in Verbose Error Message

lushuifeng commented on a change in pull request #1519: DRILL-6760: Retain original exception in Verbose Error Message
URL: https://github.com/apache/drill/pull/1519#discussion_r231517724
 
 

 ##########
 File path: exec/java-exec/src/test/java/org/apache/drill/exec/ProfileTest.java
 ##########
 @@ -0,0 +1,65 @@
+/*
+ * 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;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.drill.exec.proto.UserBitShared;
+import org.apache.drill.exec.server.DrillbitContext;
+import org.apache.drill.exec.store.sys.PersistentStore;
+import org.apache.drill.test.ClusterFixture;
+import org.apache.drill.test.ClusterTest;
+import org.apache.drill.test.QueryBuilder;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import static org.junit.Assert.fail;
+
+public class ProfileTest extends ClusterTest {
+  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ProfileTest.class);
+
+  @BeforeClass
+  public static void setup() throws Exception {
+    startCluster(ClusterFixture.builder(dirTestWatcher));
+  }
+
+  @Test
+  public void verboseErrorTest() throws Exception {
+    DrillbitContext context = cluster.drillbit().getContext();
+    PersistentStore<UserBitShared.QueryProfile> completed = context.getProfileStoreContext().getCompletedProfileStore();
+    String sql = "select * from cp.`jsoninput/DRILL-2350.json`";
+    QueryBuilder.QuerySummaryFuture future = client.queryBuilder().sql(sql).futureSummary();
+    QueryBuilder.QuerySummary summary = future.get();
+    String queryId = summary.queryIdString();
+    UserBitShared.QueryProfile profile = completed.get(queryId);
+    if (profile == null) {
 
 Review comment:
   The test always failed and verbose error is absent, What's interesting is that the queryId sometimes is not stored in Completed Store in Travis tests which is not reproducible on my laptop.
   You can launch the sqlline and run the same sql test in `ProfileTest` and take a look at the error page.
   I will provide more details tomorrow.

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


With regards,
Apache Git Services