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

Sorabh Hamirwasia commented on DRILL-6932:
------------------------------------------

The problem is that the id for operators after getting physical plan in step 3 
above is all 0. Whereas if we directly get a physical plan for query then id 
for each operator is unique. Also I see the physical plan generated using above 
steps and directly from sql query is different, as there is no Project operator 
in former.

*Physical Operator from original query:*
{code:java}
{
 "head" : {
 "version" : 1,
 "generator" : {
 "type" : "ExplainHandler",
 "info" : ""
 },
 "type" : "APACHE_DRILL_PHYSICAL",
 "options" : [ {
 "kind" : "BOOLEAN",
 "accessibleScopes" : "ALL",
 "name" : "exec.errors.verbose",
 "bool_val" : true,
 "scope" : "SESSION"
 }, {
 "kind" : "LONG",
 "accessibleScopes" : "ALL",
 "name" : "planner.width.max_per_node",
 "num_val" : 2,
 "scope" : "SESSION"
 } ],
 "queue" : 0,
 "hasResourcePlan" : false,
 "resultMode" : "EXEC"
 },
 "graph" : [ {
 "pop" : "fs-scan",
 "@id" : 4,
 "userName" : "sorabhhamirwasia",
 "files" : [ "classpath:/employee.json" ],
 "storage" : {
 "type" : "file",
 "connection" : "classpath:///",
 "config" : null,
 "workspaces" : { },
 "formats" : {
 "image" : {
 "type" : "image",
 "extensions" : [ "jpg", "jpeg", "jpe", "tif", "tiff", "dng", "psd", "png", 
"bmp", "gif", "ico", "pcx", "wav", "wave", "avi", "webp", "mov", "mp4", "m4a", 
"m4p", "m4b", "m4r", "m4v", "3gp", "3g2", "eps", "epsf", "epsi", "ai", "arw", 
"crw", "cr2", "nef", "orf", "raf", "rw2", "rwl", "srw", "x3f" ]
 },
 "txt" : {
 "type" : "text",
 "extensions" : [ "txt" ],
 "delimiter" : "\u0000"
 },
 "sequencefile" : {
 "type" : "sequencefile",
 "extensions" : [ "seq" ]
 },
 "psv" : {
 "type" : "text",
 "extensions" : [ "tbl" ],
 "delimiter" : "|"
 },
 "tsv" : {
 "type" : "text",
 "extensions" : [ "tsv" ],
 "delimiter" : "\t"
 },
 "csv" : {
 "type" : "text",
 "extensions" : [ "csv" ],
 "delimiter" : ","
 },
 "ssv" : {
 "type" : "text",
 "extensions" : [ "ssv" ],
 "delimiter" : " "
 },
 "csvh-test" : {
 "type" : "text",
 "extensions" : [ "csvh-test" ],
 "skipFirstLine" : true,
 "extractHeader" : true,
 "delimiter" : ","
 },
 "json" : {
 "type" : "json",
 "extensions" : [ "json" ]
 },
 "csvh" : {
 "type" : "text",
 "extensions" : [ "csvh" ],
 "extractHeader" : true,
 "delimiter" : ","
 },
 "parquet" : {
 "type" : "parquet"
 },
 "avro" : {
 "type" : "avro"
 }
 },
 "enabled" : true
 },
 "format" : {
 "type" : "json",
 "extensions" : [ "json" ]
 },
 "columns" : [ "`**`" ],
 "selectionRoot" : "classpath:/employee.json",
 "cost" : 463.0
 }, {
 "pop" : "limit",
 "@id" : 3,
 "child" : 4,
 "first" : 0,
 "last" : 2,
 "initialAllocation" : 1000000,
 "maxAllocation" : 10000000000,
 "cost" : 2.0
 }, {
 "pop" : "selection-vector-remover",
 "@id" : 2,
 "child" : 3,
 "initialAllocation" : 1000000,
 "maxAllocation" : 10000000000,
 "cost" : 2.0
 }, {
 "pop" : "project",
 "@id" : 1,
 "exprs" : [ {
 "ref" : "`**`",
 "expr" : "`**`"
 } ],
 "child" : 2,
 "outputProj" : true,
 "initialAllocation" : 1000000,
 "maxAllocation" : 10000000000,
 "cost" : 2.0
 }, {
 "pop" : "screen",
 "@id" : 0,
 "child" : 1,
 "initialAllocation" : 1000000,
 "maxAllocation" : 10000000000,
 "cost" : 2.0
 } ]
}{code}
 

