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

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

                Author: ASF GitHub Bot
            Created on: 03/May/18 18:16
            Start Date: 03/May/18 18:16
    Worklog Time Spent: 10m 
      Work Description: akedin commented on a change in pull request #5224: 
[BEAM-4044] [SQL] Add tables via TableStore in Schema, execute DDL in Calcite 
model
URL: https://github.com/apache/beam/pull/5224#discussion_r185891412
 
 

 ##########
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/BeamSqlEnv.java
 ##########
 @@ -103,105 +82,58 @@ public void registerUdaf(String functionName, 
Combine.CombineFn combineFn) {
     schema.plus().add(functionName, new UdafImpl(combineFn));
   }
 
-  /**
-   * Registers {@link PCollection}s in {@link PCollectionTuple} as a tables.
-   *
-   * <p>Assumes that {@link PCollection} elements are {@link Row}s.
-   *
-   * <p>{@link TupleTag#getId()}s are used as table names.
-   */
-  public void registerPCollectionTuple(PCollectionTuple pCollectionTuple) {
-    pCollectionTuple
-        .getAll()
-        .forEach((tag, pCollection) ->
-                registerPCollection(tag.getId(), (PCollection<Row>) 
pCollection));
-  }
-
-  /**
-   * Registers {@link PCollection} of {@link Row}s as a table.
-   *
-   * <p>Assumes that {@link PCollection#getCoder()} returns an instance of 
{@link RowCoder}.
-   */
-  public void registerPCollection(String name, PCollection<Row> pCollection) {
-    registerTable(name, pCollection, ((RowCoder) 
pCollection.getCoder()).getSchema());
-  }
-
-  /**
-   * Registers {@link PCollection} as a table.
-   */
-  public void registerTable(String tableName, PCollection<Row> pCollection, 
Schema schema) {
-    registerTable(tableName, new BeamPCollectionTable(pCollection, schema));
-  }
-
-  /**
-   * Registers a {@link BaseBeamTable} which can be used for all subsequent 
queries.
-   */
-  public void registerTable(String tableName, BeamSqlTable table) {
-    schema.add(tableName, new BeamCalciteTable(table));
+  public BeamQueryPlanner getPlanner() {
+    return planner;
   }
 
-  public void deregisterTable(String targetTableName) {
-    schema.removeTable(targetTableName);
+  public CalcitePrepare.Context getContext() {
+    return new ContextImpl();
   }
 
-  private static class BeamCalciteTable extends AbstractQueryableTable
-      implements ModifiableTable, TranslatableTable {
-    private BeamSqlTable beamTable;
-
-    public BeamCalciteTable(BeamSqlTable beamTable) {
-      super(Object[].class);
-      this.beamTable = beamTable;
+  private class ContextImpl implements CalcitePrepare.Context {
+    @Override
+    public JavaTypeFactory getTypeFactory() {
+      throw new UnsupportedOperationException();
 
 Review comment:
   Would it be wrong to return `BeamQueryPlanner.TYPE_FACTORY`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: 97996)
    Time Spent: 10h 50m  (was: 10h 40m)

> Take advantage of Calcite DDL
> -----------------------------
>
>                 Key: BEAM-4044
>                 URL: https://issues.apache.org/jira/browse/BEAM-4044
>             Project: Beam
>          Issue Type: New Feature
>          Components: dsl-sql
>            Reporter: Andrew Pilloud
>            Assignee: Andrew Pilloud
>            Priority: Major
>          Time Spent: 10h 50m
>  Remaining Estimate: 0h
>
> In Calcite 1.15 support for abstract DDL moved into calcite core. We should 
> take advantage of that.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to