Tajo
  1. Tajo
  2. TAJO-122

Add EXPLAIN clause to show a logical plan

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.8.0
    • Component/s: planner/optimizer
    • Labels:
      None

      Description

      (I've changed this issue from implementing an utility class to preint JSON to implementing EXPLAIN clause support.)

      For convenience for debugging and developing new engine (TAJO-104), we need EXPLAIN clause to print plans used in Tajo internal. In this issue, we only focus on showing a logical plan.

      1. TAJO-122.patch
        7 kB
        DaeMyung Kang
      2. TAJO-122.2.patch
        7 kB
        DaeMyung Kang

        Activity

        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-build #10 (See https://builds.apache.org/job/Tajo-master-build/10/)
        TAJO-122: Add EXPLAIN clause to show a logical plan. (DaeMyung Kang via hyunsik) (hyunsik: https://git-wip-us.apache.org/repos/asf?p=incubator-tajo.git&a=commit&h=01829fbddf7c5b988397d023c9f3cec0cea07c3f)

        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/TajoMasterClientService.java
        • tajo-client/src/main/proto/TajoMasterClientProtocol.proto
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/GlobalEngine.java
        • tajo-client/src/main/java/org/apache/tajo/cli/TajoCli.java
        • tajo-client/src/main/java/org/apache/tajo/client/TajoClient.java
        • tajo-client/src/main/proto/ClientProtos.proto
        • CHANGES.txt
        Show
        Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #10 (See https://builds.apache.org/job/Tajo-master-build/10/ ) TAJO-122 : Add EXPLAIN clause to show a logical plan. (DaeMyung Kang via hyunsik) (hyunsik: https://git-wip-us.apache.org/repos/asf?p=incubator-tajo.git&a=commit&h=01829fbddf7c5b988397d023c9f3cec0cea07c3f ) tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/TajoMasterClientService.java tajo-client/src/main/proto/TajoMasterClientProtocol.proto tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/GlobalEngine.java tajo-client/src/main/java/org/apache/tajo/cli/TajoCli.java tajo-client/src/main/java/org/apache/tajo/client/TajoClient.java tajo-client/src/main/proto/ClientProtos.proto CHANGES.txt
        Hide
        Hyunsik Choi added a comment - - edited

        I reviewed this patch and gave +1.

        committed it to master branch. Thank you for your contribution.

        Show
        Hyunsik Choi added a comment - - edited I reviewed this patch and gave +1. committed it to master branch. Thank you for your contribution.
        Hide
        DaeMyung Kang added a comment -

        I uploaded new patch for hive_query_mode

        Show
        DaeMyung Kang added a comment - I uploaded new patch for hive_query_mode
        Hide
        DaeMyung Kang added a comment -

        I uploaded review to reviewboards.
        https://reviews.apache.org/r/16808/

        Show
        DaeMyung Kang added a comment - I uploaded review to reviewboards. https://reviews.apache.org/r/16808/
        Hide
        DaeMyung Kang added a comment -

        now reviewboard doesn't work.
        so I can't make review on reviewboard.
        when it works, I will upload review.

        Show
        DaeMyung Kang added a comment - now reviewboard doesn't work. so I can't make review on reviewboard. when it works, I will upload review.
        Hide
        DaeMyung Kang added a comment -

        Explain works like this.

        //valid query
        tajo> explain select * from table1;
        
        -----------------------------
        Query Block Graph
        -----------------------------
        |-@ROOT
        -----------------------------
        Optimization Log:
        -----------------------------
        
        Scan on table1
          => target list: table1.id (INT4(0)), table1.name (TEXT(0)), table1.score (FLOAT4(0)), table1.type (TEXT(0))
          => out schema: {table1.id (INT4(0)),table1.name (TEXT(0)),table1.score (FLOAT4(0)),table1.type (TEXT(0))}
          => in schema: {table1.id (INT4(0)),table1.name (TEXT(0)),table1.score (FLOAT4(0)),table1.type (TEXT(0))}
        
        //invalid query because of not existed table
        tajo> explain select * from tbl;
        Failed after attempts=3, exceptions:
        org.apache.tajo.catalog.exception.NoSuchTableException: ERROR: relation "tbl" does not exist
        org.apache.tajo.catalog.exception.NoSuchTableException: ERROR: relation "tbl" does not exist
        org.apache.tajo.catalog.exception.NoSuchTableException: ERROR: relation "tbl" does not exist
        
        //valid but doesn't have logical plan.
        tajo> explain select pi();
        
        -----------------------------
        Query Block Graph
        -----------------------------
        |-@ROOT
        -----------------------------
        Optimization Log:
        -----------------------------
        
        Show
        DaeMyung Kang added a comment - Explain works like this. //valid query tajo> explain select * from table1; ----------------------------- Query Block Graph ----------------------------- |-@ROOT ----------------------------- Optimization Log: ----------------------------- Scan on table1 => target list: table1.id (INT4(0)), table1.name (TEXT(0)), table1.score (FLOAT4(0)), table1.type (TEXT(0)) => out schema: {table1.id (INT4(0)),table1.name (TEXT(0)),table1.score (FLOAT4(0)),table1.type (TEXT(0))} => in schema: {table1.id (INT4(0)),table1.name (TEXT(0)),table1.score (FLOAT4(0)),table1.type (TEXT(0))} //invalid query because of not existed table tajo> explain select * from tbl; Failed after attempts=3, exceptions: org.apache.tajo.catalog.exception.NoSuchTableException: ERROR: relation "tbl" does not exist org.apache.tajo.catalog.exception.NoSuchTableException: ERROR: relation "tbl" does not exist org.apache.tajo.catalog.exception.NoSuchTableException: ERROR: relation "tbl" does not exist //valid but doesn't have logical plan. tajo> explain select pi(); ----------------------------- Query Block Graph ----------------------------- |-@ROOT ----------------------------- Optimization Log: -----------------------------

          People

          • Assignee:
            DaeMyung Kang
            Reporter:
            Hyunsik Choi
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development