Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-8976

Issues exploring a table with schema, with manually written data

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.1.0
    • Fix Version/s: None
    • Component/s: Datasets, Explore
    • Labels:
      None
    • Rank:
      1|hzzxqf:

      Description

      I have created a Table dataset with a simple schema. This is in my application's configure method:

      Schema schema = Schema.recordOf("eventWithAction",
                                          ImmutableList.of(Schema.Field.of("e", Schema.of(Schema.Type.STRING))));
      
      createDataset("eventsWithActions", Table.class.getName(), TableProperties.builder().setSchema(schema).build());
      

      Then, from a flowlet, I write to the table. The rowkey doesn't matter, and the column I am writing to is "e":

      Put put = new Put(Bytes.toBytes(event.event.hashCode()));
      put.add("e", GSON.toJson(event));
      table.put(put);
      

      Then, when I try to execute a "select *" statement from that table, it logs the following error in cdap-debug.log:

      2017-03-14 15:57:31,468 - ERROR [explore.service-executor-57:c.c.c.c.HttpExceptionHandler@68] - Unexpected error: request=POST /v3/data/explore/queries/21d4643f-b147-4932-aa44-0b6d3
      b02eaef/preview user=<null>:
      java.lang.RuntimeException: org.apache.hive.service.cli.HiveSQLException: java.io.IOException: org.apache.hadoop.hive.ql.metadata.HiveException: Error evaluating e
              at com.google.common.base.Throwables.propagate(Throwables.java:160) ~[com.google.guava.guava-13.0.1.jar:na]
              at co.cask.cdap.explore.service.hive.BaseHiveExploreService.fetchNextResults(BaseHiveExploreService.java:1017) ~[na:na]
              at co.cask.cdap.explore.service.hive.BaseHiveExploreService.previewResults(BaseHiveExploreService.java:1055) ~[na:na]
              at co.cask.cdap.explore.executor.ExploreQueryExecutorHttpHandler$5.call(ExploreQueryExecutorHttpHandler.java:209) ~[na:na]
              at co.cask.cdap.explore.executor.ExploreQueryExecutorHttpHandler$5.call(ExploreQueryExecutorHttpHandler.java:206) ~[na:na]
              at co.cask.cdap.security.impersonation.ImpersonationUtils$1.run(ImpersonationUtils.java:46) ~[na:na]
              at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_80]
              at javax.security.auth.Subject.doAs(Subject.java:415) ~[na:1.7.0_80]
              at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1548) ~[org.apache.hadoop.hadoop-common-2.3.0.jar:na]
              at co.cask.cdap.security.impersonation.ImpersonationUtils.doAs(ImpersonationUtils.java:43) ~[na:na]
              at co.cask.cdap.explore.executor.ExploreQueryExecutorHttpHandler.doAs(ExploreQueryExecutorHttpHandler.java:67) ~[na:na]
              at co.cask.cdap.explore.executor.ExploreQueryExecutorHttpHandler.getQueryResultPreview(ExploreQueryExecutorHttpHandler.java:206) ~[na:na]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_80]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_80]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_80]
              at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_80]
              at co.cask.http.HttpMethodInfo.invoke(HttpMethodInfo.java:80) ~[co.cask.http.netty-http-0.16.0.jar:na]
              at co.cask.http.HttpDispatcher.messageReceived(HttpDispatcher.java:38) [co.cask.http.netty-http-0.16.0.jar:na]
              at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) [io.netty.netty-3.6.6.Final.jar:na]
              at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) [io.netty.netty-3.6.6.Final.jar:na]
              at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) [io.netty.netty-3.6.6.Final.jar:na]
              at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.doRun(ChannelUpstreamEventRunnable.java:43) [io.netty.netty-3.6.6.Final.jar:na]
              at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:67) [io.netty.netty-3.6.6.Final.jar:na]
              at org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.run(OrderedMemoryAwareThreadPoolExecutor.java:314) [io.netty.netty-3.6.6.Final.jar:na]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_80]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_80]
              at java.lang.Thread.run(Thread.java:745) [na:1.7.0_80]
      Caused by: org.apache.hive.service.cli.HiveSQLException: java.io.IOException: org.apache.hadoop.hive.ql.metadata.HiveException: Error evaluating e
              at org.apache.hive.service.cli.operation.SQLOperation.getNextRowSet(SQLOperation.java:352) ~[org.apache.hive.hive-service-1.2.1.jar:1.2.1]
              at org.apache.hive.service.cli.operation.OperationManager.getOperationNextRowSet(OperationManager.java:220) ~[org.apache.hive.hive-service-1.2.1.jar:1.2.1]
              at org.apache.hive.service.cli.session.HiveSessionImpl.fetchResults(HiveSessionImpl.java:685) ~[org.apache.hive.hive-service-1.2.1.jar:1.2.1]
              at org.apache.hive.service.cli.CLIService.fetchResults(CLIService.java:454) ~[org.apache.hive.hive-service-1.2.1.jar:1.2.1]
              at co.cask.cdap.explore.service.hive.Hive14ExploreService.doFetchNextResults(Hive14ExploreService.java:77) ~[na:na]
              at co.cask.cdap.explore.service.hive.BaseHiveExploreService.fetchNextResults(BaseHiveExploreService.java:1012) ~[na:na]
              ... 25 common frames omitted
      Caused by: java.io.IOException: org.apache.hadoop.hive.ql.metadata.HiveException: Error evaluating e
              at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:154) ~[org.apache.hive.hive-exec-1.2.1.jar:1.2.1]
              at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:1670) ~[org.apache.hive.hive-exec-1.2.1.jar:1.2.1]
              at org.apache.hive.service.cli.operation.SQLOperation.getNextRowSet(SQLOperation.java:347) ~[org.apache.hive.hive-service-1.2.1.jar:1.2.1]
              ... 30 common frames omitted
      Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Error evaluating e
              at org.apache.hadoop.hive.ql.exec.SelectOperator.process(SelectOperator.java:86) ~[org.apache.hive.hive-exec-1.2.1.jar:1.2.1]
              at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:837) ~[org.apache.hive.hive-exec-1.2.1.jar:1.2.1]
              at org.apache.hadoop.hive.ql.exec.TableScanOperator.process(TableScanOperator.java:97) ~[org.apache.hive.hive-exec-1.2.1.jar:1.2.1]
              at org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:424) ~[org.apache.hive.hive-exec-1.2.1.jar:1.2.1]
              at org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:416) ~[org.apache.hive.hive-exec-1.2.1.jar:1.2.1]
              at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:140) ~[org.apache.hive.hive-exec-1.2.1.jar:1.2.1]
              ... 32 common frames omitted
      Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to [Ljava.lang.Object;
              at co.cask.cdap.hive.objectinspector.StandardStructObjectInspector.getStructFieldData(StandardStructObjectInspector.java:171) ~[na:na]
              at org.apache.hadoop.hive.ql.exec.ExprNodeColumnEvaluator._evaluate(ExprNodeColumnEvaluator.java:94) ~[org.apache.hive.hive-exec-1.2.1.jar:1.2.1]
              at org.apache.hadoop.hive.ql.exec.ExprNodeEvaluator.evaluate(ExprNodeEvaluator.java:77) ~[org.apache.hive.hive-exec-1.2.1.jar:1.2.1]
              at org.apache.hadoop.hive.ql.exec.ExprNodeEvaluator.evaluate(ExprNodeEvaluator.java:65) ~[org.apache.hive.hive-exec-1.2.1.jar:1.2.1]
              at org.apache.hadoop.hive.ql.exec.SelectOperator.process(SelectOperator.java:81) ~[org.apache.hive.hive-exec-1.2.1.jar:1.2.1]
              ... 37 common frames omitted
      

        Attachments

          Activity

            People

            • Assignee:
              nitin Nitin Motgi
              Reporter:
              ali.anwar Ali Anwar
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: