Hi - fairly new to looker so appreciate the advice here.
I want to be able to query a view or PDT from sql runner. That way, I can run a query in SQL runner in a few lines of code (e.g. SELECT * from view1 LEFT JOIN view2 USING (id)), but that code would represent arbitrarily complex logic (e.g., if pdt1 and pdt2 are themselves generated from queries each 500 lines of code).
Is this possible? An obstacle I keep running into is wanting to query on the fly in sql runner but not able to abstract away large, recurring subqueries.
I’m not sure if this answers your question, but yes, you can query PDT’s in SQL Runner. However the name of the table to query is not obvious - you can find actual PDT names in the list of tables in the “looker_scratch” schema (or whatever schema you have told Looker to put the PDT’s in) - but those names will change as the PDT’s are re-derived.
I recommend that you review the documentation here for SQL Runner background and tips.