Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 46930200BC2 for ; Thu, 17 Nov 2016 22:18:02 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 44D07160B0B; Thu, 17 Nov 2016 21:18:02 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E0DBA160AD8 for ; Thu, 17 Nov 2016 22:18:00 +0100 (CET) Received: (qmail 55061 invoked by uid 500); 17 Nov 2016 21:18:00 -0000 Mailing-List: contact issues-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list issues@drill.apache.org Received: (qmail 55049 invoked by uid 99); 17 Nov 2016 21:17:59 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Nov 2016 21:17:59 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id A17062C0088 for ; Thu, 17 Nov 2016 21:17:59 +0000 (UTC) Date: Thu, 17 Nov 2016 21:17:59 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-5047) When session option is string, query profile is displayed incorrectly on Web UI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 17 Nov 2016 21:18:02 -0000 [ https://issues.apache.org/jira/browse/DRILL-5047?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1567= 4837#comment-15674837 ]=20 ASF GitHub Bot commented on DRILL-5047: --------------------------------------- Github user paul-rogers commented on a diff in the pull request: https://github.com/apache/drill/pull/655#discussion_r88547748 =20 --- Diff: exec/java-exec/src/main/resources/rest/profile/profile.ftl --= - @@ -132,7 +132,7 @@ <#list model.getOptionList() as option> ${option.getName()} - ${option.getValue()?c} + ${option.getValue()?string} --- End diff -- =20 According to the [documentation](), ?string works only for numbers and = formats them for "human display". ?c also works for numbers (and formats th= em as "C" language constants.) =20 The challenge is that this template line works for all data types. So, = the suggestion of using toString( ) is good. But, since toString( ) may be = used for debugging, perhaps add a toDisplayString( ) that will format the v= alue as we want it to appear in the Web UI. =20 Another issue: are we sure that the value of option is always non-null = at this point? > When session option is string, query profile is displayed incorrectly on = Web UI > -------------------------------------------------------------------------= ------ > > Key: DRILL-5047 > URL: https://issues.apache.org/jira/browse/DRILL-5047 > Project: Apache Drill > Issue Type: Bug > Affects Versions: 1.9.0 > Reporter: Arina Ielchiieva > Assignee: Gautam Kumar Parai > Attachments: session_options_all_types.JPG > > > When session option is string, query profile is displayed incorrectly on = Web UI: > {noformat} > Name =09Value > store.format =09FreeMarker template error: For "?c" left-hand operand: Ex= pected a number or boolean, but this evaluated to a string (wrapper: f.t.Si= mpleScalar): =3D=3D> option.getValue() [in template "rest/profile/profile.f= tl" at line 135, column 27] ---- FTL stack trace ("~" means nesting-related= ): - Failed at: ${option.getValue()?c} [in template "rest/profile/profile.f= tl" in macro "page_body" at line 135, column 25] - Reached through: @page_b= ody [in template "rest/profile/*/generic.ftl" in macro "page_html" at line = 89, column 9] - Reached through: @page_html [in template "rest/profile/prof= ile.ftl" at line 247, column 1] ---- Java stack trace (for programmers): --= -- freemarker.core.UnexpectedTypeException: [... Exception message was alre= ady printed; see it above ...] at freemarker.core.BuiltInsForMultipleTypes$= AbstractCBI._eval(BuiltInsForMultipleTypes.java:598) at freemarker.core.Exp= ression.eval(Expression.java:76) at freemarker.core.Expression.evalAndCoerc= eToString(Expression.java:80) at freemarker.core.DollarVariable.accept(Doll= arVariable.java:40) at freemarker.core.Environment.visit(Environment.java:2= 57) at freemarker.core.MixedContent.accept(MixedContent.java:57) at freemar= ker.core.Environment.visitByHiddingParent(Environment.java:278) at freemark= er.core.IteratorBlock$Context.runLoop(IteratorBlock.java:157) at freemarker= .core.Environment.visitIteratorBlock(Environment.java:501) at freemarker.co= re.IteratorBlock.accept(IteratorBlock.java:67) at freemarker.core.Environme= nt.visit(Environment.java:257) at freemarker.core.MixedContent.accept(Mixed= Content.java:57) at freemarker.core.Environment.visitByHiddingParent(Enviro= nment.java:278) at freemarker.core.ConditionalBlock.accept(ConditionalBlock= .java:48) at freemarker.core.Environment.visit(Environment.java:257) at fre= emarker.core.MixedContent.accept(MixedContent.java:57) at freemarker.core.E= nvironment.visit(Environment.java:257) at freemarker.core.Macro$Context.run= Macro(Macro.java:173) at freemarker.core.Environment.visit(Environment.java= :686) at freemarker.core.UnifiedCall.accept(UnifiedCall.java:80) at freemar= ker.core.Environment.visit(Environment.java:257) at freemarker.core.MixedCo= ntent.accept(MixedContent.java:57) at freemarker.core.Environment.visit(Env= ironment.java:257) at freemarker.core.Macro$Context.runMacro(Macro.java:173= ) at freemarker.core.Environment.visit(Environment.java:686) at freemarker.= core.UnifiedCall.accept(UnifiedCall.java:80) at freemarker.core.Environment= .visit(Environment.java:257) at freemarker.core.MixedContent.accept(MixedCo= ntent.java:57) at freemarker.core.Environment.visit(Environment.java:257) a= t freemarker.core.Environment.process(Environment.java:235) at freemarker.t= emplate.Template.process(Template.java:262) at org.glassfish.jersey.server.= mvc.freemarker.FreemarkerViewProcessor.writeTo(FreemarkerViewProcessor.java= :143) at org.glassfish.jersey.server.mvc.freemarker.FreemarkerViewProcessor= .writeTo(FreemarkerViewProcessor.java:85) at org.glassfish.jersey.server.mv= c.spi.ResolvedViewable.writeTo(ResolvedViewable.java:116) at org.glassfish.= jersey.server.mvc.internal.ViewableMessageBodyWriter.writeTo(ViewableMessag= eBodyWriter.java:134) at org.glassfish.jersey.server.mvc.internal.ViewableM= essageBodyWriter.writeTo(ViewableMessageBodyWriter.java:88) at org.glassfis= h.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterIntercept= or.invokeWriteTo(WriterInterceptorExecutor.java:263) at org.glassfish.jerse= y.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.arou= ndWriteTo(WriterInterceptorExecutor.java:250) at org.glassfish.jersey.messa= ge.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.jav= a:162) at org.glassfish.jersey.server.mvc.internal.TemplateMethodIntercepto= r.aroundWriteTo(TemplateMethodInterceptor.java:77) at org.glassfish.jersey.= message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecuto= r.java:162) at org.glassfish.jersey.server.internal.JsonWithPaddingIntercep= tor.aroundWriteTo(JsonWithPaddingInterceptor.java:103) at org.glassfish.jer= sey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExe= cutor.java:162) at org.glassfish.jersey.server.internal.MappableExceptionWr= apperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:88)= at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed= (WriterInterceptorExecutor.java:162) at org.glassfish.jersey.message.intern= al.MessageBodyFactory.writeTo(MessageBodyFactory.java:1154) at org.glassfis= h.jersey.server.ServerRuntime$Responder.writeResponse(ServerRuntime.java:61= 3) at org.glassfish.jersey.server.ServerRuntime$Responder.processResponse(S= erverRuntime.java:375) at org.glassfish.jersey.server.ServerRuntime$Respond= er.process(ServerRuntime.java:365) at org.glassfish.jersey.server.ServerRun= time$1.run(ServerRuntime.java:272) at org.glassfish.jersey.internal.Errors$= 1.call(Errors.java:271) at org.glassfish.jersey.internal.Errors$1.call(Erro= rs.java:267) at org.glassfish.jersey.internal.Errors.process(Errors.java:31= 5) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.= glassfish.jersey.internal.Errors.process(Errors.java:267) at org.glassfish.= jersey.process.internal.RequestScope.runInScope(RequestScope.java:297) at o= rg.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:252) at= org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.j= ava:1023) at org.glassfish.jersey.servlet.WebComponent.service(WebComponent= .java:372) at org.glassfish.jersey.servlet.ServletContainer.service(Servlet= Container.java:382) at org.glassfish.jersey.servlet.ServletContainer.servic= e(ServletContainer.java:345) at org.glassfish.jersey.servlet.ServletContain= er.service(ServletContainer.java:220) at org.eclipse.jetty.servlet.ServletH= older.handle(ServletHolder.java:738) at org.eclipse.jetty.servlet.ServletHa= ndler.doHandle(ServletHandler.java:551) at org.eclipse.jetty.server.session= .SessionHandler.doHandle(SessionHandler.java:219) at org.eclipse.jetty.serv= er.handler.ContextHandler.doHandle(ContextHandler.java:1111) at org.eclipse= .jetty.servlet.ServletHandler.doScope(ServletHandler.java:478) at org.eclip= se.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183) at = org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java= :1045) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandl= er.java:141) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(Hand= lerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:4= 62) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:279) at= org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232= ) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:= 534) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadP= ool.java:607) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(Queue= dThreadPool.java:536) at java.lang.Thread.run(Thread.java:745)=20 > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)