question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make PredicateStitcher implement more AstVisitor nodes

See original GitHub issue

PredicateStitcher should be able to re-construct the entire AST of a Query after mutating a Table node with predicates stitched.

The general idea is to implement the AST ancestors of Table upwards till Query, plus the AST ancestors of every base node of every AST ancestor of Table. To put it recursively, if node is in the set, also include the AST parent of node as well as the AST parents of the node’s base classes.

The following AstVisitor methods are yet to be implemented.

visitExcept() visitIntersect() visitSampledRelation() visitLateral() visitValues() or visitRelation()

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
pranjalsshcommented, Oct 11, 2021

@gggrace14 I’m unable to edit this issue. Here’s something we can add:

We do not support subqueries within WHERE clause. E.g.:

SELECT * FROM t1 WHERE a = (SELECT max(b) from t2 WHERE t1.ds = t2.ds)

For this, we need to implement visit for all types of expressions. These can also be implemented via joins and we do not have enough usecases to support these type of queries.

0reactions
gggrace14commented, Oct 11, 2021

Hi @pranjalssh , can you add a short description to this Issue of your findings of query in predicate not being support as well as our current thought? That will complete this Issue and reflect our up-to-date decision. https://github.com/prestodb/presto/blob/14126619596162e18ec8099f4f911f9e5836880b/presto-parser/src/main/antlr4/com/facebook/presto/sql/parser/SqlBase.g4#L345-L348

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's the best way to implement AST using visitor pattern ...
The Visitor can have member that it can use to store result, something like: class AstNodeVisitor { public: void visitCompareNode(CompareNode& node) ...
Read more >
ASTVisitor (Eclipse JDT API Specification) - IBM
A visitor for abstract syntax trees. For each different concrete AST node type T there are a pair of methods: public boolean visit(T...
Read more >
Initial support for lateral joins · Issue #5879 · prestodb/presto
Introduce LATERAL keyword in syntax, make Join have a isLateral property ... Make PredicateStitcher implement more AstVisitor nodes #16608.
Read more >
APT APT_32 APT_3_1_1_branch APT_3_1_1_maintenance ...
path: root/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java ... to watch out for: * <ul> * <li>Moving a child node further down the list.
Read more >
Ast.Visit Method (System.Management.Automation.Language)
Visit each node in the Ast, calling the methods in astVisitor for each node in the ast.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found