*Physical Operator using above steps:*
{code:java}
{
 "head" : {
 "version" : 1,
 "generator" : {
 "type" : "org.apache.drill.exec.planner.logical.DrillImplementor",
 "info" : ""
 },
 "type" : "APACHE_DRILL_PHYSICAL",
 "options" : [ {
 "kind" : "BOOLEAN",
 "accessibleScopes" : "ALL",
 "name" : "exec.errors.verbose",
 "bool_val" : true,
 "scope" : "SESSION"
 }, {
 "kind" : "LONG",
 "accessibleScopes" : "ALL",
 "name" : "planner.width.max_per_node",
 "num_val" : 2,
 "scope" : "SESSION"
 } ],
 "queue" : 0,
 "hasResourcePlan" : false,
 "resultMode" : "EXEC"
 },
 "graph" : [ {
 "pop" : "fs-scan",
 "@id" : 0,
 "userName" : "anonymous",
 "files" : [ "classpath:/employee.json" ],
 "storage" : {
 "type" : "file",
 "connection" : "classpath:///",
 "config" : null,
 "workspaces" : { },
 "formats" : {
 "image" : {
 "type" : "image",
 "extensions" : [ "jpg", "jpeg", "jpe", "tif", "tiff", "dng", "psd", "png", 
"bmp", "gif", "ico", "pcx", "wav", "wave", "avi", "webp", "mov", "mp4", "m4a", 
"m4p", "m4b", "m4r", "m4v", "3gp", "3g2", "eps", "epsf", "epsi", "ai", "arw", 
"crw", "cr2", "nef", "orf", "raf", "rw2", "rwl", "srw", "x3f" ]
 },
 "txt" : {
 "type" : "text",
 "extensions" : [ "txt" ],
 "delimiter" : "\u0000"
 },
 "sequencefile" : {
 "type" : "sequencefile",
 "extensions" : [ "seq" ]
 },
 "psv" : {
 "type" : "text",
 "extensions" : [ "tbl" ],
 "delimiter" : "|"
 },
 "tsv" : {
 "type" : "text",
 "extensions" : [ "tsv" ],
 "delimiter" : "\t"
 },
 "csv" : {
 "type" : "text",
 "extensions" : [ "csv" ],
 "delimiter" : ","
 },
 "ssv" : {
 "type" : "text",
 "extensions" : [ "ssv" ],
 "delimiter" : " "
 },
 "csvh-test" : {
 "type" : "text",
 "extensions" : [ "csvh-test" ],
 "skipFirstLine" : true,
 "extractHeader" : true,
 "delimiter" : ","
 },
 "json" : {
 "type" : "json",
 "extensions" : [ "json" ]
 },
 "csvh" : {
 "type" : "text",
 "extensions" : [ "csvh" ],
 "extractHeader" : true,
 "delimiter" : ","
 },
 "parquet" : {
 "type" : "parquet"
 },
 "avro" : {
 "type" : "avro"
 }
 },
 "enabled" : true
 },
 "format" : {
 "type" : "json",
 "extensions" : [ "json" ]
 },
 "columns" : [ "`**`" ],
 "selectionRoot" : "classpath:/employee.json",
 "cost" : 0.0
 }, {
 "pop" : "limit",
 "@id" : 0,
 "child" : 0,
 "first" : 0,
 "last" : 2,
 "initialAllocation" : 1000000,
 "maxAllocation" : 10000000000,
 "cost" : 0.0
 }, {
 "pop" : "selection-vector-remover",
 "@id" : 0,
 "child" : 0,
 "initialAllocation" : 1000000,
 "maxAllocation" : 10000000000,
 "cost" : 0.0
 }, {
 "pop" : "screen",
 "@id" : 0,
 "child" : 0,
 "initialAllocation" : 1000000,
 "maxAllocation" : 10000000000,
 "cost" : 0.0
 } ]
}{code}

> Drill can't submit Physical plan returned by submitting Logical plan
> --------------------------------------------------------------------
>
>                 Key: DRILL-6932
>                 URL: https://issues.apache.org/jira/browse/DRILL-6932
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.14.0
>            Reporter: Denys Ordynskiy
>            Priority: Major
>
> *Description:*
> Drill WebUI allows to submit Logical plan and returns 2 types of a result:
> - "resultMode" : "EXEC" - to get query result set
> - "resultMode" : "PHYSICAL" - to get Physical plan of the query
> If I get Physical plan by submiting Logical plan with "resultMode" : 
> "PHYSICAL",
> this Physical plan throws an error after submiting it.
> *Steps to reproduce issue in a Drill WebUI:*
> - get Logical plan by running query "EXPLAIN PLAN WITHOUT IMPLEMENTATION FOR 
> SELECT * FROM cp.`employee.json` LIMIT 2";
> - change "resultMode" from "LOGICAL" to "PHYSICAL";
> - select "Query Type" - "LOGICAL" and submit Logical plan and get Physical 
> plan;
> - select "Query Type" - "PHYSICAL" and submit Physical plan;
> *Actual result:*
> {color:#d04437}*Query Failed: An Error Occurred*
> org.apache.drill.common.exceptions.UserRemoteException: SYSTEM ERROR: 
> IllegalStateException: Already had POJO for id (java.lang.Integer) 
> [[ObjectId: key=0, 
> type=com.fasterxml.jackson.databind.deser.impl.PropertyBasedObjectIdGenerator,
>  scope=java.lang.Object]] Please, refer to logs for more information. [Error 
> Id: f7a2422f-55e8-4478-9e22-1008175ce9b6 on maprhost:31010]{color}
> *Expected result:*
> result set for the original query "SELECT * FROM cp.`employee.json` LIMIT 2"



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to