Hello Calcite community,

First of all, many thanks to the many contributors for this awesome and
very useful project!

I had a question with regard to amending the behavior of the SqlValidator
to account for the existence in some dialects of SQL of pseudocolumns.
Examples of this sort of construct exist in BigQuery, where they are used
as a mechanism for sharding
<https://cloud.google.com/bigquery/docs/querying-wildcard-tables#filtering_selected_tables_using_table_suffix>
or partitioning
<https://cloud.google.com/bigquery/docs/querying-wildcard-tables#scanning_a_range_of_ingestion-time_partitioned_tables_using_partitiontime>.
They are essentially column identifiers that do some special operations
within the query without belonging to a specific table within the schema.
They can legally appear in projection, filtering and grouping clauses as
normal columns would, but are not members of the tables referenced within
the FROM clause.

Is there possibly a way to extend the SqlValidator to pass these cases and
treat them as relations that exist at the schema level?  Or alternatively,
to treat them as literals?  Our use case is such that we'd need the
validator to pass queries that include them, but not necessarily extract
them into an underlying relational algebra expression.

Would appreciate any pointers on classes to look at for inspiration on a
possible approach.

Thanks!

Mark

Reply via email to