apache / incubator-wayang

Apache Wayang(incubating) is the first cross-platform data processing system.
https://wayang.incubator.apache.org/
Apache License 2.0
174 stars 70 forks source link

SqlContext has no option to configure platforms #378

Closed juripetersen closed 8 months ago

juripetersen commented 8 months ago

The SqlContext's constructor hard-codes three platforms and provides no options to customise the desired plugins and therefore used platforms:

public SqlContext(Configuration configuration) throws SQLException {
        Configuration configuration1 = configuration.fork(String.format("SqlContext(%s)", configuration.getName()));

        wayangContext = new WayangContext(configuration1)
                .withPlugin(Java.basicPlugin())
                .withPlugin(Spark.basicPlugin())
                .withPlugin(Postgres.plugin());

        calciteSchema = SchemaUtils.getSchema(configuration);
    }

A proposed solution would be to change SqlContext so that it extends WayangContext, providing the desired functionality.

kbeedkar commented 8 months ago

@juripetersen Indeed. Can you go ahead with your proposed solution and create a PR?

juripetersen commented 8 months ago

@kbeedkar the PR is now linked.