Class JdbcDriver
- All Implemented Interfaces:
Driver
Connection URLs have this form:
jdbc:beam:param1=value1;param2=value2;param3=value3
The querystring-style parameters are parsed as PipelineOptions.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.avatica.UnregisteredDriver
org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.avatica.UnregisteredDriver.JdbcVersion -
Field Summary
FieldsFields inherited from class org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.jdbc.Driver
prepareFactoryFields inherited from class org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.avatica.UnregisteredDriver
factory, handler -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconnect(String url, Properties info) Configures Beam-specific options and opens a JDBC connection to Calcite.static JdbcConnectionconnect(CatalogManager catalogManager, PipelineOptions options) Likeconnect(TableProvider, PipelineOptions), but overrides the top-level schema with aCatalogManager.static JdbcConnectionconnect(TableProvider tableProvider, PipelineOptions options) Connects to the driver using standardconnect(String, Properties)call, but overrides the initial schema factory.protected org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.avatica.AvaticaFactoryprotected StringMethods inherited from class org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.jdbc.Driver
createDriverVersion, createHandler, createMeta, createPrepare, createPrepareFactory, getConnectionProperties, getFactoryClassName, withPrepareFactoryMethods inherited from class org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.avatica.UnregisteredDriver
acceptsURL, getDriverVersion, getMajorVersion, getMinorVersion, getParentLogger, getPropertyInfo, instantiateFactory, jdbcCompliant, register
-
Field Details
-
INSTANCE
-
CONNECT_STRING_PREFIX
- See Also:
-
-
Constructor Details
-
JdbcDriver
public JdbcDriver()
-
-
Method Details
-
createFactory
protected org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.avatica.AvaticaFactory createFactory()- Overrides:
createFactoryin classorg.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.avatica.UnregisteredDriver
-
getConnectStringPrefix
- Overrides:
getConnectStringPrefixin classorg.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.jdbc.Driver
-
connect
Configures Beam-specific options and opens a JDBC connection to Calcite.If
originalConnectionPropertiesdoesn't have the Beam-specific properties, populates them with defaults (e.g. sets the default schema name to "beam").Returns null if
urldoesn't begin withCONNECT_STRING_PREFIX. This seems to be how JDBC decides whether a driver can handle a request. It tries to connect to it, and if the result is null it picks another driver.Returns an instance of
JdbcConnectionwhich is a Beam wrapper aroundCalciteConnection.- Specified by:
connectin interfaceDriver- Overrides:
connectin classorg.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.avatica.UnregisteredDriver- Throws:
SQLException
-
connect
Connects to the driver using standardconnect(String, Properties)call, but overrides the initial schema factory. Default factory would load up all table providers. The one specified here doesn't load any providers. We then override the top-level schema with thetableProvider.This is called in tests and
BeamSqlEnv, core part ofSqlTransform. CLI uses standard JDBC driver registry, and goes throughconnect(String, Properties)instead, not this path. The CLI ends up using the schema factory that populates the default schema with all table providers it can find. SeeBeamCalciteSchemaFactory. -
connect
Likeconnect(TableProvider, PipelineOptions), but overrides the top-level schema with aCatalogManager.
-