You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Mark Grey (Jira)" <ji...@apache.org> on 2022/09/22 21:01:00 UTC
[jira] [Comment Edited] (CALCITE-4362) Unable to parse queries that use BigQuery pseudo columns _PARTITIONDATE/_PARTITIONTIME
[ https://issues.apache.org/jira/browse/CALCITE-4362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17608427#comment-17608427 ]
Mark Grey edited comment on CALCITE-4362 at 9/22/22 9:00 PM:
-------------------------------------------------------------
Would it possibly make sense to add a method to the {{Table}} interface that similarly returns a boolean like {{isRolledUp}}, but relies on a {{SqlConformance}} supplied as an argument to determine what the pseudo columns for the particular dialect are? The validator could then use this as it resolves those identifiers.
I suppose one possible downside is this would make pseudo column inclusion and naming uniform across all tables for that dialect. I'm not certain if this is always the case, but in most variants of SQL I'm aware of it seems to be so.
was (Author: mgthesecond):
Would it possibly make sense to add a method to the {{Table}} interface that similarly returns a boolean like {{isRolledUp}}, but relies on a {{SqlConformance}} supplied as an argument to determine what the pseudo columns for the particular dialect are? The validator could then use this as it resolves those indentifiers.
I suppose one possible downside is this would make pseudo column inclusion and naming uniform across all tables for that dialect. I'm not certain if this is always the case, but in most variants of SQL I'm aware of it seems to be so.
> Unable to parse queries that use BigQuery pseudo columns _PARTITIONDATE/_PARTITIONTIME
> --------------------------------------------------------------------------------------
>
> Key: CALCITE-4362
> URL: https://issues.apache.org/jira/browse/CALCITE-4362
> Project: Calcite
> Issue Type: Bug
> Components: babel
> Reporter: Justin Swett
> Assignee: Julian Hyde
> Priority: Major
>
> BigQuery supports partitioned tables using pseudo columns "_PARTITIONDATE"
> e.g. The following table has two columns you can select from but also partitions the data by creation date
> {code:java}
> CREATE or REPLACE TABLE #{table} (
> transaction_id STRING,
> order_date DATE )
> PARTITION BY _PARTITIONDATE
> {code}
>
> The following queries cannot be validated
> {code:java}
> select * from #{table} where _PARTITIONDATE = '2020-11-03' ;
> -- OR
> select * from #{table} where _PARTITIONTIME = '2020-11-03' ;{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)