-1

Here https://superset.apache.org/docs/installation/sql-templating/ described several parameters for handling columns:

  • columns: columns which to group by in the query
  • groupby: columns which to group by in the query (deprecated)
  • table_columns: columns available in the dataset
  • time_column: temporal column of the query (None if undefined)

How should I use these parameters?

I've tried this manual https://www.preset.io/blog/intro-jinja-templating-apache-superset/ but this is for values not for columns

Viktor Demin
  • 335
  • 1
  • 5
  • 21
  • It sounds like these are variables available in the Jinja context. So you could, for example, iterate over the items in `table_columns` list using a Jinja for loop. Can you explain what you’ve tried and how it failed? – Nick K9 Nov 13 '22 at 09:30
  • Can you elaborate more ? – Tarequzzaman Khan Nov 16 '22 at 17:36

1 Answers1

0

Here is a syntax for table_columns and time_column:

SELECT 
    {{ ', '.join(table_columns) }}
from my_table where {{ time_column }} < '{{ from_dttm }}'
limit 100
Viktor Demin
  • 335
  • 1
  • 5
  • 21