linkedin / coral

Coral is a translation, analysis, and query rewrite engine for SQL and other relational languages.
BSD 2-Clause "Simplified" License
783 stars 184 forks source link

[Coral-Visualization] Select list edges/nodes not rendering for incrementally rewritten SqlNodes #458

Closed KevinGe00 closed 1 year ago

KevinGe00 commented 1 year ago

What changes are proposed in this pull request, and why are they necessary?

Issue: For select * statements, passing a SqlNode (that was converted from a incremental RelNode using CoralRelToSqlNodeConverter) into the coral graph visualizer results in a graph without a select_list edge. For example: Screenshot 2023-10-02 at 6 36 36 PM Cause: During the conversion of a CoralRelNode to its CoralSqlNode representation, select * nodes are "wrapped" in a SELECT statement that has no clauses, leading to a select * SqlNode with null selectList even though there is an implicit * clause. Which in turn, the implicit * is not picked up by the coral visualizer.

How was this patch tested?

Test select * queries in SqlNodeVisualizationUtilTest and make sure the graphs generated have a select_list edge where list_item is *. test0