Re: Declaring monotonic columns in schema for streaming queries.

2023-01-30 Thread Vignesh
Thank you,  I will try that.

On Sun, Jan 29, 2023, 9:01 PM Benchao Li  wrote:

> Hi Vignesh,
>
> AFAIK, there is no such way in Calcite to declare it with DDL. However, you
> can provide it via the statistic for your table, you can take a look at the
> tests[1] in Calcite how we did it.
>
> [1]
>
> https://github.com/apache/calcite/blob/ae228f64347cc7620d28eff04f5869583c6bf9d5/testkit/src/main/java/org/apache/calcite/test/catalog/MockCatalogReaderSimple.java#L238-L245
>
> Vignesh  于2023年1月30日周一 06:21写道:
>
> > Hi,
> >
> > This page  describes
> > streaming
> > queries in calcite.
> > Streaming operators, such as tumbling window require a monotonic column.
> It
> > says that we need to declare monotonic columns in the schema.
> >
> > Is there a way to do it in the create table statement? Flink SQL does it
> > with a "WATERMARK FOR rowtime_column"
> > <
> >
> https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/sql/create/#create-table
> > >
> > syntax in the create table, but that seems to be flink specific.
> >
> >
> > Thanks,
> > Vignesh.
> >
>
>
> --
>
> Best,
> Benchao Li
>


[jira] [Created] (CALCITE-5509) Allow automatic type coercion for strings in BigQuery functions

2023-01-30 Thread Will Noble (Jira)
Will Noble created CALCITE-5509:
---

 Summary: Allow automatic type coercion for strings in BigQuery 
functions
 Key: CALCITE-5509
 URL: https://issues.apache.org/jira/browse/CALCITE-5509
 Project: Calcite
  Issue Type: Improvement
Reporter: Will Noble


BigQuery allows string literals to be automatically coerced into 
{{{}TIMESTAMP{}}}, {{{}DATETIME{}}}, or {{DATE}} literals. See in the 
[docs|https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical]:
{quote}String literals in canonical date format also implicitly coerce to DATE 
type when used where a DATE-type expression is expected...

String literals with the canonical datetime format implicitly coerce to a 
datetime literal when used where a datetime expression is expected...

String literals with the canonical timestamp format, including those with time 
zone names, implicitly coerce to a timestamp literal when used where a 
timestamp expression is expected.
{quote}

We should make sure that the BQ library functions respect this type coercion in 
general. This only applies to literals; not string values in general. For 
example, {{'2023-01-30'}} can be coerced to a timestamp, datetime, or date, but 
{{SUBSTRING('x2023-01-30', 2)}} cannot.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (CALCITE-5508) Add constructor functions for DATE, TIME, TIMESTAMP, DATETIME

2023-01-30 Thread Julian Hyde (Jira)
Julian Hyde created CALCITE-5508:


 Summary: Add constructor functions for DATE, TIME, TIMESTAMP, 
DATETIME
 Key: CALCITE-5508
 URL: https://issues.apache.org/jira/browse/CALCITE-5508
 Project: Calcite
  Issue Type: Bug
Reporter: Julian Hyde


Add "constructor" functions for DATE, TIME, TIMESTAMP, DATETIME. These are 
functions such as "DATE(1969, 7, 20)" that create date-time types. The 
functions are based on those in BigQuery, and would be enabled in the BigQuery 
library.

Their names follow the terminology of BigQuery's type system, which is 
confusing when working in Calcite's type system.
 * For example, the function {{DATETIME(1969, 7, 20, 16, 17, 40)}} returns a 
Calcite {{TIMESTAMP}}, a type that is called {{DATETIME}} in BigQuery. (Eagle 
landed at 4.17pm Houston time.)
 * Similarly, {{TIMESTAMP(DATE '1969-07-21', TIME '22:17:40')}} returns a 
Calcite {{TIMESTAMP WITH LOCAL TIME ZONE}} representing the same instant in 
UTC. That type is called {{TIMESTAMP}} in BigQuery.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)