未验证 提交 63a65c94 编写于 作者: A Anastasiya 提交者: GitHub

dbeaver/dbeaver-ee#1516 Add support of Azure Databricks driver (#15964)

上级 d7f8fd26
......@@ -265,4 +265,11 @@
version="0.0.0"
unpack="false"/>
<plugin
id="org.jkiss.dbeaver.ext.databricks"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>
......@@ -233,8 +233,9 @@ public class ConnectionPageGeneral extends ConnectionWizardPage implements Navig
private String generateConnectionName(ConnectionPageSettings settings) {
String newName;
if (settings != null) {
DBPConnectionConfiguration connectionInfo = settings.getActiveDataSource().getConnectionConfiguration();
newName = dataSourceDescriptor == null ? "" : settings.getActiveDataSource().getName(); //$NON-NLS-1$
DataSourceDescriptor dataSource = settings.getActiveDataSource();
DBPConnectionConfiguration connectionInfo = dataSource.getConnectionConfiguration();
newName = dataSourceDescriptor == null ? "" : dataSource.getName(); //$NON-NLS-1$
if (CommonUtils.isEmpty(newName)) {
newName = connectionInfo.getDatabaseName();
if (CommonUtils.isEmpty(newName) || newName.length() < 3 || CommonUtils.isInt(newName)) {
......@@ -244,6 +245,9 @@ public class ConnectionPageGeneral extends ConnectionWizardPage implements Navig
if (CommonUtils.isEmpty(newName)) {
newName = connectionInfo.getServerName();
}
if (CommonUtils.isEmpty(newName)) {
newName = dataSource.getDriver().getName();
}
if (CommonUtils.isEmpty(newName)) {
newName = CoreMessages.dialog_connection_wizard_final_default_new_connection_name;
}
......
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Vendor: %Bundle-Vendor
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.jkiss.dbeaver.ext.databricks;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Release-Date: 20220324
Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-ActivationPolicy: lazy
Require-Bundle: org.jkiss.dbeaver.model,
org.jkiss.dbeaver.ext.generic
Bundle-ClassPath: .
Automatic-Module-Name: org.jkiss.dbeaver.ext.databricks
Bundle-Vendor = JKISS
Bundle-Name = DBeaver Azure Databricks Support
\ No newline at end of file
source.. = src/
output.. = target/classes/
bin.includes = .,\
META-INF/,\
OSGI-INF/,\
plugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension point="org.jkiss.dbeaver.dataSourceProvider">
<datasource
class="org.jkiss.dbeaver.ext.databricks.DatabricksDataSourceProvider"
description="Azure Databricks Connector"
id="databricks"
parent="generic"
label="Azure Databricks"
icon="platform:/plugin/org.jkiss.dbeaver.ext.generic/icons/databricks_icon.png"
dialect="databricks">
<drivers managable="true">
<driver
id="databricks"
label="Azure Databricks"
icon="platform:/plugin/org.jkiss.dbeaver.ext.generic/icons/databricks_icon.png"
iconBig="platform:/plugin/org.jkiss.dbeaver.ext.generic/icons/databricks_icon_big.png"
class="com.simba.spark.jdbc.Driver"
webURL="https://databricks.com/"
description="Azure Databricks driver"
categories="sql,analytic,cloud">
<replace provider="generic" driver="azure_databricks"/>
<file type="jar" path="https://databricks-bi-artifacts.s3.us-east-2.amazonaws.com/simbaspark-drivers/jdbc/2.6.22/SimbaSparkJDBC42-2.6.22.1040.zip" bundle="!drivers.databricks"/>
<file type="jar" path="drivers/databricks" bundle="drivers.databricks"/>
</driver>
</drivers>
</datasource>
</extension>
<extension point="org.jkiss.dbeaver.generic.meta">
<meta id="derby" class="org.jkiss.dbeaver.ext.databricks.model.DatabricksMetaModel"
driverClass="com.simba.spark.jdbc.Driver"/>
</extension>
</plugin>
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jkiss.dbeaver</groupId>
<artifactId>plugins</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>org.jkiss.dbeaver.ext.databricks</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2022 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.ext.databricks;
import org.jkiss.dbeaver.ext.generic.GenericDataSourceProvider;
public class DatabricksDataSourceProvider extends GenericDataSourceProvider {
public DatabricksDataSourceProvider() {
}
}
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2022 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.ext.databricks.model;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.ext.generic.model.meta.GenericMetaModel;
import org.jkiss.dbeaver.model.exec.DBCQueryTransformProvider;
import org.jkiss.dbeaver.model.exec.DBCQueryTransformType;
import org.jkiss.dbeaver.model.exec.DBCQueryTransformer;
import org.jkiss.dbeaver.model.impl.sql.QueryTransformerLimit;
public class DatabricksMetaModel extends GenericMetaModel implements DBCQueryTransformProvider {
public DatabricksMetaModel() {
}
@Nullable
@Override
public DBCQueryTransformer createQueryTransformer(@NotNull DBCQueryTransformType type) {
if (type == DBCQueryTransformType.RESULT_SET_LIMIT) {
return new QueryTransformerLimit(false, false);
}
return null;
}
}
......@@ -1373,6 +1373,19 @@
<!-- Replaced by SQL Server extension. We keep it for backward compatibility (driver id reference). -->
</driver>
<driver
id="azure_databricks"
label="Azure Databricks"
icon="icons/databricks_icon.png"
iconBig="icons/databricks_icon_big.png"
class="com.simba.spark.jdbc.Driver"
webURL="https://databricks.com/"
description="Azure Databricks driver"
categories="sql,analytic,cloud">
<file type="jar" path="https://databricks-bi-artifacts.s3.us-east-2.amazonaws.com/simbaspark-drivers/jdbc/2.6.22/SimbaSparkJDBC42-2.6.22.1040.zip" bundle="!drivers.databricks"/>
</driver>
<!--driver
id="linter"
label="Linter"
......
......@@ -25,6 +25,7 @@
<module>org.jkiss.dbeaver.ext.athena</module>
<module>org.jkiss.dbeaver.ext.bigquery</module>
<module>org.jkiss.dbeaver.ext.clickhouse</module>
<module>org.jkiss.dbeaver.ext.databricks</module>
<module>org.jkiss.dbeaver.ext.db2</module>
<module>org.jkiss.dbeaver.ext.db2.zos</module>
<module>org.jkiss.dbeaver.ext.db2.i</module>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册