|
39 | 39 | import org.apache.wayang.core.api.Configuration; |
40 | 40 | import org.apache.wayang.core.plugin.Plugin; |
41 | 41 | import org.apache.wayang.core.api.WayangContext; |
| 42 | +import org.apache.wayang.core.util.ReflectionUtils; |
42 | 43 | import org.apache.wayang.core.plan.wayangplan.WayangPlan; |
43 | 44 | import org.apache.wayang.java.Java; |
44 | 45 | import org.apache.wayang.postgres.Postgres; |
@@ -84,14 +85,14 @@ public SqlContext(final Configuration configuration, final List<Plugin> plugins) |
84 | 85 | for (final Plugin plugin : plugins) { |
85 | 86 | this.withPlugin(plugin); |
86 | 87 | } |
87 | | - |
| 88 | + |
88 | 89 | calciteSchema = SchemaUtils.getSchema(configuration); |
89 | 90 | } |
90 | 91 |
|
91 | 92 | /** |
92 | 93 | * Entry point for executing SQL statements while providing arguments. |
93 | 94 | * You need to provide at least a JDBC source. |
94 | | - * |
| 95 | + * |
95 | 96 | * @param args args[0] = SQL statement path, args[1] = JDBC driver, args[2] = |
96 | 97 | * JDBC URL, args[3] = JDBC user, |
97 | 98 | * args[4] = JDBC password, args[5] = outputPath, |
@@ -138,6 +139,7 @@ public static void main(final String[] args) throws Exception { |
138 | 139 | jdbcDriver, jdbcUrl, jdbcUser, jdbcPassword); |
139 | 140 |
|
140 | 141 | final Configuration configuration = new Configuration(); |
| 142 | + configuration.load(ReflectionUtils.loadResource("wayang-defaults.properties")); |
141 | 143 |
|
142 | 144 | configuration.setProperty("wayang.calcite.model", calciteModel); |
143 | 145 | configuration.setProperty(String.format("wayang.%s.jdbc.url", driverPlatform), jdbcUrl); |
|
0 commit comments