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_28_0.org.apache.calcite.avatica.UnregisteredDriver
org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.avatica.UnregisteredDriver.JdbcVersion
-
Field Summary
FieldsFields inherited from class org.apache.beam.vendor.calcite.v1_28_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 JdbcConnection
connect
(CatalogManager catalogManager, PipelineOptions options) Likeconnect(TableProvider, PipelineOptions)
, but overrides the top-level schema with aCatalogManager
.static JdbcConnection
connect
(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_28_0.org.apache.calcite.avatica.AvaticaFactory
protected String
Methods inherited from class org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.jdbc.Driver
createDriverVersion, createHandler, createMeta, createPrepareFactory, getConnectionProperties, getFactoryClassName
Methods inherited from class org.apache.beam.vendor.calcite.v1_28_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_28_0.org.apache.calcite.avatica.AvaticaFactory createFactory()- Overrides:
createFactory
in classorg.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.avatica.UnregisteredDriver
-
getConnectStringPrefix
- Overrides:
getConnectStringPrefix
in classorg.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.jdbc.Driver
-
connect
Configures Beam-specific options and opens a JDBC connection to Calcite.If
originalConnectionProperties
doesn't have the Beam-specific properties, populates them with defaults (e.g. sets the default schema name to "beam").Returns null if
url
doesn'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
JdbcConnection
which is a Beam wrapper aroundCalciteConnection
.- Specified by:
connect
in interfaceDriver
- Overrides:
connect
in classorg.apache.beam.vendor.calcite.v1_28_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
.
-