[ 
https://issues.apache.org/jira/browse/BEAM-8583?focusedWorklogId=342946&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-342946
 ]

ASF GitHub Bot logged work on BEAM-8583:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Nov/19 22:00
            Start Date: 13/Nov/19 22:00
    Worklog Time Spent: 10m 
      Work Description: 11moon11 commented on pull request #10030: [BEAM-8583] 
[SQL] Big query filter push down
URL: https://github.com/apache/beam/pull/10030#discussion_r346025310
 
 

 ##########
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/bigquery/BigQuerySqlDialectWithTypeTranslation.java
 ##########
 @@ -0,0 +1,276 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.sdk.extensions.sql.meta.provider.bigquery;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.regex.Pattern;
+import 
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.avatica.util.Casing;
+import 
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.config.NullCollation;
+import 
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.type.RelDataType;
+import org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.sql.SqlCall;
+import 
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.sql.SqlDataTypeSpec;
+import 
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.sql.SqlDialect;
+import 
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.sql.SqlIdentifier;
+import org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.sql.SqlKind;
+import org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.sql.SqlNode;
+import 
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.sql.SqlOperator;
+import 
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.sql.SqlSetOperator;
+import org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.sql.SqlSyntax;
+import org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.sql.SqlWriter;
+import 
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.sql.dialect.BigQuerySqlDialect;
+import 
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.sql.parser.SqlParserPos;
+import 
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.sql.type.BasicSqlType;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
+
+// TODO: BigQuerySqlDialectWithTypeTranslation can be deleted after updating 
vendor Calcite version.
+// Calcite v1_20_0 does not have type translation implemented, but later 
(unreleased) versions do.
+public class BigQuerySqlDialectWithTypeTranslation extends BigQuerySqlDialect {
 
 Review comment:
   I see how having this name is inconvenient, changed to 
`BeamBigQuerySqlDialect`.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 342946)
    Time Spent: 1h 40m  (was: 1.5h)

> [SQL] BigQuery should support predicate push-down in DIRECT_READ mode
> ---------------------------------------------------------------------
>
>                 Key: BEAM-8583
>                 URL: https://issues.apache.org/jira/browse/BEAM-8583
>             Project: Beam
>          Issue Type: Improvement
>          Components: dsl-sql
>            Reporter: Kirill Kozlov
>            Assignee: Kirill Kozlov
>            Priority: Major
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> * Add BigQuery Dialect with TypeTranslation (since it is not implemented in 
> Calcite 1.20.0, but is present in unreleased versions).
>  * Create a BigQueryFilter class.
>  * BigQueryTable#buildIOReader should translate supported filters into a Sql 
> string and pass it to BigQueryIO.
>  
> Potential improvements:
>  * After updating vendor Calcite, class 
> `BigQuerySqlDialectWithTypeTranslation` can be deleted and Calcite's 
> `BigQuerySqlDialect` can be utilized instead.
>  * Once BigQuery adds support for more filters, `BigQueryFilter#isSupported` 
> should be updated.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to