You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by HeartSaVioR <gi...@git.apache.org> on 2016/09/13 09:24:18 UTC

[GitHub] storm issue #1681: STORM-1444 Support EXPLAIN statement in StormSQL

Github user HeartSaVioR commented on the issue:

    https://github.com/apache/storm/pull/1681
  
    FYI:
    Flink seems not support explain yet. 
    https://github.com/apache/flink/pull/2485 is proposed for adding this feature.
    
    As I described to JIRA issue, Spark supports explain and output seems to be more user friendly.
    (Note that Spark doesn't use Calcite.)
    
    ```
    scala> spark.sql("SELECT GRPID, COUNT(*) AS CNT, MAX(AGE) AS MAX_AGE, MIN(AGE) AS MIN_AGE, AVG(AGE) AS AVG_AGE, MAX(AGE) - MIN(AGE) AS DIFF FROM FOO WHERE ID > 2 GROUP BY GRPID").explain
    == Physical Plan ==
    *HashAggregate(keys=[GRPID#64], functions=[count(1), max(AGE#67), min(AGE#67), avg(cast(AGE#67 as bigint)), max(AGE#67), min(AGE#67)])
    +- Exchange hashpartitioning(GRPID#64, 200)
       +- *HashAggregate(keys=[GRPID#64], functions=[partial_count(1), partial_max(AGE#67), partial_min(AGE#67), partial_avg(cast(AGE#67 as bigint)), partial_max(AGE#67), partial_min(AGE#67)])
          +- *Project [grpid#64, age#67]
             +- *Filter (isnotnull(ID#63) && (ID#63 > 2))
                +- LocalTableScan [id#63, grpid#64, name#65, addr#66, age#67]
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---