[
https://issues.apache.org/jira/browse/BEAM-6133?focusedWorklogId=169934&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-169934
]
ASF GitHub Bot logged work on BEAM-6133:
----------------------------------------
Author: ASF GitHub Bot
Created on: 27/Nov/18 18:25
Start Date: 27/Nov/18 18:25
Worklog Time Spent: 10m
Work Description: apilloud commented on a change in pull request #7141:
[BEAM-6133] [SQL] Add support for TableMacro UDF
URL: https://github.com/apache/beam/pull/7141#discussion_r236784012
##########
File path:
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/BeamCalciteTable.java
##########
@@ -40,17 +41,21 @@
import org.apache.calcite.schema.TranslatableTable;
/** Adapter from {@link BeamSqlTable} to a calcite Table. */
-class BeamCalciteTable extends AbstractQueryableTable
+public class BeamCalciteTable extends AbstractQueryableTable
implements ModifiableTable, TranslatableTable {
private final BeamSqlTable beamTable;
private final Map<String, String> pipelineOptions;
- public BeamCalciteTable(BeamSqlTable beamTable, Map<String, String>
pipelineOptions) {
+ BeamCalciteTable(BeamSqlTable beamTable, Map<String, String>
pipelineOptions) {
super(Object[].class);
this.beamTable = beamTable;
this.pipelineOptions = pipelineOptions;
}
+ public static BeamCalciteTable of(BeamSqlTable table) {
+ return new BeamCalciteTable(table, Maps.newHashMap());
Review comment:
Instead of `Maps.newHashMap()` how about `ImmutableMap.of()`.
----------------------------------------------------------------
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: 169934)
Time Spent: 50m (was: 40m)
> [SQL] Add support for TableMacro UDF
> ------------------------------------
>
> Key: BEAM-6133
> URL: https://issues.apache.org/jira/browse/BEAM-6133
> Project: Beam
> Issue Type: New Feature
> Components: dsl-sql
> Reporter: Gleb Kanterov
> Assignee: Gleb Kanterov
> Priority: Major
> Time Spent: 50m
> Remaining Estimate: 0h
>
> Now we support only ScalarFunction UDFs. In Calcite, there are other kinds of
> UDFs. With TableMacro UDFs users can connect external data sources in a
> similar way as in TableProvider, but without specifying a schema, or
> enumerating a list of existing tables in advance.
> An example use case is connecting external metadata service and querying
> range of partitions.
> {code}
> SELECT COUNT(*) FROM table(my_udf('dataset', start = '2017-01-01', end =
> '2018-01-01'))
> {code}
> Where the implementation of `my_udf` will connect to this service, get file
> locations for a range of partitions, and translate to PTransform reading it.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)