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

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
  
    --- Diff: exec/java-exec/src/main/resources/rest/profile/profile.ftl ---
    @@ -132,7 +132,7 @@
                     <#list model.getOptionList() as option>
                       <tr>
                         <td>${option.getName()}</td>
    -                    <td>${option.getValue()?c}</td>
    +                    <td>${option.getValue()?string}</td>
    --- End diff --
    
    According to the [documentation](), ?string works only for numbers and 
formats them for "human display". ?c also works for numbers (and formats them 
as "C" language constants.)
    
    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 value as we 
want it to appear in the Web UI.
    
    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  Value
> store.format  FreeMarker template error: For "?c" left-hand operand: Expected 
> a number or boolean, but this evaluated to a string (wrapper: 
> f.t.SimpleScalar): ==> option.getValue() [in template 
> "rest/profile/profile.ftl" at line 135, column 27] ---- FTL stack trace ("~" 
> means nesting-related): - Failed at: ${option.getValue()?c} [in template 
> "rest/profile/profile.ftl" in macro "page_body" at line 135, column 25] - 
> Reached through: @page_body [in template "rest/profile/*/generic.ftl" in 
> macro "page_html" at line 89, column 9] - Reached through: @page_html [in 
> template "rest/profile/profile.ftl" at line 247, column 1] ---- Java stack 
> trace (for programmers): ---- freemarker.core.UnexpectedTypeException: [... 
> Exception message was already printed; see it above ...] at 
> freemarker.core.BuiltInsForMultipleTypes$AbstractCBI._eval(BuiltInsForMultipleTypes.java:598)
>  at freemarker.core.Expression.eval(Expression.java:76) at 
> freemarker.core.Expression.evalAndCoerceToString(Expression.java:80) at 
> freemarker.core.DollarVariable.accept(DollarVariable.java:40) at 
> freemarker.core.Environment.visit(Environment.java:257) at 
> freemarker.core.MixedContent.accept(MixedContent.java:57) at 
> freemarker.core.Environment.visitByHiddingParent(Environment.java:278) at 
> freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:157) at 
> freemarker.core.Environment.visitIteratorBlock(Environment.java:501) at 
> freemarker.core.IteratorBlock.accept(IteratorBlock.java:67) at 
> freemarker.core.Environment.visit(Environment.java:257) at 
> freemarker.core.MixedContent.accept(MixedContent.java:57) at 
> freemarker.core.Environment.visitByHiddingParent(Environment.java:278) at 
> freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:48) at 
> freemarker.core.Environment.visit(Environment.java:257) at 
> freemarker.core.MixedContent.accept(MixedContent.java:57) at 
> freemarker.core.Environment.visit(Environment.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(MixedContent.java:57) at 
> freemarker.core.Environment.visit(Environment.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(MixedContent.java:57) at 
> freemarker.core.Environment.visit(Environment.java:257) at 
> freemarker.core.Environment.process(Environment.java:235) at 
> freemarker.template.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.mvc.spi.ResolvedViewable.writeTo(ResolvedViewable.java:116)
>  at 
> org.glassfish.jersey.server.mvc.internal.ViewableMessageBodyWriter.writeTo(ViewableMessageBodyWriter.java:134)
>  at 
> org.glassfish.jersey.server.mvc.internal.ViewableMessageBodyWriter.writeTo(ViewableMessageBodyWriter.java:88)
>  at 
> org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:263)
>  at 
> org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:250)
>  at 
> org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
>  at 
> org.glassfish.jersey.server.mvc.internal.TemplateMethodInterceptor.aroundWriteTo(TemplateMethodInterceptor.java:77)
>  at 
> org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
>  at 
> org.glassfish.jersey.server.internal.JsonWithPaddingInterceptor.aroundWriteTo(JsonWithPaddingInterceptor.java:103)
>  at 
> org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
>  at 
> org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:88)
>  at 
> org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
>  at 
> org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1154)
>  at 
> org.glassfish.jersey.server.ServerRuntime$Responder.writeResponse(ServerRuntime.java:613)
>  at 
> org.glassfish.jersey.server.ServerRuntime$Responder.processResponse(ServerRuntime.java:375)
>  at 
> org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:365)
>  at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:272) 
> at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) at 
> org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) at 
> org.glassfish.jersey.internal.Errors.process(Errors.java:315) 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 org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:252) 
> at 
> org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1023)
>  at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:372) 
> at 
> org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:382)
>  at 
> org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:345)
>  at 
> org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:220)
>  at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:738) at 
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:551) at 
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:219)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1111)
>  at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:478) 
> at 
> org.eclipse.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(ScopedHandler.java:141) 
> at 
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
>  at org.eclipse.jetty.server.Server.handle(Server.java:462) 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(QueuedThreadPool.java:607)
>  at 
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
>  at java.lang.Thread.run(Thread.java:745) 
> {noformat}



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

Reply via email to